<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class ArrayCreation extends Expression { public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( ArrayCreation . class , "type" , ArrayType . class , MANDATORY , NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor DIMENSIONS_PROPERTY = new ChildListPropertyDescriptor ( ArrayCreation . class , "dimensions" , Expression . class , CYCLE_RISK ) ; public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = new ChildPropertyDescriptor ( ArrayCreation . class , "initializer" , ArrayInitializer . class , OPTIONAL , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; static { List properyList = new ArrayList ( 4 ) ; createPropertyList ( ArrayCreation . class , properyList ) ; addProperty ( TYPE_PROPERTY , properyList ) ; addProperty ( DIMENSIONS_PROPERTY , properyList ) ; addProperty ( INITIALIZER_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private ArrayType arrayType = null ; private ASTNode . NodeList dimensions = new ASTNode . NodeList ( DIMENSIONS_PROPERTY ) ; private ArrayInitializer optionalInitializer = null ; ArrayCreation ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == INITIALIZER_PROPERTY ) { if ( get ) { return getInitializer ( ) ; } else { setInitializer ( ( ArrayInitializer ) child ) ; return null ; } } if ( property == TYPE_PROPERTY ) { if ( get ) { return getType ( ) ; } else { setType ( ( ArrayType ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { if ( property == DIMENSIONS_PROPERTY ) { return dimensions ( ) ; } return super . internalGetChildListProperty ( property ) ; } final int getNodeType0 ( ) { return ARRAY_CREATION ; } ASTNode clone0 ( AST target ) { ArrayCreation result = new ArrayCreation ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setType ( ( ArrayType ) getType ( ) . clone ( target ) ) ; result . dimensions ( ) . addAll ( ASTNode . copySubtrees ( target , dimensions ( ) ) ) ; result . setInitializer ( ( ArrayInitializer ) ASTNode . copySubtree ( target , getInitializer ( ) ) ) ; 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 , getType ( ) ) ; acceptChildren ( visitor , this . dimensions ) ; acceptChild ( visitor , getInitializer ( ) ) ; } visitor . endVisit ( this ) ; } public ArrayType getType ( ) { if ( this . arrayType == null ) { synchronized ( this ) { if ( this . arrayType == null ) { preLazyInit ( ) ; this . arrayType = this . ast . newArrayType ( this . ast . newPrimitiveType ( PrimitiveType . INT ) ) ; postLazyInit ( this . arrayType , TYPE_PROPERTY ) ; } } } return this . arrayType ; } public void setType ( ArrayType type ) { if ( type == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . arrayType ; preReplaceChild ( oldChild , type , TYPE_PROPERTY ) ; this . arrayType = type ; postReplaceChild ( oldChild , type , TYPE_PROPERTY ) ; } public List dimensions ( ) { return this . dimensions ; } public ArrayInitializer getInitializer ( ) { return this . optionalInitializer ; } public void setInitializer ( ArrayInitializer initializer ) { ASTNode oldChild = this . optionalInitializer ; preReplaceChild ( oldChild , initializer , INITIALIZER_PROPERTY ) ; this . optionalInitializer = initializer ; postReplaceChild ( oldChild , initializer , INITIALIZER_PROPERTY ) ; } int memSize ( ) { return BASE_NODE_SIZE + 3 * 4 ; } int treeSize ( ) { int size = memSize ( ) + ( this . arrayType == null ? 0 : getType ( ) . treeSize ( ) ) + ( this . optionalInitializer == null ? 0 : getInitializer ( ) . treeSize ( ) ) + this . dimensions . listSize ( ) ; return size ; } } </s>