Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon

@SuppressWarnings("ConstantConditions")
@Override
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
J.MethodInvocation mi = super.visitMethodInvocation(method, ctx);
if ((mi.getSelect() != null && TypeUtils.isOfClassType(mi.getSelect().getType(), "junit.framework.TestCase")) ||
(mi.getMethodType() != null && TypeUtils.isOfClassType(mi.getMethodType().getDeclaringType(), "junit.framework.TestCase"))) {
Expand Down Expand Up @@ -136,7 +136,7 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex
}

@Override
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
// If the class no longer extends TestCase there should no longer be calls to TestCase.super()
// Plenty of edge cases around classes which extend classes which extend TestCase this doesn't account for
if (TEST_CASE_SUPER_MATCHER.matches(method)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void tearDown() {
}

@Test
void testCaseWithConstructorCallingSuperTestName() {
void caseWithConstructorCallingSuperTestName() {
//language=java
rewriteRun(
java(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ void shouldMigrateMavenDependency() {
);
}
}