-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b89
-
generic
-
generic
-
Verified
com.sun.source.util.JavacTask has a method for getting the abstract syntax trees:
public abstract Iterable<? extends CompilationUnitTree> parse()
throws IOException;
Also, there is a method for analyzing which may cause source files to be loaded
from source path:
public abstract void analyze() throws IOException;
Perhaps the method should be modified to return all the trees (including those
loaded from source path):
public abstract Iterable<? extends CompilationUnitTree> analyze()
throws IOException;
If a client of the API tries to collect dependency information, the code could
follow this template:
task.parse();
for (CompilationUnitTree unit : task.analyze()) {
// collect dependency information (using com.sun.source.util.TreeScanner)
}
task.generate();
public abstract Iterable<? extends CompilationUnitTree> parse()
throws IOException;
Also, there is a method for analyzing which may cause source files to be loaded
from source path:
public abstract void analyze() throws IOException;
Perhaps the method should be modified to return all the trees (including those
loaded from source path):
public abstract Iterable<? extends CompilationUnitTree> analyze()
throws IOException;
If a client of the API tries to collect dependency information, the code could
follow this template:
task.parse();
for (CompilationUnitTree unit : task.analyze()) {
// collect dependency information (using com.sun.source.util.TreeScanner)
}
task.generate();