Skip to content

Commit e516274

Browse files
authored
Add missing @OverRide annotations (CodeQL java/missing-override-annotation) (#246)
Annotate 308 methods that override a superclass method or implement an interface method but were missing @OverRide, across 97 files in 9 modules. Annotation-only and behavior-preserving; verified by compiling every affected Maven module (plus javac for the two persistit Ant examples).
1 parent a0c3465 commit e516274

96 files changed

Lines changed: 492 additions & 76 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bloomfilter/core/src/main/java/org/forgerock/bloomfilter/BloomFilters.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2015 ForgeRock AS.
15+
* Portions Copyrighted 2026 3A Systems, LLC
1516
*/
1617

1718
package org.forgerock.bloomfilter;
@@ -297,6 +298,7 @@ public RollingBloomFilterBuilder(final BloomFilterBuilder<T> toCopy) {
297298
}
298299

299300
@VisibleForTesting
301+
@Override
300302
RollingBloomFilterBuilder<T> withClock(final TimeService clock) {
301303
Reject.ifNull(clock);
302304
this.clock = clock;

build-tools/src/main/java/org/forgerock/testng/ForgeRockTestListener.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* Copyright 2008 Sun Microsystems, Inc.
1515
* Portions copyright 2011-2012 ForgeRock AS
16+
* Portions Copyrighted 2026 3A Systems, LLC
1617
*/
1718
package org.forgerock.testng;
1819

@@ -302,6 +303,7 @@ public ForgeRockTestListener() {
302303
initializeProgressVars();
303304
}
304305

306+
@Override
305307
public void generateReport(final List<XmlSuite> xmlSuites, final List<ISuite> suites,
306308
final String outputDirectory) {
307309
final File reportFile = new File(outputDirectory, REPORT_FILE_NAME);
@@ -310,6 +312,7 @@ public void generateReport(final List<XmlSuite> xmlSuites, final List<ISuite> su
310312
writeAntTestsFailedMarker(outputDirectory);
311313
}
312314

315+
@Override
313316
public void onConfigurationFailure(final ITestResult tr) {
314317
super.onConfigurationFailure(tr);
315318

@@ -331,18 +334,21 @@ public void onConfigurationFailure(final ITestResult tr) {
331334
_bufferedTestFailures.append(failureInfo);
332335
}
333336

337+
@Override
334338
public void onStart(final ITestContext testContext) {
335339
super.onStart(testContext);
336340

337341
// Delete the previous report if it's there.
338342
new File(testContext.getOutputDirectory(), REPORT_FILE_NAME).delete();
339343
}
340344

345+
@Override
341346
public void onTestFailedButWithinSuccessPercentage(final ITestResult tr) {
342347
super.onTestFailedButWithinSuccessPercentage(tr);
343348
onTestFinished(tr);
344349
}
345350

351+
@Override
346352
public void onTestFailure(final ITestResult tr) {
347353
super.onTestFailure(tr);
348354

@@ -378,18 +384,21 @@ public void onTestFailure(final ITestResult tr) {
378384
onTestFinished(tr);
379385
}
380386

387+
@Override
381388
public void onTestSkipped(final ITestResult tr) {
382389
super.onTestSkipped(tr);
383390
onTestFinished(tr);
384391
}
385392

393+
@Override
386394
public void onTestStart(final ITestResult tr) {
387395
super.onTestStart(tr);
388396
enforceTestClassTypeAndAnnotations(tr);
389397
checkForInterleavedBetweenClasses(tr);
390398
enforceMethodHasAnnotation(tr);
391399
}
392400

401+
@Override
393402
public void onTestSuccess(final ITestResult tr) {
394403
super.onTestSuccess(tr);
395404
onTestFinished(tr);
@@ -584,6 +593,7 @@ private List<TestClassResults> getClassesDescendingSortedByDuration() {
584593
final List<TestClassResults> allClasses = new ArrayList<TestClassResults>(
585594
_classResults.values());
586595
Collections.sort(allClasses, new Comparator<TestClassResults>() {
596+
@Override
587597
public int compare(final TestClassResults o1, final TestClassResults o2) {
588598
if (o1._totalDurationMs > o2._totalDurationMs) {
589599
return -1;
@@ -607,6 +617,7 @@ private String getFqMethod(final ITestResult result) {
607617
private List<TestMethodResults> getMethodsDescendingSortedByDuration() {
608618
final List<TestMethodResults> allMethods = getAllMethodResults();
609619
Collections.sort(allMethods, new Comparator<TestMethodResults>() {
620+
@Override
610621
public int compare(final TestMethodResults o1, final TestMethodResults o2) {
611622
if (o1._totalDurationMs > o2._totalDurationMs) {
612623
return -1;

cassandra-embedded/src/main/java/org/openidentityplatform/commons/cassandra/EmbeddedServer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class EmbeddedServer implements Runnable, AutoCloseable {
4747
final private ExecutorService executor = Executors.newSingleThreadExecutor();
4848
private CassandraDaemon cassandraDaemon;
4949

50+
@Override
5051
public void run() {
5152
try {
5253
//check for external cassandra settings
@@ -139,6 +140,7 @@ public void run() {
139140
}
140141
}
141142

143+
@Override
142144
public void close() {
143145
if (cassandraDaemon!=null) {
144146
cassandraDaemon.stop();

commons/audit/handler-csv/src/main/java/org/forgerock/audit/handlers/csv/CsvWriter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ interface CsvWriter extends AutoCloseable {
4848
*/
4949
void flush() throws IOException;
5050

51+
@Override
5152
void close() throws IOException;
5253
}

commons/audit/handler-csv/src/main/java/org/forgerock/audit/handlers/csv/StandardCsvWriter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public void writeEvent(Map<String, String> values) throws IOException {
135135
* Flush the data into the CSV file.
136136
* @throws IOException if an I/O error occurs while flushing.
137137
*/
138+
@Override
138139
public void flush() throws IOException {
139140
csvWriter.flush();
140141
}

commons/audit/handler-jdbc/src/main/java/org/forgerock/audit/handlers/jdbc/BufferedJdbcAuditEventExecutor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* Copyright 2015-2016 ForgeRock AS.
1515
* Portions Copyright 2016 Nomura Research Institute, Ltd.
16+
* Portions Copyrighted 2026 3A Systems, LLC
1617
*/
1718
package org.forgerock.audit.handlers.jdbc;
1819

@@ -87,6 +88,7 @@ public BufferedJdbcAuditEventExecutor(int capacity, boolean autoFlush, JdbcAudit
8788
this.maxBatchedEvents = maxBatchedEvents;
8889
}
8990

91+
@Override
9092
public void flush() {
9193
try {
9294
while (!queue.isEmpty()) {

commons/audit/handler-jms/src/main/java/org/forgerock/audit/handlers/jms/JmsAuditEventHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public void shutdown() throws ResourceException {
119119
* @param auditEvent The event to convert to a JMS TextMessage and publish on the JMS Topic.
120120
* @return a promise with either a response or an exception
121121
*/
122+
@Override
122123
public Promise<ResourceResponse, ResourceException> publishEvent(Context context, String auditTopic,
123124
JsonValue auditEvent) {
124125
try {

commons/audit/handler-jms/src/main/java/org/forgerock/audit/handlers/jms/JndiJmsContextManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15-
* Portions copyright 2024 3A Systems LLC.
15+
* Portions copyright 2024-2026 3A Systems LLC.
1616
*/
1717

1818
package org.forgerock.audit.handlers.jms;
@@ -67,6 +67,7 @@ class JndiJmsContextManager implements JmsContextManager {
6767
* @return The {@link Topic JMS topic} to use for JMS publish/subscribe functionality.
6868
* @throws InternalServerErrorException If unable to retrieve the {@link Topic JMS topic}.
6969
*/
70+
@Override
7071
public Topic getTopic() throws InternalServerErrorException {
7172
try {
7273
if (topic == null) {
@@ -83,6 +84,7 @@ public Topic getTopic() throws InternalServerErrorException {
8384
* @return the {@link ConnectionFactory JMS connection factory} to use to connect to JMS services.
8485
* @throws InternalServerErrorException If unable to retrieve the {@link ConnectionFactory JMS connection factory}.
8586
*/
87+
@Override
8688
public ConnectionFactory getConnectionFactory() throws InternalServerErrorException {
8789
try {
8890
if (connectionFactory == null) {

commons/audit/handler-syslog/src/main/java/org/forgerock/audit/handlers/syslog/SyslogConnection.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* Copyright 2013 Cybernetica AS
1515
* Portions copyright 2014-2015 ForgeRock AS.
16+
* Portions Copyrighted 2026 3A Systems, LLC
1617
*/
1718
package org.forgerock.audit.handlers.syslog;
1819

@@ -29,5 +30,6 @@ interface SyslogConnection extends AutoCloseable {
2930

3031
void flush() throws IOException;
3132

33+
@Override
3234
void close();
3335
}

commons/audit/handler-syslog/src/main/java/org/forgerock/audit/handlers/syslog/SyslogPublisher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* Copyright 2013 Cybernetica AS
1515
* Portions copyright 2014-2015 ForgeRock AS.
16+
* Portions Copyrighted 2026 3A Systems, LLC
1617
*/
1718
package org.forgerock.audit.handlers.syslog;
1819

@@ -35,5 +36,6 @@ interface SyslogPublisher extends AutoCloseable {
3536
/**
3637
* Closes the underlying connection.
3738
*/
39+
@Override
3840
void close();
3941
}

0 commit comments

Comments
 (0)