public static Type newType(AST ast, VariableDeclaration declaration) { Type type= ASTNodes.getType(declaration); int extraDim= ASTNodes.getExtraDimensions(declaration);  type= (Type) ASTNode.copySubtree(ast, type); for (int i= 0; i < extraDim; i++) { type= ast.newArrayType(type); } return type;
public static Type newType(AST ast, String content) { StringBuffer buffer= new StringBuffer(TYPE_HEADER); buffer.append(content); buffer.append(TYPE_FOOTER); ASTParser p= ASTParser.newParser(ast.apiLevel()); p.setSource(buffer.toString().toCharArray()); CompilationUnit root= (CompilationUnit) p.createAST(null); List list= root.types(); TypeDeclaration typeDecl= (TypeDeclaration) list.get(0); MethodDeclaration methodDecl= typeDecl.getMethods()[0]; ASTNode type= ast.apiLevel() == AST.JLS2 ? methodDecl.getReturnType() : methodDecl.getReturnType2(); ASTNode result= ASTNode.copySubtree(ast, type); result.accept(new PositionClearer()); return (Type)result;
	public static Type newType(AST ast, VariableDeclaration declaration) {		Type type= ASTNodes.getType(declaration);		int extraDim= ASTNodes.getExtraDimensions(declaration);			type= (Type) ASTNode.copySubtree(ast, type);		for (int i= 0; i < extraDim; i++) {			type= ast.newArrayType(type);		}		return type;			}		