use of net.sourceforge.pmd.lang.java.ast.ASTResultType in project pmd-eclipse-plugin by pmd.
the class ASTUtil method returnType.
public static String returnType(ASTMethodDeclaration node) {
for (int ix = 0; ix < node.jjtGetNumChildren(); ix++) {
Node sn = node.jjtGetChild(ix);
if (sn instanceof ASTResultType) {
ASTResultType resultType = (ASTResultType) sn;
AbstractNode param = resultType.getFirstDescendantOfType(ASTClassOrInterfaceType.class);
if (param == null) {
param = resultType.getFirstDescendantOfType(ASTPrimitiveType.class);
}
if (param == null) {
continue;
}
return param.getImage();
}
}
return null;
}
Aggregations