Suppress JDK 24 deprecation/removal warnings#364
Open
cconlon wants to merge 1 commit intowolfSSL:masterfrom
Open
Suppress JDK 24 deprecation/removal warnings#364cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon wants to merge 1 commit intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
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 (notablyfinalize(),javax.security.cert.*, and other deprecated-but-required JSSE/JDK8 compatibility APIs). - Replace
AccessControllerimports/usages with fully-qualifiedjava.security.AccessControllerin several helpers to eliminate import-line[removal]warnings on newer JDKs. - Update Ant
build-testjavac 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.
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.
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.*/getSubjectDNetc. required for Java 8 min version support and JSSE interface contracts).This PR cleans those up by:
@SuppressWarnings({"deprecation", "removal"})on the affectedfinalize(), methods, locals, and a couple of class declarations (WolfSSLX509X,WolfSSLX509Test).AccessControllerusages to fully-qualified names inWolfSSLKeyX509,WolfSSLParametersHelper, andWolfSSLJDK8Helperso the import-line[removal]warning (which class-level@SuppressWarningscannot reach) goes away. Comments added to flag the intent.-Xlint:-pathto thebuild-testjavac 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.