Skip to content

Commit

Permalink
Reduce failures through getParentTreeCursor()
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Oct 14, 2024
1 parent e009626 commit d284269
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations m
// Update existing @Column annotation
J.VariableDeclarations updatedVariable = (J.VariableDeclarations) new AddOrUpdateAnnotationAttribute(
"javax.persistence.Column", "name", "element", true)
.getVisitor().visit(multiVariable, ctx, getCursor());
.getVisitor().visit(multiVariable, ctx, getCursor().getParentTreeCursor());
return super.visitVariableDeclarations(updatedVariable, ctx);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit compilationUnit,
for (J.ClassDeclaration aClass : cu.getClasses()) {
if (aClass.getType() != null && injectedTypes.contains(aClass.getType().getFullyQualifiedName())) {
return (J.CompilationUnit) new AnnotateTypesVisitor(JAVAX_ENTERPRISE_CONTEXT_DEPENDENT)
.visit(cu, injectedTypes, getCursor().getParent());
.visit(cu, injectedTypes, getCursor().getParentTreeCursor());
}
}
return cu;
Expand Down

0 comments on commit d284269

Please sign in to comment.