-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spotbugs and correct found problems #587
Merged
Merged
Commits on May 9, 2022
-
This file contains local configuration generated by Intellij; it is already included in .gitignore.
Configuration menu - View commit details
-
Copy full SHA for 4700826 - Browse repository at this point
Copy the full SHA 4700826View commit details -
Remove Xlint:unchecked and Xlint:deprecation; it is unclear why these were present. Remove always-clean configuration; relying on clean for build correctness is an anti-pattern.
Configuration menu - View commit details
-
Copy full SHA for 6fc4e5c - Browse repository at this point
Copy the full SHA 6fc4e5cView commit details -
Run
check
in CI rather than buildThis also checks style. Update to checkstyle 10.2 while I'm here and clean up all existing style violations (mainly missing docs comments on public classes).
Configuration menu - View commit details
-
Copy full SHA for 1ed2679 - Browse repository at this point
Copy the full SHA 1ed2679View commit details -
Add spotbugs and correct found problems
> Task :spotbugsTest M D NP: Possible null pointer dereference in network.brightspots.rcv.TabulatorTests.runTabulationTest(String) due to return value of called method Dereferenced at TabulatorTests.java:[line 152] M B OS: network.brightspots.rcv.TabulatorTests.fileCompare(String, String) may fail to close stream At TabulatorTests.java:[line 58] H I Dm: Found reliance on default encoding in network.brightspots.rcv.TabulatorTests.fileCompare(String, String): new java.io.FileReader(String) At TabulatorTests.java:[line 57] > Task :spotbugsTest FAILED > Task :spotbugsMain M X OBL: network.brightspots.rcv.JsonParser.readFromFile(String, Class, boolean) may fail to clean up java.io.Reader Obligation to clean up resource created at JsonParser.java:[line 42] is not discharged H I Dm: Found reliance on default encoding in network.brightspots.rcv.JsonParser.readFromFile(String, Class, boolean): new java.io.FileReader(String) At JsonParser.java:[line 42] M P WMI: network.brightspots.rcv.ResultsWriter.getCandidatesWithRanksList(Map) makes inefficient use of keySet iterator instead of entrySet iterator At ResultsWriter.java:[line 168] M P WMI: network.brightspots.rcv.ResultsWriter.setCandidatesToRoundEliminated(Map) makes inefficient use of keySet iterator instead of entrySet iterator At ResultsWriter.java:[line 245] M P WMI: network.brightspots.rcv.ResultsWriter.setWinnerToRound(Map) makes inefficient use of keySet iterator instead of entrySet iterator At ResultsWriter.java:[line 256] M P WMI: network.brightspots.rcv.ResultsWriter.generatePrecinctSummaryFiles(Map, Map, Map) makes inefficient use of keySet iterator instead of entrySet iterator At ResultsWriter.java:[line 289] M P WMI: network.brightspots.rcv.ResultsWriter.updateCandidateNamesInTally(Map) makes inefficient use of keySet iterator instead of entrySet iterator At ResultsWriter.java:[line 880] M P WMI: network.brightspots.rcv.ResultsWriter.addActionObjects(String, List, int, ArrayList, TallyTransfers) makes inefficient use of keySet iterator instead of entrySet iterator At ResultsWriter.java:[line 921] M P WMI: network.brightspots.rcv.ClearBallotCvrReader.readCastVoteRecords(List, String) makes inefficient use of keySet iterator instead of entrySet iterator At ClearBallotCvrReader.java:[line 109] H I Dm: Found reliance on default encoding in network.brightspots.rcv.ClearBallotCvrReader.readCastVoteRecords(List, String): new java.io.FileReader(String) At ClearBallotCvrReader.java:[line 51] M D REC: Exception is caught when Exception is not thrown in network.brightspots.rcv.HartCvrReader.readCastVoteRecord(List, Path) At HartCvrReader.java:[line 128] M X OBL: network.brightspots.rcv.HartCvrReader.readCastVoteRecord(List, Path) may fail to clean up java.io.InputStream Obligation to clean up resource created at HartCvrReader.java:[line 80] is not discharged M X OBL: network.brightspots.rcv.CommonDataFormatReader.parseXml(List) may fail to clean up java.io.InputStream Obligation to clean up resource created at CommonDataFormatReader.java:[line 132] is not discharged M P WMI: network.brightspots.rcv.Tabulator.updatePastWinnerTallies() makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 319] M P WMI: network.brightspots.rcv.Tabulator.updatePastWinnerTallies() makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 273] M P WMI: network.brightspots.rcv.Tabulator.updatePastWinnerTallies() makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 297] M P WMI: network.brightspots.rcv.Tabulator.identifyWinners(Map, SortedMap) makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 481] M P WMI: network.brightspots.rcv.Tabulator.dropCandidatesBelowThreshold(SortedMap) makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 567] M P WMI: network.brightspots.rcv.Tabulator.runBatchElimination(SortedMap) makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 740] M P WMI: network.brightspots.rcv.Tabulator.computeTalliesForRound(int) makes inefficient use of keySet iterator instead of entrySet iterator At Tabulator.java:[line 1006] M C RCN: Nullcheck of config at line 143 of value previously dereferenced in network.brightspots.rcv.TabulatorSession.tabulate() At TabulatorSession.java:[line 143] H I Dm: Found reliance on default encoding in network.brightspots.rcv.TabulatorSession.tabulate(): new java.io.FileReader(String) At TabulatorSession.java:[line 152] M B OS: network.brightspots.rcv.GuiConfigController.loadTxtFileIntoString(String) may fail to close stream At GuiConfigController.java:[line 272] H I Dm: Found reliance on default encoding in network.brightspots.rcv.GuiConfigController.loadTxtFileIntoString(String): new java.io.InputStreamReader(InputStream) At GuiConfigController.java:[line 275] H I Dm: Found reliance on default encoding in network.brightspots.rcv.Tiebreak.doInteractiveCli(List): new java.util.Scanner(InputStream) At Tiebreak.java:[line 169] > Task :spotbugsMain FAILED
Configuration menu - View commit details
-
Copy full SHA for 7e33c79 - Browse repository at this point
Copy the full SHA 7e33c79View commit details
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.