Skip to content

Commit

Permalink
undo unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
henryhchchc committed Dec 21, 2021
1 parent 8ce9952 commit f373be3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public <T, U> void setValue(T element, U value) {
}
}

static class CtTryWithResource_TRY_RESOURCE_RoleHandler extends ListHandler<CtTryWithResource, CtResource<?>> {
static class CtTryWithResource_TRY_RESOURCE_RoleHandler extends ListHandler<CtTryWithResource, CtResource<? extends Object>> {
private CtTryWithResource_TRY_RESOURCE_RoleHandler() {
super(CtRole.TRY_RESOURCE, CtTryWithResource.class, CtResource.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ public void visitCtTryWithResource(CtTryWithResource tryWithResource) {
if (tryWithResource.getResources() != null && !tryWithResource.getResources().isEmpty()) {
elementPrinterHelper.printList(tryWithResource.getResources(),
null, false, "(", false, false, ";", false, false, ")",
r -> scan(r));
r -> scan(r));
}
printer.writeSpace();
scan(tryWithResource.getBody());
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/spoon/support/compiler/jdt/ParentExiter.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import spoon.reflect.code.CtLoop;
import spoon.reflect.code.CtNewArray;
import spoon.reflect.code.CtNewClass;
import spoon.reflect.code.CtResource;
import spoon.reflect.code.CtReturn;
import spoon.reflect.code.CtStatement;
import spoon.reflect.code.CtSuperAccess;
Expand All @@ -72,7 +73,6 @@
import spoon.reflect.code.CtTypeAccess;
import spoon.reflect.code.CtTypePattern;
import spoon.reflect.code.CtUnaryOperator;
import spoon.reflect.code.CtVariableRead;
import spoon.reflect.code.CtWhile;
import spoon.reflect.code.CtYieldStatement;
import spoon.reflect.cu.CompilationUnit;
Expand Down Expand Up @@ -973,10 +973,8 @@ private CtCatch getLastCatcher(CtTry tryBlock) {

@Override
public void visitCtTryWithResource(CtTryWithResource tryWithResource) {
if (child instanceof CtLocalVariable<?>) {
tryWithResource.addResource((CtLocalVariable<?>) child);
} else if (child instanceof CtVariableRead) {
tryWithResource.addResource((CtVariableRead<?>) child);
if (child instanceof CtResource) {
tryWithResource.addResource((CtResource<?>) child);
}
super.visitCtTryWithResource(tryWithResource);
}
Expand Down

0 comments on commit f373be3

Please sign in to comment.