use of net.sourceforge.pmd.lang.java.ast.ASTArrayDimsAndInits in project pmd by pmd.
the class ClassTypeResolver method visit.
@Override
public Object visit(ASTAllocationExpression node, Object data) {
super.visit(node, data);
final ASTArrayDimsAndInits dims = node.getFirstChildOfType(ASTArrayDimsAndInits.class);
if (dims != null) {
final Class<?> arrayType = ((TypeNode) node.jjtGetChild(0)).getType();
if (arrayType != null) {
node.setType(Array.newInstance(arrayType, (int[]) Array.newInstance(int.class, dims.getArrayDepth())).getClass());
}
} else {
rollupTypeUnary(node);
}
return data;
}
Aggregations