ASTFormalParameter extends AbstractJavaAccessTypeNode implements Dimensionable, CanSuppressWarnings { public boolean isVarargs() { return isVarargs; } @InternalApi @Deprecated  ASTFormalParameter(int id); @InternalApi @Deprecated  ASTFormalParameter(JavaParser p, int id); @InternalApi @Deprecated void setVarargs(); boolean isVarargs(); boolean isExplicitReceiverParameter(); boolean isTypeInferred(); @Override Object jjtAccept(JavaParserVisitor visitor, Object data); ASTVariableDeclaratorId getVariableDeclaratorId(); @Override boolean hasSuppressWarningsAnnotationFor(Rule rule); @Override @Deprecated boolean isArray(); @Override @Deprecated int getArrayDepth(); ASTType getTypeNode(); @Override Class<?> getType(); @Override JavaTypeDefinition getTypeDefinition(); @InternalApi @Deprecated @Override void setTypeDefinition(JavaTypeDefinition type); @InternalApi @Deprecated @Override void setType(Class<?> type);  }
@Test public void testVarargs() { int nrOfVarArgs = 0; int nrOfNoVarArgs = 0; List<ASTFormalParameter> ops = java.getNodes(ASTFormalParameter.class, TEST1, "1.5"); for (ASTFormalParameter b : ops) { ASTVariableDeclaratorId variableDeclId = b.getFirstDescendantOfType(ASTVariableDeclaratorId.class); if (!"x".equals(variableDeclId.getImage())) { assertTrue(b.isVarargs()); nrOfVarArgs++; } else { assertFalse(b.isVarargs()); nrOfNoVarArgs++; } } assertEquals(1, nrOfVarArgs); assertEquals(1, nrOfNoVarArgs); }