VariableNameDeclaration extends AbstractNameDeclaration implements TypedNameDeclaration { @Override public Scope getScope() { return node.getScope().getEnclosingScope(ClassScope.class); } 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 testConstructor() { ASTCompilationUnit acu = parseCode(TEST1); List<ASTVariableDeclaratorId> nodes = acu.findDescendantsOfType(ASTVariableDeclaratorId.class); Scope s = nodes.get(0).getScope(); NameDeclaration decl = s.getDeclarations().keySet().iterator().next(); assertEquals("bar", decl.getImage()); assertEquals(3, decl.getNode().getBeginLine()); }