}
}
holder.validate();
} catch (Exception ex) {
if (node.getName().getStaticElement() == null) {
ClassDeclaration classNode = node.getAncestor(ClassDeclaration.class);
StringBuilder builder = new StringBuilder();
builder.append("The element for the method ");
builder.append(node.getName());
builder.append(" in ");
builder.append(classNode.getName());
builder.append(" was not set while trying to build the element model.");
AnalysisEngine.getInstance().getLogger().logError(
builder.toString(),
new AnalysisException(builder.toString(), ex));
} else {
String message = "Exception caught in ElementBuilder.visitMethodDeclaration()";
AnalysisEngine.getInstance().getLogger().logError(
message,
new AnalysisException(message, ex));
}
} finally {
if (node.getName().getStaticElement() == null) {
ClassDeclaration classNode = node.getAncestor(ClassDeclaration.class);
StringBuilder builder = new StringBuilder();
builder.append("The element for the method ");
builder.append(node.getName());
builder.append(" in ");
builder.append(classNode.getName());
builder.append(" was not set while trying to resolve types.");
AnalysisEngine.getInstance().getLogger().logError(
builder.toString(),
new AnalysisException(builder.toString()));
}