VariableNameDeclaration extends AbstractNameDeclaration implements TypedNameDeclaration { public boolean isArray() { ASTVariableDeclaratorId astVariableDeclaratorId = (ASTVariableDeclaratorId) node; ASTType typeNode = astVariableDeclaratorId.getTypeNode(); if (typeNode != null) { return ((Dimensionable) typeNode.getParent()).isArray(); } else { return false; } } VariableNameDeclaration(ASTVariableDeclaratorId node); @Override Scope getScope(); boolean isArray(); int getArrayDepth(); boolean isVarargs(); boolean isExceptionBlockParameter(); @Deprecated boolean isLambdaTypelessParameter(); boolean isTypeInferred(); boolean isPrimitiveType(); @Override String getTypeImage(); boolean isReferenceType(); AccessNode getAccessNodeParent(); ASTVariableDeclaratorId getDeclaratorId(); @Override TypeNode getTypeNode(); @Override Class<?> getType(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testIsArray() { ASTCompilationUnit acu = parseCode(TEST3); VariableNameDeclaration decl = acu.findDescendantsOfType(ASTVariableDeclaratorId.class).get(0).getScope() .getDeclarations(VariableNameDeclaration.class).keySet().iterator().next(); assertTrue(decl.isArray()); }