Skip to content

Suppress JDK 24 deprecation/removal warnings#213

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

Suppress JDK 24 deprecation/removal warnings#213
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 37 [deprecation] and [removal] warnings on ant 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:

  • Adds @SuppressWarnings({"deprecation", "removal"}) on the affected finalize() methods across WolfCryptCipher, NativeStruct, WolfCryptKeyAgreement, WolfCryptKeyPairGenerator, WolfCryptMac, WolfCryptMessageDigest* (Md5/Sha/Sha224/256/384/512/Sha3), WolfCryptRandom, WolfCryptSignature, WolfSSLKeyStore, WolfSSLCertManager, WolfSSLX509StoreCtx.
  • Adds method/local-level @SuppressWarnings("deprecation") on WolfCryptCipher.setOaepParams (OAEPParameterSpec.DEFAULT), WolfCryptDebug (LogRecord.getThreadID), and the WolfCryptProvider constructor.
  • Adds -Xlint:-path to the build-test javac target in build.xml 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 21:08
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 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 multiple finalize() implementations used for native resource cleanup.
  • Adds targeted @SuppressWarnings("deprecation") for specific intentional uses (OAEPParameterSpec.DEFAULT, LogRecord.getThreadID(), deprecated Provider constructor).
  • Updates the Ant build-test target to pass -Xlint:-path to 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.

@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