use of boa.types.Issues.IssuesRoot in project compiler by boalang.
the class BoaAstIntrinsics method getissues.
/**
* Given an IssueRepository, return the issues.
*
* @param f the IssueRepository to get issues for
* @return the issues list, or an empty list on any sort of error
*/
@FunctionSpec(name = "getissues", returnType = "IssuesRoot", formalParameters = { "IssueRepository" })
public static IssuesRoot getissues(final IssueRepository f) {
if (issuesMap == null)
openIssuesMap();
try {
final BytesWritable value = new BytesWritable();
if (issuesMap.get(new Text(f.getKey()), value) != null) {
final CodedInputStream _stream = CodedInputStream.newInstance(value.getBytes(), 0, value.getLength());
final IssuesRoot root = IssuesRoot.parseFrom(_stream);
return root;
}
} catch (final InvalidProtocolBufferException e) {
e.printStackTrace();
} catch (final IOException e) {
e.printStackTrace();
} catch (final RuntimeException e) {
e.printStackTrace();
} catch (final Error e) {
e.printStackTrace();
}
System.err.println("error with issues: " + f.getKey());
return emptyIssues;
}
Aggregations