diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts index e4955d306..7303e910e 100644 --- a/benchmarks/build.gradle.kts +++ b/benchmarks/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { implementation("com.mysql:mysql-connector-j:9.2.0") implementation("org.mariadb.jdbc:mariadb-java-client:3.5.3") implementation("com.zaxxer:HikariCP:4.0.3") + implementation("org.checkerframework:checker-qual:3.49.2") testImplementation("org.junit.jupiter:junit-jupiter-api:5.12.1") testImplementation("org.mockito:mockito-inline:4.11.0") // 4.11.0 is the last version compatible with Java 8 diff --git a/wrapper/src/main/java/software/amazon/jdbc/PropertyDefinition.java b/wrapper/src/main/java/software/amazon/jdbc/PropertyDefinition.java index b38de90f2..68a3568d9 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/PropertyDefinition.java +++ b/wrapper/src/main/java/software/amazon/jdbc/PropertyDefinition.java @@ -190,8 +190,7 @@ public class PropertyDefinition { * The usage of the method should be restricted. In most cases the {@link #byName(String)} method should be used * since the driver internally treats all properties in case-sensitive manner. * - *

- * For the moment only {@link software.amazon.jdbc.util.ConnectionUrlParser} uses this method. + *

For the moment only {@link software.amazon.jdbc.util.ConnectionUrlParser} uses this method. */ public static @Nullable AwsWrapperProperty byNameIgnoreCase(final String name) { return PROPS_BY_NAME_LOWERCASE.get(name.toLowerCase()); diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointMonitorImpl.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointMonitorImpl.java index 2a097ff9e..489d57bc0 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointMonitorImpl.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointMonitorImpl.java @@ -78,6 +78,7 @@ public class CustomEndpointMonitorImpl implements CustomEndpointMonitor { * @param pluginService The plugin service to use to update the set of allowed/blocked hosts according to * the custom endpoint info. * @param customEndpointHostSpec The host information for the custom endpoint to be monitored. + * @param endpointIdentifier An endpoint identifier. * @param region The region of the custom endpoint to be monitored. * @param refreshRateNano Controls how often the custom endpoint information should be fetched and analyzed for * changes. The value specified should be in nanoseconds. diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointPlugin.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointPlugin.java index a039c6aa6..8cf22530b 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointPlugin.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/customendpoint/CustomEndpointPlugin.java @@ -207,6 +207,7 @@ public Connection connect( * Creates a monitor for the custom endpoint if it does not already exist. * * @param props The connection properties. + * @return {@link CustomEndpointMonitor} */ protected CustomEndpointMonitor createMonitorIfAbsent(Properties props) { return monitors.computeIfAbsent( @@ -229,6 +230,8 @@ protected CustomEndpointMonitor createMonitorIfAbsent(Properties props) { * If custom endpoint info does not exist for the current custom endpoint, waits a short time for the info to be * made available by the custom endpoint monitor. This is necessary so that other plugins can rely on accurate custom * endpoint info. Since custom endpoint monitors and information are shared, we should not have to wait often. + * + * @param monitor A {@link CustomEndpointMonitor} monitor. */ protected void waitForCustomEndpointInfo(CustomEndpointMonitor monitor) throws SQLException { boolean hasCustomEndpointInfo = monitor.hasCustomEndpointInfo(); diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorConnectionContext.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorConnectionContext.java index 3f538f838..195e60869 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorConnectionContext.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorConnectionContext.java @@ -62,6 +62,7 @@ public class MonitorConnectionContext { * @param failureDetectionIntervalMillis Interval between each failed connection check. * @param failureDetectionCount Number of failed connection checks before considering database * node as unhealthy. + * @param abortedConnectionsCounter Aborted connection telemetry counter. */ public MonitorConnectionContext( final Monitor monitor, diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorImpl.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorImpl.java index 5bd55516d..55a65000b 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorImpl.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorImpl.java @@ -368,6 +368,8 @@ public boolean isStopped() { /** * Used to help with testing. + * + * @param duration Duration of sleep in millis. */ protected void sleep(long duration) throws InterruptedException { TimeUnit.MILLISECONDS.sleep(duration); diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorImpl.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorImpl.java index be8e13130..b821894e0 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorImpl.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorImpl.java @@ -95,6 +95,10 @@ public class MonitorImpl implements Monitor { * instance is monitoring. * @param properties The {@link Properties} containing additional monitoring * configuration. + * @param failureDetectionTimeMillis A failure detection time in millis. + * @param failureDetectionIntervalMillis A failure detection interval in millis. + * @param failureDetectionCount A failure detection count. + * @param abortedConnectionsCounter Aborted connection telemetry counter. */ public MonitorImpl( final @NonNull PluginService pluginService, diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorService.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorService.java index 6fd36bc87..20512dc4c 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorService.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorService.java @@ -39,6 +39,7 @@ MonitorConnectionContext startMonitoring( * Removes the context from the {@link MonitorImpl}. * * @param context The {@link MonitorConnectionContext} representing a connection. + * @param connectionToAbort A connection to abort. */ void stopMonitoring(MonitorConnectionContext context, Connection connectionToAbort); diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorServiceImpl.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorServiceImpl.java index f0f10dd0a..d42b57c05 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorServiceImpl.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/efm2/MonitorServiceImpl.java @@ -160,6 +160,9 @@ public void releaseResources() { * * @param hostSpec Information such as hostname of the server. * @param properties The user configuration for the current connection. + * @param failureDetectionTimeMillis A failure detection time in millis. + * @param failureDetectionIntervalMillis A failure detection interval in millis. + * @param failureDetectionCount A failure detection count. * @return A {@link MonitorImpl} object associated with a specific server. */ protected Monitor getMonitor( diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/failover2/FailoverConnectionPlugin.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/failover2/FailoverConnectionPlugin.java index 6d45b8c0b..e11dcbcae 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/failover2/FailoverConnectionPlugin.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/failover2/FailoverConnectionPlugin.java @@ -277,6 +277,7 @@ protected void invalidInvocationOnClosedConnection() throws SQLException { /** * Checks if the given method is allowed on closed connections. * + * @param methodName A method name to check. * @return true if the given method is allowed on closed connections */ protected boolean allowedOnClosedConnection(final String methodName) { diff --git a/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle b/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle index 2db0015b9..0d217b6e4 100644 --- a/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle +++ b/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle @@ -307,6 +307,7 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch javadoc { configure(options) { + (this as CoreJavadocOptions).addBooleanOption("Xdoclint:none", true) overview = 'src/main/javadoc/overview.html' stylesheetFile = new File(projectDir, 'src/main/javadoc/stylesheet.css') }