Comment on page
7.39.1 Release (2023-04-04)
- The code was optimized to eliminate redundant POM resolutions. You should see a substantial increase in speed when running recipes across multiple repositories.
- org.openrewrite.java.ReplaceConstantWithAnotherConstant: Replace constant with another constant, adding/removing import on class if needed.
- org.openrewrite.java.cleanup.RemoveSystemOutPrintln: Print statements are often left accidentally after debugging an issue.
- org.openrewrite.java.logging.slf4j.CompleteExceptionLogging: It is a common mistake to call Exception.getMessage() when passing an exception into a log method. Not all exception types have useful messages, and even if the message is useful this omits the stack trace. Including a complete stack trace of the error along with the exception message in the log allows developers to better understand the context of the exception and identify the source of the error more quickly and accurately.
- org.openrewrite.java.migrate.JavaVersion20: Change maven.compiler.source and maven.compiler.target values to 20.
- org.openrewrite.java.migrate.UpgradeToJava20: This recipe will apply changes commonly needed when migrating to Java 20. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 20 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 20.
- org.openrewrite.java.migrate.guava.NoGuavaOptionalFromJavaUtil: Replaces
com.google.common.base.Optional#fromJavaUtil(java.util.Optional)
with argument. - org.openrewrite.java.migrate.guava.NoGuavaOptionalToJavaUtil: Remove calls to
com.google.common.base.Optional#toJavaUtil()
. - org.openrewrite.java.migrate.guava.PreferJavaUtilOptional: Prefer
java.util.Optional
instead of usingcom.google.common.base.Optional
. - org.openrewrite.java.migrate.guava.PreferJavaUtilOptionalOrElseNull: Replaces
com.google.common.base.Optional#orNull()
withjava.util.Optional#orElse(null)
. - org.openrewrite.java.migrate.guava.PreferJavaUtilOptionalOrSupplier: Prefer
java.util.Optional#or(Supplier<T extends java.util.Optional<T>>)
over `com.google.common.base.Optional#or(com.google.common.base.Optional). - org.openrewrite.java.migrate.jakarta.MaybeAddJakartaServletApi: Adds the jakarta.servlet-api dependency, unless the project already uses spring-boot-starter-web, which transitively includes a compatible implementation under a different GAV
- org.openrewrite.java.migrate.lang.UseTextBlocks: Text blocks are easier to read than concatenated strings.
- org.openrewrite.java.recipes.UseJavaParserBuilderInJavaTemplate: Because we can now clone
JavaParser.Builder
, there is no need to fully build the parser inside aSupplier<JavaParser>
. This also makes room forJavaTemplate
to add sharedJavaTypeCache
implementations to parsers used to compile templates. - org.openrewrite.java.search.FindImplementations: Find source files that contain a class declaration implementing a specific interface.
- org.openrewrite.java.spring.boot3.AddRouteTrailingSlash: This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")
would match bothGET /some/greeting
andGET /some/greeting/
, but it doesn't matchGET /some/greeting/
anymore by default and will result in an HTTP 404 error. This recipe is to add declaration of additional route explicitly on the controller handler (like@GetMapping("/some/greeting", "/some/greeting/")
. - org.openrewrite.java.spring.boot3.AddSetUseTrailingSlashMatch: This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")
would match bothGET /some/greeting
andGET /some/greeting/
, but it doesn't matchGET /some/greeting/
anymore by default and will result in an HTTP 404 error. This recipe is change the default with the global Spring MVC or Webflux configuration.