From 217cf89f428f4c88a8e917483b440a4bbe773b97 Mon Sep 17 00:00:00 2001 From: Anu Ramamoorthy <93149514+ranuradh@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:19:11 -0400 Subject: [PATCH] Add Recipe RemovedRuntimeTraceMethods Java 17 (#530) * add RemovedRuntimeTraceMethods java 17 * removed duplicate enteries for removeTraceMethods and kept the named Recipe * End java-version-17.yml with a new line --------- Co-authored-by: anuram Co-authored-by: Tim te Beek --- .../META-INF/rewrite/java-version-17.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/resources/META-INF/rewrite/java-version-17.yml b/src/main/resources/META-INF/rewrite/java-version-17.yml index fc2cececb4..2cb31619f8 100644 --- a/src/main/resources/META-INF/rewrite/java-version-17.yml +++ b/src/main/resources/META-INF/rewrite/java-version-17.yml @@ -30,10 +30,7 @@ recipeList: - org.openrewrite.java.migrate.UpgradeBuildToJava17 - org.openrewrite.java.migrate.lang.StringFormatted - org.openrewrite.staticanalysis.InstanceOfPatternMatch - - org.openrewrite.java.migrate.RemoveMethodInvocation: - methodPattern: java.lang.Runtime traceInstructions(boolean) - - org.openrewrite.java.migrate.RemoveMethodInvocation: - methodPattern: java.lang.System traceMethodCalls(boolean) + - org.openrewrite.java.migrate.RemovedRuntimeTraceMethods - org.openrewrite.java.migrate.RemovedToolProviderConstructor - org.openrewrite.java.migrate.RemovedModifierAndConstantBootstrapsConstructors - org.openrewrite.java.migrate.lang.UseTextBlocks @@ -260,3 +257,17 @@ recipeList: - org.openrewrite.java.ChangeMethodTargetToStatic: methodPattern: java.lang.invoke.ConstantBootstraps *(..) fullyQualifiedTargetTypeName: java.lang.invoke.ConstantBootstraps +--- +type: specs.openrewrite.org/v1beta/recipe +name: org.openrewrite.java.migrate.RemovedRuntimeTraceMethods +displayName: Remove `Runtime.traceInstructions(boolean)` and `Runtime.traceMethodCalls` methods +description: >- + The `traceInstructions` and `traceMethodCalls` methods in `java.lang.Runtime` were deprecated in Java SE 9 and are no longer available in Java SE 13 and later. + The recipe removes the invocations of these methods since the method invocations do nothing functionally. +tags: + - java17 +recipeList: + - org.openrewrite.java.migrate.RemoveMethodInvocation: + methodPattern: 'java.lang.Runtime traceInstructions(boolean)' + - org.openrewrite.java.migrate.RemoveMethodInvocation: + methodPattern: 'java.lang.Runtime traceMethodCalls(boolean)'