use of org.checkerframework.javacutil.UserError in project checker-framework by typetools.
the class WholeProgramInferenceScenesStorage method getScene.
/**
* Reads a Scene from the given .jaif file, or returns an empty Scene if the file does not exist.
*
* @param jaifPath the .jaif file
* @return the Scene read from the file, or an empty Scene if the file does not exist
*/
private ASceneWrapper getScene(String jaifPath) {
AScene scene;
if (!scenes.containsKey(jaifPath)) {
File jaifFile = new File(jaifPath);
scene = new AScene();
if (jaifFile.exists()) {
try {
IndexFileParser.parseFile(jaifPath, scene);
} catch (IOException e) {
throw new UserError("Problem while reading %s: %s", jaifPath, e.getMessage());
}
}
ASceneWrapper wrapper = new ASceneWrapper(scene);
scenes.put(jaifPath, wrapper);
return wrapper;
} else {
return scenes.get(jaifPath);
}
}
Aggregations