Skip to content

Commit 9f0427d

Browse files
only modify package declaration once
1 parent 6f2bd1b commit 9f0427d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/anthonisen/felix/astParsing/Covariancer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void changeAST(File dir, Set<ClassData> classesToWatch, Map<String, Meth
8080
continue;
8181

8282
CompilationUnit cu = sourceRoot.parse(packageName, file.getName());
83-
changePackageDeclaration(cu);
83+
// changePackageDeclaration(cu);
8484
Set<Pair<String, String>> varsToWatch = new HashSet<>();
8585
cu.accept(new VariableCollector(classesToWatch), varsToWatch);
8686
cu.accept(new TypeEraserVisitor(classesToWatch), null);
@@ -92,6 +92,7 @@ private void changeAST(File dir, Set<ClassData> classesToWatch, Map<String, Meth
9292
}
9393

9494
public void applyChanges() {
95+
this.sourceRoot.getCompilationUnits().forEach(cu -> changePackageDeclaration(cu));
9596
this.sourceRoot.saveAll(
9697
CodeGenerationUtils.mavenModuleRoot(Covariancer.class).resolve(Paths.get(sourceFolder + "/output")));
9798
}

0 commit comments

Comments
 (0)