Skip to content

Suppress JDK 24 deprecation/removal warnings#364

Open
cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon:jdk24Warnings
Open

Suppress JDK 24 deprecation/removal warnings#364
cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon:jdk24Warnings

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented May 1, 2026

Compiling with JDK 24 produced 70+ [deprecation] and [removal] warnings, plus 16 in the test build. All flagged APIs are intentional uses (finalize() for native cleanup, AccessController / javax.security.cert.* / getSubjectDN etc. required for Java 8 min version support and JSSE interface contracts).

This PR cleans those up by:

  • Adds targeted @SuppressWarnings({"deprecation", "removal"}) on the affected finalize(), methods, locals, and a couple of class declarations (WolfSSLX509X, WolfSSLX509Test).
  • Switches AccessController usages to fully-qualified names in WolfSSLKeyX509, WolfSSLParametersHelper, and WolfSSLJDK8Helper so the import-line [removal] warning (which class-level @SuppressWarnings cannot reach) goes away. Comments added to flag the intent.
  • Adds -Xlint:-path to the build-test javac target to silence the exploded-module classpath warning.

@SuppressWarnings("removal") is unknown to Java 8 javac and silently ignored per JLS, so the Java 8 min version is preserved.

@cconlon cconlon self-assigned this May 1, 2026
Copilot AI review requested due to automatic review settings May 1, 2026 20:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces JDK 24 compiler noise by suppressing intentional [deprecation] / [removal] warnings across the wolfJSSE provider and tests, and by adjusting build flags to avoid select lint warnings during test compilation.

Changes:

  • Add targeted @SuppressWarnings({"deprecation","removal"}) / @SuppressWarnings("removal") annotations around intentional uses (notably finalize(), javax.security.cert.*, and other deprecated-but-required JSSE/JDK8 compatibility APIs).
  • Replace AccessController imports/usages with fully-qualified java.security.AccessController in several helpers to eliminate import-line [removal] warnings on newer JDKs.
  • Update Ant build-test javac args to suppress a lint category related to classpath/module-path warnings.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java Suppresses removal warnings at test class level.
src/test/com/wolfssl/provider/jsse/test/WolfSSLSessionTest.java Suppresses removal warnings on specific tests that touch removed APIs.
src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineTest.java Suppresses removal warnings for test paths using removed certificate-chain APIs.
src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineMemoryLeakTest.java Suppresses removal warnings in memory-leak test that depends on removed APIs.
src/java/com/wolfssl/provider/jsse/adapter/WolfSSLJDK8Helper.java Uses FQN AccessController and suppresses removal warnings for JDK 17+.
src/java/com/wolfssl/provider/jsse/WolfSSLX509X.java Expands suppression to include removal warnings for deprecated/removed X509 APIs.
src/java/com/wolfssl/provider/jsse/WolfSSLX509.java Suppresses deprecation warnings on overridden getIssuerDN/getSubjectDN.
src/java/com/wolfssl/provider/jsse/WolfSSLTrustX509.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java Suppresses deprecation/removal warnings around handshake logic and finalize().
src/java/com/wolfssl/provider/jsse/WolfSSLProvider.java Suppresses deprecation warnings for legacy Provider constructor needed for Java 8.
src/java/com/wolfssl/provider/jsse/WolfSSLParametersHelper.java Uses FQN AccessController and suppresses removal warnings for reflective SSLParameters setup.
src/java/com/wolfssl/provider/jsse/WolfSSLKeyX509.java Uses FQN AccessController and suppresses deprecation/removal warnings for keystore and cleanup paths.
src/java/com/wolfssl/provider/jsse/WolfSSLInternalVerifyCb.java Suppresses deprecation warnings for getSubjectDN() usage in verification logging.
src/java/com/wolfssl/provider/jsse/WolfSSLImplementSSLSession.java Suppresses removal warnings for javax.security.cert.X509Certificate[] peer chain API.
src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/provider/jsse/WolfSSLContext.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLX509Name.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLSession.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLNativeLoggingCallback.java Suppresses deprecation warnings in native logging callback implementation.
src/java/com/wolfssl/WolfSSLNameConstraints.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLDebug.java Suppresses deprecation warnings for legacy logging record/thread-id APIs.
src/java/com/wolfssl/WolfSSLContext.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLCertificate.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLCertRequest.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLCertManager.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSLCRL.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfSSL.java Suppresses deprecation/removal warnings around finalize() cleanup.
src/java/com/wolfssl/WolfCryptEccKey.java Suppresses deprecation/removal warnings around finalize() cleanup.
build.xml Adds a javac lint suppression flag for the test build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/java/com/wolfssl/provider/jsse/adapter/WolfSSLJDK8Helper.java Outdated
Comment thread src/java/com/wolfssl/provider/jsse/WolfSSLKeyX509.java Outdated
Comment thread src/java/com/wolfssl/provider/jsse/WolfSSLParametersHelper.java Outdated
Comment thread build.xml
@cconlon cconlon assigned rlm2002 and unassigned cconlon May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants