Skip to content

Commit

Permalink
Updates per rewrite 7.19.0 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pway99 committed Feb 25, 2022
1 parent 1dc233d commit 641d66e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected NewInstanceToDeclaredConstructorVisitor getVisitor() {
private static class NewInstanceToDeclaredConstructorVisitor extends JavaIsoVisitor<ExecutionContext> {
private final JavaType exType = JavaType.buildType("java.lang.Exception");
private final JavaType thType = JavaType.buildType("java.lang.Throwable");
private static final ChangeMethodName TO_DECLARED_CONS_NEW_INSTANCE = new ChangeMethodName("java.lang.Class newInstance()", "getDeclaredConstructor().newInstance", null);
private static final ChangeMethodName TO_DECLARED_CONS_NEW_INSTANCE = new ChangeMethodName("java.lang.Class newInstance()", "getDeclaredConstructor().newInstance", null, false);

@Override
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext executionContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ protected TreeVisitor<?, ExecutionContext> getVisitor() {
public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {
cu = (J.CompilationUnit) new ChangeType(
"java.util.logging.LoggingMXBean",
"java.lang.management.PlatformLoggingMXBean"
"java.lang.management.PlatformLoggingMXBean",
false
).getVisitor().visitNonNull(cu, ctx);
return super.visitCompilationUnit(cu, ctx);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class JavaxToJakartaTest : JavaRecipeTest {
"public interface I1 {}",
"public interface I2 {}"
),
recipe = recipe.doNext(ChangeType("I1", "I2")),
recipe = recipe.doNext(ChangeType("I1", "I2", false)),
before = """
public class B extends javax.xml.bind.annotation.A implements I1 {}
""",
Expand Down Expand Up @@ -170,6 +170,7 @@ class JavaxToJakartaTest : JavaRecipeTest {
"""
)

@Suppress("EmptyTryBlock", "CatchMayIgnoreException")
@Test
fun multiCatch() = assertChanged(
dependsOn = arrayOf(
Expand Down

0 comments on commit 641d66e

Please sign in to comment.