Modernize
Modernize your code to best use the project's current JDK version. Take advantage of newly available APIs and reduce the dependency of your code on third party dependencies where there is equivalent functionality in the Java standard library.
Categories
- Cobertura
- DataNucleus
- Guava
- JaCoCo
- Jakarta
- Java EE 7
- Java EE 8
- Jspecify
- Lombok
- Maven
- Metrics
- Nio
- Search
- java.awt APIs
- java.io APIs
- java.lang APIs
- java.net APIs
- java.sql APIs
- java.util APIs
- java.util.concurrent APIs
- java.util.logging APIs
- javax APIs
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
- Add
lombok-mapstruct-bindingwhen both MapStruct and Lombok are used - Add missing JDBC interface methods
- Add missing
isWrapperForandunwrapmethods - Adopt
javax.security.auth.Subject.current()andjavax.security.auth.Subject.callAs()methods - Adopt
setLongThreadIDinjava.util.logging.LogRecord - Adopt switch pattern matching (JEP 441)
- Avoid using the deprecated empty
finalize()method injava.desktop - Change
java.lang.reflect.Modifierandjava.lang.invoke.ConstantBootstrapsmethod calls to static - Do not package
java.xml.bindandjava.activationmodules in WebSphere Liberty applications - Do not package
java.xml.wsmodule in WebSphere Liberty applications - Enable Lombok annotation processor
- Java best practices
- Migrate Bouncy Castle to
jdk15to18for Java < 8 - Migrate Bouncy Castle to
jdk18on - Migrate to IBM Semeru Runtimes
- Migrate to Java 11
- Migrate to Java 17
- Migrate to Java 21
- Migrate to Java 25
- Migrate to Java 6
- Migrate to Java 7
- Migrate to Java 8
- Migrate to Java EE 7
- Migrate to Java EE 8
- Remove
AccessController.checkPermission(..)calls - Remove
Policy.setPolicy(..)calls - Remove
Runtime.traceInstructions(boolean)andRuntime.traceMethodCallsmethods - Remove
SecurityManagerpermission checks - Remove
Thread.destroy()andThread.stop(Throwable) - Replace
System.getSecurityManager()withnull - Replace
finalizemethod injava.io.FileInputStreamandjava.io.FileOutputStream - Replace
finalizemethod injava.util.zip.ZipFile,java.util.zip.Inflaterandjava.util.zip.Deflater - Set visibility of
premainandagentmainmethods topublic - Upgrade Java version
- Upgrade Kotlin to 2.3 for Java 25 compatibility
- Upgrade plugins to Java 11 compatible versions
- Upgrade plugins to Java 17 compatible versions
- Upgrade plugins to Java 21 compatible versions
- Upgrade plugins to Java 25 compatible versions
- Use
ASN1*Stringfor the result ofDER*String.getInstance(..) - Use
com.ibm.jsse2instead ofcom.sun.net.ssl.internal.ssl
Recipes
- Add
JDeprScanMaven plugin - Add Mockito Java agent to Maven Surefire plugin
- Add
argLineto Maven Surefire and Failsafe plugins - Add
aspectjtoolsto the AspectJ Maven plugin - Add
lombokto themaven-compiler-pluginannotation processor paths - Add
lombok-mapstruct-bindingdependency for Maven when both MapStruct and Lombok are used - Add
mapstruct-processorto themaven-compiler-pluginannotation processor paths - Add
maven-jar-pluginto suppress illegal reflection warnings - Add missing method implementations
- Add
staticmodifier to@Producesfields in session beans - Add
versionandbean-discovery-modetobeans.xmlfiles without a version - Catch
TypeNotPresentExceptionthrown byClass.getAnnotation() - Change
beans.xmlschemaLocationto match XML namespace - Change
javax.tools.ToolProvidermethods calls to static - Change method invocation return type
- Change
net.wasdev.maven.parent:java8-parentto:parent - Comment Kotlin modules capped at Java 24
- Disable the persistence unit second-level cache
- Explain why the Java version was capped at 24 for Kotlin modules
- Force indentation to either tabs or spaces
- Make MBean and MXBean interfaces public
- Migrate GraalVM
resource-config.jsonto glob patterns - Migrate
com.intellij:annotationstoorg.jetbrains:annotations - Migrate from IBM runtimes to Oracle runtimes
- Migrate to Java EE 6
- Move Bouncy Castle SPHINCS+ classes to
pqc.legacy - Prefer
java.util.Base64instead ofsun.misc - Remove
Thread.countStackFrames()method - Remove explicit casts on
Arrays.asList(..).toArray() - Remove illegal semicolons
- Rename final method declarations
getSuppressed()andaddSuppressed(Throwable exception)in classes that extendThrowable - Replace AWT
getPeer()method - Replace DTO method parameters with data elements
- Replace
IllegalArgumentExceptionwithAlreadyConnectedExceptioninDatagramChannel.send()method - Replace
KeyStore.getDefaultType()with"jks" - Replace
RMIConnectorServer.CREDENTIAL_TYPESconstant - Replace
SSLSession.getPeerCertificateChain()method - Replace
Stringliteral - Replace
com.sun.awt.AWTUtilitiesstatic method invocations - Replace
com.sun.net.sslpackage - Replace deprecated methods in
SecurityManager - Replace
getLocalizedInputStreamandgetLocalizedOutputStreamwith direct assignment - Replace
java.lang.ref.Reference.clone()with constructor call - Replace
javax.security.auth.Policywithjava.security.Policy - Simplify the removed security manager's thread group fallback
- Turn dangling documentation comments into block comments
- Update SDKMAN! Java version
- Upgrade CircleCI OpenJDK job images
- Upgrade Docker image Java version
- Upgrade Java version in alternate Maven builds
- Upgrade Kotlin
jvmTargetto match the Java version - Upgrade Spring Boot 3 Maven parents for Java 25
- Upgrade build to Java 11
- Upgrade build to Java 17
- Upgrade build to Java 21
- Upgrade build to Java 24 for Kotlin 1.x
- Upgrade build to Java 25 (non-Kotlin)
- Upgrade build to Java 25 for Kotlin 2.3+
- Use
SunJSSEinstead ofcom.sun.net.ssl.internal.ssl.Provider - Use
ZipExceptioninstead ofZipError - Use
com.ibm.net.ssl.www2.protocolinstead ofcom.sun.net.ssl.internal.www.protocol - Use
com.ibm.net.ssl.www2.protocol.https.Handlerinstead ofcom.sun.net.ssl.internal.www.protocol.https.Handler - Use
com.sun.security.auth.module.Krb5LoginModuleinstead ofcom.ibm.security.auth.module.Krb5LoginModule - Use
com.sun.xml.bind.*instead ofcom.sun.xml.internal.bind.* - Use
java.security.certinstead ofjavax.security.cert - Use
javax.net.sslinstead ofcom.sun.net.ssl