<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class ArrayType extends Type { public static final ChildPropertyDescriptor COMPONENT_TYPE_PROPERTY = new ChildPropertyDescriptor ( ArrayType . class , "" , Type . class , MANDATORY , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; static { List properyList = new ArrayList ( 2 ) ; createPropertyList ( ArrayType . class , properyList ) ; addProperty ( COMPONENT_TYPE_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private Type componentType = null ; ArrayType ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == COMPONENT_TYPE_PROPERTY ) { if ( get ) { return getComponentType ( ) ; } else { setComponentType ( ( Type ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return ARRAY_TYPE ; } ASTNode clone0 ( AST target ) { ArrayType result = new ArrayType ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setComponentType ( ( Type ) getComponentType ( ) . clone ( target ) ) ; 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 , getComponentType ( ) ) ; } visitor . endVisit ( this ) ; } public Type getComponentType ( ) { if ( this . componentType == null ) { synchronized ( this ) { if ( this . componentType == null ) { preLazyInit ( ) ; this . componentType = new SimpleType ( this . ast ) ; postLazyInit ( this . componentType , COMPONENT_TYPE_PROPERTY ) ; } } } return this . componentType ; } public void setComponentType ( Type componentType ) { if ( componentType == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . componentType ; preReplaceChild ( oldChild , componentType , COMPONENT_TYPE_PROPERTY ) ; this . componentType = componentType ; postReplaceChild ( oldChild , componentType , COMPONENT_TYPE_PROPERTY ) ; } public Type getElementType ( ) { Type t = getComponentType ( ) ; while ( t . isArrayType ( ) ) { t = ( ( ArrayType ) t ) . getComponentType ( ) ; } return t ; } public int getDimensions ( ) { Type t = getComponentType ( ) ; int dimensions = 1 ; while ( t . isArrayType ( ) ) { dimensions ++ ; t = ( ( ArrayType ) t ) . getComponentType ( ) ; } return dimensions ; } int memSize ( ) { return BASE_NODE_SIZE + 1 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . componentType == null ? 0 : getComponentType ( ) . treeSize ( ) ) ; } } </s>