fix: address CodeQL quality alerts - #480
Merged
Merged
Conversation
Adds @OverRide to the 553 methods that CodeQL's java/missing-override-annotation flags. No behavior change; compiled at --release 8 to confirm each one really overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZEDsWHuCKX7Cdwm6KvjpF
#388 moved the Android layer to src/main/kotlin, so the gate, which only scanned src/main/java, reported classic/android and core/android as stale and turned Static Analysis red on main. Scan both source roots for the package catalogue and both dependency rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZEDsWHuCKX7Cdwm6KvjpF
Bugs: - SiftingAppenderBase.start() threw NullPointerException instead of reporting "Missing discriminator" when none was configured. - AbstractSocketAppender threw NullPointerException once the host resolved if reconnectionDelay was set to null; treat null as zero, as the resolution retry loop already did. - Compressor leaked the FileOutputStream when the GZIPOutputStream constructor threw (it writes the gzip header). - ElementPath overrode equals() without hashCode(); add one consistent with its case-insensitive comparison. - Logger.getLevel() read the level without the lock setLevel() holds; make the field volatile. - ScanException overrode Throwable's synchronized getCause() with an unsynchronized one; pass the cause to Throwable instead. - ConfigurationWatchList decoded file URLs with the platform charset (deprecated URLDecoder.decode(String)); URL escapes are UTF-8. Cleanups: always-true instanceof and count checks, redundant toString() calls, a shadowed field, a non-static inner class, missing spaces in two status messages, stale Javadoc @PARAM names, the "No context given" message printing ContextAwareImpl's default toString(), and unused parameters of private and package-private methods. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZEDsWHuCKX7Cdwm6KvjpF
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.
Follow-up to #479. This takes the open CodeQL alerts from 650 to 67, measured by a local CodeQL 2.27.1 run of the same
security-and-qualitysuite thatcodeql.ymluses. It also fixesmain's red Static Analysis.Review commit by commit:
style: add missing @Override annotationsadds 553@Overridelines and nothing else. Every one compiles at--release 8, which confirms each method really does override.ci: catalogue Kotlin packages in the architecture-docs gate: Static Analysis has failed onmainsince refactor: convert the Android-specific layer to Kotlin聽#388, becausecheck-architecture-docs.shonly scannedsrc/main/javaand reportedclassic/androidandcore/androidas stale. It now scans both source roots, for the package catalogue and for both dependency rules.components.mdand the architecture-sync skill now mentionsrc/main/kotlin.fix: address CodeQL quality alertsBugs fixed
SiftingAppenderBase.start()threw an NPE instead of reporting "Missing discriminator" when none was configured. NewSiftingAppenderBaseTest.AbstractSocketAppenderthrew an NPE once the host resolved ifreconnectionDelaywasnull. Null now counts as zero, which is what the resolution retry loop already did.Compressorleaked theFileOutputStreamwhen theGZIPOutputStreamconstructor threw (the constructor writes the gzip header).ElementPathoverrodeequals()withouthashCode(). The newhashCode()folds case the same wayequalsIgnoreCasedoes. NewElementPathTest.Logger.levelis nowvolatile:getLevel()read it without the lock thatsetLevel()holds.ScanExceptionoverrode Throwable's synchronizedgetCause(). It now passes the cause toThrowableinstead.ConfigurationWatchListdecoded file URLs with the platform charset through the deprecatedURLDecoder.decode(String). It now decodes them as UTF-8, which is the encoding URL escapes use.Cleanups
instanceofandcountcheckstoString()calls@paramnamesContextAwareImpl's defaulttoString(); it now prints the originRemaining 67 alerts
These can't be fixed without breaking the public API or the Android / Java 8 floor, so they need dismissing on the Security tab after merge:
unused-parameterconfusing-method-signatureLoggeroverloadsuncaught-number-format-exceptiondeprecated-callLocale.ofandURI.toURLreplacements aren't available on Android / Java 8 or behave differentlyconfusing-method-namesetSMTPHost/setSmtpHostconfig namesunsafe-deserializationinternal-representation-exposuremissing-clone-methodclone()is inheritedunsafe-cert-trustclass-name-matches-super-classLoggerimplementsorg.slf4j.Loggerignored-error-status-of-callneverBlockdrops events when the queue is full, by designTesting
mainand on this branch. Both give 721 passing, with no pass/fail differences. Robolectric tests can't load in that sandbox (no Google Maven access), so CI is their real check.mainand pass here../scripts/check-architecture-docs.shpasses; onmainit fails.Deferred work considered: none of the open issues (#135, #223, #344, #352, #366, #371) touch the changed code.
馃 Generated with Claude Code
https://claude.ai/code/session_01EZEDsWHuCKX7Cdwm6KvjpF
Generated by Claude Code