Skip to content

Commit

Permalink
Merge branch 'main' into add-commons-lang-2-3
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Oct 14, 2024
2 parents ad2aa5b + 233d6f1 commit cd9146e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
});
if (hasRepoAnnotation && TypeUtils.isAssignableTo(INTERFACE_REPOSITORY, c.getType())) {
maybeRemoveImport(ANNOTATION_REPOSITORY);
return (J.ClassDeclaration) new RemoveAnnotationVisitor(new AnnotationMatcher("@" + ANNOTATION_REPOSITORY)).visit(c, ctx, getCursor());
return (J.ClassDeclaration) new RemoveAnnotationVisitor(new AnnotationMatcher("@" + ANNOTATION_REPOSITORY))
.visit(c, ctx, getCursor().getParentOrThrow());
}
}
return c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ct
maybeAddImport("org.springframework.web.bind.annotation." + resolvedRequestMappingAnnotationClassName);
a = (J.Annotation) new ChangeType("org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation." + resolvedRequestMappingAnnotationClassName, false)
.getVisitor().visit(a, ctx, getCursor());
.getVisitor().visit(a, ctx, getCursor().getParentOrThrow());

// if there is only one remaining argument now, and it is "path" or "value", then we can drop the key name
if (a != null && a.getArguments() != null && a.getArguments().size() == 1) {
Expand Down

0 comments on commit cd9146e

Please sign in to comment.