<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class LabeledStatement extends Statement { public static final ChildPropertyDescriptor LABEL_PROPERTY = new ChildPropertyDescriptor ( LabeledStatement . class , "label" , SimpleName . class , MANDATORY , NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( LabeledStatement . class , "body" , Statement . class , MANDATORY , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; static { List propertyList = new ArrayList ( 3 ) ; createPropertyList ( LabeledStatement . class , propertyList ) ; addProperty ( LABEL_PROPERTY , propertyList ) ; addProperty ( BODY_PROPERTY , propertyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( propertyList ) ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private SimpleName labelName = null ; private Statement body = null ; LabeledStatement ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == LABEL_PROPERTY ) { if ( get ) { return getLabel ( ) ; } else { setLabel ( ( SimpleName ) child ) ; return null ; } } if ( property == BODY_PROPERTY ) { if ( get ) { return getBody ( ) ; } else { setBody ( ( Statement ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return LABELED_STATEMENT ; } ASTNode clone0 ( AST target ) { LabeledStatement result = new LabeledStatement ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setLabel ( ( SimpleName ) ASTNode . copySubtree ( target , getLabel ( ) ) ) ; result . setBody ( ( Statement ) ASTNode . copySubtree ( target , getBody ( ) ) ) ; 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 , getLabel ( ) ) ; acceptChild ( visitor , getBody ( ) ) ; } visitor . endVisit ( this ) ; } public SimpleName getLabel ( ) { if ( this . labelName == null ) { synchronized ( this ) { if ( this . labelName == null ) { preLazyInit ( ) ; this . labelName = new SimpleName ( this . ast ) ; postLazyInit ( this . labelName , LABEL_PROPERTY ) ; } } } return this . labelName ; } public void setLabel ( SimpleName label ) { if ( label == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . labelName ; preReplaceChild ( oldChild , label , LABEL_PROPERTY ) ; this . labelName = label ; postReplaceChild ( oldChild , label , LABEL_PROPERTY ) ; } public Statement getBody ( ) { if ( this . body == null ) { synchronized ( this ) { if ( this . body == null ) { preLazyInit ( ) ; this . body = new EmptyStatement ( this . ast ) ; postLazyInit ( this . body , BODY_PROPERTY ) ; } } } return this . body ; } public void setBody ( Statement statement ) { if ( statement == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . body ; preReplaceChild ( oldChild , statement , BODY_PROPERTY ) ; this . body = statement ; postReplaceChild ( oldChild , statement , BODY_PROPERTY ) ; } int memSize ( ) { return super . memSize ( ) + 2 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . labelName == null ? 0 : getLabel ( ) . treeSize ( ) ) + ( this . body == null ? 0 : getBody ( ) . treeSize ( ) ) ; } } </s>