Repository navigation
docs(properties): the Javadoc of loadProperties(File) follows the code, which throws for a missing file (#55) - #56
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #55
PropertiesFileExtensions.loadProperties(File)promised "@returnthe properties or null if the file is not found."; the delegate,PropertiesExtensions.loadProperties(File)of silly-collection 28, throwsFileNotFoundExceptionfor a missing file, and its only other null path testsURL.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
test(properties): loadProperties(File) loads a file and throws for a missing one (#55)(9b6fe2c)testLoadPropertiesFile: a file written at runtime gives its one propertytestLoadPropertiesFileThatDoesNotExist:FileNotFoundExceptionwith "does-not-exist.properties not found.", the reproducing test of the issuedocs(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 existEvidence
JDK 17.0.20 (Temurin; the workflow sets up
'17'),./gradlew spotlessApply build --console=plainthrough the build-slot script; counts summed overbuild/test-results/test/TEST-*.xml:./gradlew javadoc --rerunon a9118f8: no warning or error for the changed Javadoc (grep -c -i -E "PropertiesFileExtensions.java:[0-9]+: (warning|warnung)"gives 0).