use of com.github.javaparser.ast.StubUnit in project checker-framework by typetools.
the class ToIndexFileConverter method convert.
/**
* Augment given scene with information from stubfile, reading stubs from input stream and
* writing JAIF to output stream.
*
* @param scene the initial scene
* @param in stubfile contents
* @param out JAIF representing augmented scene
* @throws ParseException
* @throws DefException
*/
private static void convert(AScene scene, InputStream in, OutputStream out) throws IOException, DefException, ParseException {
StubUnit iu;
try {
iu = JavaParser.parseStubUnit(in);
} catch (ParseProblemException e) {
iu = null;
ErrorReporter.errorAbort("ToIndexFileConverter: exception from JavaParser.parseStubUnit for InputStream." + System.lineSeparator() + "Problem message with problems encountered: " + e.getMessage());
}
extractScene(iu, scene);
try (Writer w = new BufferedWriter(new OutputStreamWriter(out))) {
IndexFileWriter.write(scene, w);
}
}
Aggregations