<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class ClassInstanceCreation extends Expression { public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( ClassInstanceCreation . class , "" , Type . class , NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( ClassInstanceCreation . class , "expression" , Expression . class , OPTIONAL , CYCLE_RISK ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( ClassInstanceCreation . class , "name" , Name . class , MANDATORY , NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( ClassInstanceCreation . class , "type" , Type . class , MANDATORY , NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor ( ClassInstanceCreation . class , "arguments" , Expression . class , CYCLE_RISK ) ; public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = new ChildPropertyDescriptor ( ClassInstanceCreation . class , "" , AnonymousClassDeclaration . class , OPTIONAL , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; static { List properyList = new ArrayList ( 5 ) ; createPropertyList ( ClassInstanceCreation . class , properyList ) ; addProperty ( EXPRESSION_PROPERTY , properyList ) ; addProperty ( NAME_PROPERTY , properyList ) ; addProperty ( ARGUMENTS_PROPERTY , properyList ) ; addProperty ( ANONYMOUS_CLASS_DECLARATION_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS_2_0 = reapPropertyList ( properyList ) ; properyList = new ArrayList ( 6 ) ; createPropertyList ( ClassInstanceCreation . class , properyList ) ; addProperty ( EXPRESSION_PROPERTY , properyList ) ; addProperty ( TYPE_ARGUMENTS_PROPERTY , properyList ) ; addProperty ( TYPE_PROPERTY , properyList ) ; addProperty ( ARGUMENTS_PROPERTY , properyList ) ; addProperty ( ANONYMOUS_CLASS_DECLARATION_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS_3_0 = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { if ( apiLevel == AST . JLS2_INTERNAL ) { return PROPERTY_DESCRIPTORS_2_0 ; } else { return PROPERTY_DESCRIPTORS_3_0 ; } } private Expression optionalExpression = null ; private ASTNode . NodeList typeArguments = null ; private Name typeName = null ; private Type type = null ; private ASTNode . NodeList arguments = new ASTNode . NodeList ( ARGUMENTS_PROPERTY ) ; private AnonymousClassDeclaration optionalAnonymousClassDeclaration = null ; ClassInstanceCreation ( AST ast ) { super ( ast ) ; if ( ast . apiLevel >= AST . JLS3 ) { this . typeArguments = new ASTNode . NodeList ( TYPE_ARGUMENTS_PROPERTY ) ; } } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == EXPRESSION_PROPERTY ) { if ( get ) { return getExpression ( ) ; } else { setExpression ( ( Expression ) child ) ; return null ; } } if ( property == NAME_PROPERTY ) { if ( get ) { return getName ( ) ; } else { setName ( ( Name ) child ) ; return null ; } } if ( property == TYPE_PROPERTY ) { if ( get ) { return getType ( ) ; } else { setType ( ( Type ) child ) ; return null ; } } if ( property == ANONYMOUS_CLASS_DECLARATION_PROPERTY ) { if ( get ) { return getAnonymousClassDeclaration ( ) ; } else { setAnonymousClassDeclaration ( ( AnonymousClassDeclaration ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { if ( property == ARGUMENTS_PROPERTY ) { return arguments ( ) ; } if ( property == TYPE_ARGUMENTS_PROPERTY ) { return typeArguments ( ) ; } return super . internalGetChildListProperty ( property ) ; } final int getNodeType0 ( ) { return CLASS_INSTANCE_CREATION ; } ASTNode clone0 ( AST target ) { ClassInstanceCreation result = new ClassInstanceCreation ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setExpression ( ( Expression ) ASTNode . copySubtree ( target , getExpression ( ) ) ) ; if ( this . ast . apiLevel == AST . JLS2_INTERNAL ) { result . setName ( ( Name ) getName ( ) . clone ( target ) ) ; } if ( this . ast . apiLevel >= AST . JLS3 ) { result . typeArguments ( ) . addAll ( ASTNode . copySubtrees ( target , typeArguments ( ) ) ) ; result . setType ( ( Type ) getType ( ) . clone ( target ) ) ; } result . arguments ( ) . addAll ( ASTNode . copySubtrees ( target , arguments ( ) ) ) ; result . setAnonymousClassDeclaration ( ( AnonymousClassDeclaration ) ASTNode . copySubtree ( target , getAnonymousClassDeclaration ( ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { return matcher . match ( this , other ) ; } void accept0 ( ASTVisitor visitor ) { boolean visitChildren = visitor . visit ( this ) ; if ( visitChildren ) { acceptChild ( visitor , getExpression ( ) ) ; if ( this . ast . apiLevel == AST . JLS2_INTERNAL ) { acceptChild ( visitor , getName ( ) ) ; } if ( this . ast . apiLevel >= AST . JLS3 ) { acceptChildren ( visitor , this . typeArguments ) ; acceptChild ( visitor , getType ( ) ) ; } acceptChildren ( visitor , this . arguments ) ; acceptChild ( visitor , getAnonymousClassDeclaration ( ) ) ; } visitor . endVisit ( this ) ; } public Expression getExpression ( ) { return this . optionalExpression ; } public void setExpression ( Expression expression ) { ASTNode oldChild = this . optionalExpression ; preReplaceChild ( oldChild , expression , EXPRESSION_PROPERTY ) ; this . optionalExpression = expression ; postReplaceChild ( oldChild , expression , EXPRESSION_PROPERTY ) ; } public List typeArguments ( ) { if ( this . typeArguments == null ) { unsupportedIn2 ( ) ; } return this . typeArguments ; } public Name getName ( ) { return internalGetName ( ) ; } Name internalGetName ( ) { supportedOnlyIn2 ( ) ; if ( this . typeName == null ) { synchronized ( this ) { if ( this . typeName == null ) { preLazyInit ( ) ; this . typeName = new SimpleName ( this . ast ) ; postLazyInit ( this . typeName , NAME_PROPERTY ) ; } } } return this . typeName ; } public void setName ( Name name ) { internalSetName ( name ) ; } void internalSetName ( Name name ) { supportedOnlyIn2 ( ) ; if ( name == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . typeName ; preReplaceChild ( oldChild , name , NAME_PROPERTY ) ; this . typeName = name ; postReplaceChild ( oldChild , name , NAME_PROPERTY ) ; } public Type getType ( ) { unsupportedIn2 ( ) ; if ( this . type == null ) { synchronized ( this ) { if ( this . type == null ) { preLazyInit ( ) ; this . type = new SimpleType ( this . ast ) ; postLazyInit ( this . type , TYPE_PROPERTY ) ; } } } return this . type ; } public void setType ( Type type ) { unsupportedIn2 ( ) ; if ( type == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . type ; preReplaceChild ( oldChild , type , TYPE_PROPERTY ) ; this . type = type ; postReplaceChild ( oldChild , type , TYPE_PROPERTY ) ; } public List arguments ( ) { return this . arguments ; } public AnonymousClassDeclaration getAnonymousClassDeclaration ( ) { return this . optionalAnonymousClassDeclaration ; } public void setAnonymousClassDeclaration ( AnonymousClassDeclaration decl ) { ASTNode oldChild = this . optionalAnonymousClassDeclaration ; preReplaceChild ( oldChild , decl , ANONYMOUS_CLASS_DECLARATION_PROPERTY ) ; this . optionalAnonymousClassDeclaration = decl ; postReplaceChild ( oldChild , decl , ANONYMOUS_CLASS_DECLARATION_PROPERTY ) ; } public IMethodBinding resolveConstructorBinding ( ) { return this . ast . getBindingResolver ( ) . resolveConstructor ( this ) ; } public boolean isResolvedTypeInferredFromExpectedType ( ) { return this . ast . getBindingResolver ( ) . isResolvedTypeInferredFromExpectedType ( this ) ; } int memSize ( ) { return BASE_NODE_SIZE + 6 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . typeName == null ? 0 : getName ( ) . treeSize ( ) ) + ( this . type == null ? 0 : getType ( ) . treeSize ( ) ) + ( this . optionalExpression == null ? 0 : getExpression ( ) . treeSize ( ) ) + ( this . typeArguments == null ? 0 : this . typeArguments . listSize ( ) ) + ( this . arguments == null ? 0 : this . arguments . listSize ( ) ) + ( this . optionalAnonymousClassDeclaration == null ? 0 : getAnonymousClassDeclaration ( ) . treeSize ( ) ) ; } } </s>