Skip to content

docs(properties): the Javadoc of loadProperties(File) follows the code, which throws for a missing file (#55) - #56

Merged
astrapi69 merged 2 commits into
developfrom
docs/55-load-properties-javadoc
Nov 7, 2026
Merged

astrapi69 merged 2 commits into
developfrom
docs/55-load-properties-javadoc

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

Closes #55

PropertiesFileExtensions.loadProperties(File) promised "@return the properties or null if the file is not found."; the delegate, PropertiesExtensions.loadProperties(File) of silly-collection 28, throws FileNotFoundException for a missing file, and its only other null path tests URL.openStream(), which never returns null. The Javadoc follows the code, as for the same Javadoc in astrapi69/silly-collection#145. No behaviour changes.

What changes

  1. test(properties): loadProperties(File) loads a file and throws for a missing one (#55) (9b6fe2c)
    • testLoadPropertiesFile: a file written at runtime gives its one property
    • testLoadPropertiesFileThatDoesNotExist: FileNotFoundException with "does-not-exist.properties not found.", the reproducing test of the issue
  2. docs(properties): the Javadoc of loadProperties(File) follows the code, which throws for a missing file (#55) (a9118f8)
    • @return the properties, and @throws java.io.FileNotFoundException if the file does not exist

Evidence

JDK 17.0.20 (Temurin; the workflow sets up '17'), ./gradlew spotlessApply build --console=plain through the build-slot script; counts summed over build/test-results/test/TEST-*.xml:

commit result files tests failures errors skipped
before 0109bcb (develop) 29 160 0 0 0
tests 9b6fe2c 29 162 0 0 0
Javadoc a9118f8 29 162 0 0 0

./gradlew javadoc --rerun on a9118f8: no warning or error for the changed Javadoc (grep -c -i -E "PropertiesFileExtensions.java:[0-9]+: (warning|warnung)" gives 0).

…missing one (#55)

The Javadoc of loadProperties(File) promises null for a file that is not
found, while the delegate, PropertiesExtensions.loadProperties(File) of
silly-collection, throws FileNotFoundException. No test called the method
with a file of its own. These pin what it does on develop: a file that
exists gives its properties, a file that does not exist throws
FileNotFoundException with "does-not-exist.properties not found.", so the
Javadoc can follow the code in the next commit.
…e, which throws for a missing file (#55)

The Javadoc said "@return the properties or null if the file is not
found." The delegate, PropertiesExtensions.loadProperties(File) of
silly-collection, throws FileNotFoundException for a file that does not
exist, and its only other null path tests URL.openStream(), which never
returns null. The code is the side to keep, as for the same Javadoc in
astrapi69/silly-collection#145: getRedundantKeys in this class uses the
result without a null check, and a caller that checks for null never sees
the missing file. The @return loses the "or null", and a @throws names
FileNotFoundException. The test of the commit before pins both.

Closes #55
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.84%. Comparing base (0109bcb) to head (a9118f8).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #56   +/-   ##
==========================================
  Coverage      74.84%   74.84%           
  Complexity       205      205           
==========================================
  Files             25       25           
  Lines            831      831           
  Branches         140      140           
==========================================
  Hits             622      622           
  Misses           130      130           
  Partials          79       79           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@astrapi69
astrapi69 merged commit f1984aa into develop Nov 7, 2026
9 checks passed
@astrapi69
astrapi69 deleted the docs/55-load-properties-javadoc branch November 7, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PropertiesFileExtensions.loadProperties(File) promises null for a missing file, the code throws FileNotFoundException

1 participant