Skip to content

Commit

Permalink
Test and preliminary fix for issue with "USE_VAR" cleanup (#1538)
Browse files Browse the repository at this point in the history
* Test that shows issue with "USE_VAR" cleanup

* Fix issue with vanishing import
  • Loading branch information
carstenartur authored Aug 8, 2024
1 parent 627225f commit f1cd1c8
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ public void rewriteAST(final CompilationUnitRewrite cuRewrite, final LinkedPropo

SimpleType replacement= ast.newSimpleType(ast.newSimpleName("var")); //$NON-NLS-1$
ASTNodes.replaceButKeepComment(rewrite, node, replacement, group);
remover.registerRemovedNode(node);
if (classInstanceCreation != null) {
remover.registerRemovedNode(classInstanceCreation);
} else {
remover.registerRemovedNode(node);
}
}
}
}
Loading

0 comments on commit f1cd1c8

Please sign in to comment.