use of com.github.javaparser.utils.ProjectRoot in project checker-framework by typetools.
the class JavaStubifier method process.
/**
* Process each file in the given directory; see class documentation for details.
*
* @param dir directory to process
*/
private static void process(String dir) {
Path root = dirnameToPath(dir);
MinimizerCallback mc = new MinimizerCallback();
CollectionStrategy strategy = new ParserCollectionStrategy();
// Required to include directories that contain a module-info.java, which don't parse by
// default.
strategy.getParserConfiguration().setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_11);
ProjectRoot projectRoot = strategy.collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", mc);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}
use of com.github.javaparser.utils.ProjectRoot in project checker-framework by typetools.
the class RemoveAnnotationsForInference method process.
/**
* Process each file in the given directory; see the {@link RemoveAnnotationsForInference class
* documentation} for details.
*
* @param dir directory to process
*/
private static void process(String dir) {
Path root = JavaStubifier.dirnameToPath(dir);
RemoveAnnotationsCallback rac = new RemoveAnnotationsCallback();
CollectionStrategy strategy = new ParserCollectionStrategy();
// Required to include directories that contain a module-info.java, which don't parse by
// default.
strategy.getParserConfiguration().setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_11);
ProjectRoot projectRoot = strategy.collect(root);
for (SourceRoot sourceRoot : projectRoot.getSourceRoots()) {
try {
sourceRoot.parse("", rac);
} catch (IOException e) {
throw new BugInCF(e);
}
}
}
Aggregations