Suppress JDK 24 deprecation/removal warnings#213
Open
cconlon wants to merge 1 commit intowolfSSL:masterfrom
Open
Suppress JDK 24 deprecation/removal warnings#213cconlon 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 known/intentional deprecation and removal warnings in wolfSSL/wolfCrypt Java bindings, and by silencing a javac -Xlint:path warning when compiling tests via Ant.
Changes:
- Adds
@SuppressWarnings({"deprecation", "removal"})to multiplefinalize()implementations used for native resource cleanup. - Adds targeted
@SuppressWarnings("deprecation")for specific intentional uses (OAEPParameterSpec.DEFAULT,LogRecord.getThreadID(), deprecatedProviderconstructor). - Updates the Ant
build-testtarget to pass-Xlint:-pathto javac.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/wolfssl/wolfcrypt/WolfSSLX509StoreCtx.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/wolfcrypt/WolfSSLCertManager.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/wolfcrypt/NativeStruct.java | Suppresses deprecation/removal warnings on finalize() for native struct release. |
| src/main/java/com/wolfssl/provider/jce/WolfSSLKeyStore.java | Suppresses deprecation/removal warnings on finalize() used to clear sensitive cache data. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptSignature.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptRandom.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptProvider.java | Suppresses deprecation warning for deprecated Provider superclass constructor usage. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestSha512.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestSha384.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestSha3.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestSha256.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestSha224.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestSha.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMessageDigestMd5.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptMac.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptKeyPairGenerator.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptKeyAgreement.java | Suppresses deprecation/removal warnings on finalize() for native cleanup. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptDebug.java | Suppresses deprecation warning for LogRecord.getThreadID() usage in formatter. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptCipher.java | Suppresses deprecation warning for OAEPParameterSpec.DEFAULT usage; suppresses deprecation/removal on finalize(). |
| build.xml | Adds -Xlint:-path to test compilation to silence classpath/module-path warnings. |
💡 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 37
[deprecation]and[removal]warnings onant build-jce-debug, plus 1 path warning on the test build. All flagged APIs are intentional uses (finalize()for native struct cleanup,OAEPParameterSpec.DEFAULT,LogRecord.getThreadID(),Provider(String,double,String)).This PR cleans those up:
@SuppressWarnings({"deprecation", "removal"})on the affectedfinalize()methods acrossWolfCryptCipher,NativeStruct,WolfCryptKeyAgreement,WolfCryptKeyPairGenerator,WolfCryptMac,WolfCryptMessageDigest*(Md5/Sha/Sha224/256/384/512/Sha3),WolfCryptRandom,WolfCryptSignature,WolfSSLKeyStore,WolfSSLCertManager,WolfSSLX509StoreCtx.@SuppressWarnings("deprecation")onWolfCryptCipher.setOaepParams(OAEPParameterSpec.DEFAULT),WolfCryptDebug(LogRecord.getThreadID), and theWolfCryptProviderconstructor.-Xlint:-pathto thebuild-testjavac target inbuild.xmlto 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.