[java] MethodNameDeclaration.isPrimitiveReturnType() - check for void
This commit is contained in:
@ -9,6 +9,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPrimitiveType;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTResultType;
|
||||
import net.sourceforge.pmd.lang.symboltable.AbstractNameDeclaration;
|
||||
|
||||
public class MethodNameDeclaration extends AbstractNameDeclaration {
|
||||
@ -33,8 +34,8 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {
|
||||
}
|
||||
|
||||
public boolean isPrimitiveReturnType() {
|
||||
return getMethodNameDeclaratorNode().getParent().getResultType().getChild(0)
|
||||
.getChild(0) instanceof ASTPrimitiveType;
|
||||
ASTResultType resultType = getMethodNameDeclaratorNode().getParent().getResultType();
|
||||
return !resultType.isVoid() && resultType.getChild(0).getChild(0) instanceof ASTPrimitiveType;
|
||||
}
|
||||
|
||||
public ASTMethodDeclarator getMethodNameDeclaratorNode() {
|
||||
|
Reference in New Issue
Block a user