Skip to content

Commit

Permalink
update due to breaking change in Spoon 11.0.1-beta-17
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Aug 5, 2024
1 parent b8b2e6e commit 9512a41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<dependency>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<version>10.4.1-SNAPSHOT</version>
<version>11.0.1-beta-17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import spoon.reflect.code.CtStatement;
import spoon.reflect.code.CtStatementList;
import spoon.reflect.code.CtTryWithResource;
import spoon.reflect.code.CtResource;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.declaration.CtExecutable;
import spoon.reflect.declaration.CtField;
Expand Down Expand Up @@ -104,7 +105,10 @@ public void visitCtStatementList(CtStatementList e) {

@Override
public void visitCtTryWithResource(CtTryWithResource e) {
variables.addAll(e.getResources());
final List<CtVariable> tmp= new ArrayList<>();
// breakage https://github.com/INRIA/spoon/pull/4371
for (CtResource v: e.getResources()) { if (v instanceof CtVariable) {tmp.add((CtVariable)v);} }
variables.addAll(tmp);
super.visitCtTryWithResource(e);
}

Expand Down

0 comments on commit 9512a41

Please sign in to comment.