Skip to content

Commit 641d66e

Browse files
committed
Updates per rewrite 7.19.0 changes.
1 parent 1dc233d commit 641d66e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/main/java/org/openrewrite/java/migrate/lang/MigrateClassNewInstanceToGetDeclaredConstructorNewInstance.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected NewInstanceToDeclaredConstructorVisitor getVisitor() {
5252
private static class NewInstanceToDeclaredConstructorVisitor extends JavaIsoVisitor<ExecutionContext> {
5353
private final JavaType exType = JavaType.buildType("java.lang.Exception");
5454
private final JavaType thType = JavaType.buildType("java.lang.Throwable");
55-
private static final ChangeMethodName TO_DECLARED_CONS_NEW_INSTANCE = new ChangeMethodName("java.lang.Class newInstance()", "getDeclaredConstructor().newInstance", null);
55+
private static final ChangeMethodName TO_DECLARED_CONS_NEW_INSTANCE = new ChangeMethodName("java.lang.Class newInstance()", "getDeclaredConstructor().newInstance", null, false);
5656

5757
@Override
5858
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext executionContext) {

src/main/java/org/openrewrite/java/migrate/logging/MigrateGetLoggingMXBeanToGetPlatformMXBean.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ protected TreeVisitor<?, ExecutionContext> getVisitor() {
5151
public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {
5252
cu = (J.CompilationUnit) new ChangeType(
5353
"java.util.logging.LoggingMXBean",
54-
"java.lang.management.PlatformLoggingMXBean"
54+
"java.lang.management.PlatformLoggingMXBean",
55+
false
5556
).getVisitor().visitNonNull(cu, ctx);
5657
return super.visitCompilationUnit(cu, ctx);
5758
}

src/test/kotlin/org/openrewrite/java/migrate/JavaxToJakartaTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class JavaxToJakartaTest : JavaRecipeTest {
112112
"public interface I1 {}",
113113
"public interface I2 {}"
114114
),
115-
recipe = recipe.doNext(ChangeType("I1", "I2")),
115+
recipe = recipe.doNext(ChangeType("I1", "I2", false)),
116116
before = """
117117
public class B extends javax.xml.bind.annotation.A implements I1 {}
118118
""",
@@ -170,6 +170,7 @@ class JavaxToJakartaTest : JavaRecipeTest {
170170
"""
171171
)
172172

173+
@Suppress("EmptyTryBlock", "CatchMayIgnoreException")
173174
@Test
174175
fun multiCatch() = assertChanged(
175176
dependsOn = arrayOf(

0 commit comments

Comments
 (0)