Skip to content

Commit

Permalink
fix some "no AST change" when there are syntax errors (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
andre15silva committed Feb 5, 2024
1 parent eddbc74 commit ff4b53b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/gumtree/spoon/AstComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ protected Factory createFactory() {
* compares two java files
*/
public Diff compare(File f1, File f2) throws Exception {
return this.compare(getCtType(f1), getCtType(f2));
CtType<?> ctType1 = getCtType(f1);
CtType<?> ctType2 = getCtType(f2);
if (ctType1 == null || ctType2 == null) {
return null;
} else {
return compare(ctType1, ctType2);
}
}

/**
Expand Down

0 comments on commit ff4b53b

Please sign in to comment.