Skip to content

Fix CodeQL note-severity alerts: missing @Override annotations - #837

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:codeql/missing-override
Aug 4, 2026
Merged

Fix CodeQL note-severity alerts: missing @Override annotations#837
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:codeql/missing-override

Conversation

@vharseko

@vharseko vharseko commented Aug 3, 2026

Copy link
Copy Markdown
Member

Closes all 57 java/missing-override-annotation alerts.

The compiler is the check here: javac rejects @Override on a method which does not override anything, so every one of the 57 annotations is a confirmed override, and the change cannot alter behaviour.

Where they are

  • TextHTTPAccessLogPublisher — 18
  • SNMP access control lists and MIB tables (SNMPInetAddressAcl, SNMPUserAcl, DsTableEntryImpl, DsApplIfOpsEntryImpl, DsMIBImpl, SNMPMonitor) — 22
  • the three PBKDF2 password storage schemes — 12
  • OpenDJProvider, SubResourceCollection, SubResourceSingleton, ServiceDiscoveryMechanismConfigManager, WritabilityMode — 5

One special case

In TextHTTPAccessLogPublisher the annotated methods are the bodies of the enumeration constants, written as a single line table under a // @formatter:off marker:

    ELF_C_IP("c-ip")
            { @Override Object valueOf(HTTPRequestInfo i, String tsf) { return i.getClientAddress (); } },

The annotation has to go inside the constant body — placing it above the constant does not compile — and it is kept inline so that the alignment of the 18 line table is preserved.

Testing

  • Full suites: opendj-core 8173 tests, opendj-config 547, opendj-rest2ldap 531, opendj-server 3 — all passing.
  • opendj-server-legacy (-Pprecommit), covering the annotated classes: PBKDF2PasswordStorageSchemeTestCase (39), PBKDF2HmacSHA256PasswordStorageSchemeTestCase (39), PBKDF2HmacSHA512PasswordStorageSchemeTestCase (39), AbstractTextAccessLogPublisherTest (27), SNMPSyncManagerV2AccessTest (12), DebugLogPublisherTest (6), SNMPTrapManagerTest (1) — 163 tests, all passing.

Add the 57 missing @OverRide annotations reported by
java/missing-override-annotation. The compiler verifies every one of them: it
rejects the annotation on a method which does not override anything, so all 57
are confirmed overrides.

Most of them are in TextHTTPAccessLogPublisher (18), the SNMP access control
lists and tables (22) and the three PBKDF2 password storage schemes (12).

In TextHTTPAccessLogPublisher the annotated methods are the bodies of the
enumeration constants, written as a single line table under a "@Formatter:off"
marker, so the annotation is added inline inside the body rather than above the
constant, which would not compile and would break the alignment of the table.
@vharseko
vharseko requested a review from maximthomas August 3, 2026 17:58
@vharseko vharseko added security Security fixes / CodeQL code-scanning alerts java Pull requests that update java code labels Aug 3, 2026
@vharseko
vharseko merged commit 0c4987c into OpenIdentityPlatform:master Aug 4, 2026
17 checks passed
@vharseko
vharseko deleted the codeql/missing-override branch August 4, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update java code security Security fixes / CodeQL code-scanning alerts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants