<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class IfStatement extends Statement { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( IfStatement . class , "expression" , Expression . class , MANDATORY , CYCLE_RISK ) ; public static final ChildPropertyDescriptor THEN_STATEMENT_PROPERTY = new ChildPropertyDescriptor ( IfStatement . class , "" , Statement . class , MANDATORY , CYCLE_RISK ) ; public static final ChildPropertyDescriptor ELSE_STATEMENT_PROPERTY = new ChildPropertyDescriptor ( IfStatement . class , "" , Statement . class , OPTIONAL , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; static { List properyList = new ArrayList ( 4 ) ; createPropertyList ( IfStatement . class , properyList ) ; addProperty ( EXPRESSION_PROPERTY , properyList ) ; addProperty ( THEN_STATEMENT_PROPERTY , properyList ) ; addProperty ( ELSE_STATEMENT_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private Expression expression = null ; private Statement thenStatement = null ; private Statement optionalElseStatement = null ; IfStatement ( AST ast ) { super ( ast ) ; } 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 == THEN_STATEMENT_PROPERTY ) { if ( get ) { return getThenStatement ( ) ; } else { setThenStatement ( ( Statement ) child ) ; return null ; } } if ( property == ELSE_STATEMENT_PROPERTY ) { if ( get ) { return getElseStatement ( ) ; } else { setElseStatement ( ( Statement ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return IF_STATEMENT ; } ASTNode clone0 ( AST target ) { IfStatement result = new IfStatement ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . copyLeadingComment ( this ) ; result . setExpression ( ( Expression ) getExpression ( ) . clone ( target ) ) ; result . setThenStatement ( ( Statement ) getThenStatement ( ) . clone ( target ) ) ; result . setElseStatement ( ( Statement ) ASTNode . copySubtree ( target , getElseStatement ( ) ) ) ; 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 ( ) ) ; acceptChild ( visitor , getThenStatement ( ) ) ; acceptChild ( visitor , getElseStatement ( ) ) ; } visitor . endVisit ( this ) ; } public Expression getExpression ( ) { if ( this . expression == null ) { synchronized ( this ) { if ( this . expression == null ) { preLazyInit ( ) ; this . expression = new SimpleName ( this . ast ) ; postLazyInit ( this . expression , EXPRESSION_PROPERTY ) ; } } } return this . expression ; } public void setExpression ( Expression expression ) { if ( expression == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . expression ; preReplaceChild ( oldChild , expression , EXPRESSION_PROPERTY ) ; this . expression = expression ; postReplaceChild ( oldChild , expression , EXPRESSION_PROPERTY ) ; } public Statement getThenStatement ( ) { if ( this . thenStatement == null ) { synchronized ( this ) { if ( this . thenStatement == null ) { preLazyInit ( ) ; this . thenStatement = new Block ( this . ast ) ; postLazyInit ( this . thenStatement , THEN_STATEMENT_PROPERTY ) ; } } } return this . thenStatement ; } public void setThenStatement ( Statement statement ) { if ( statement == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . thenStatement ; preReplaceChild ( oldChild , statement , THEN_STATEMENT_PROPERTY ) ; this . thenStatement = statement ; postReplaceChild ( oldChild , statement , THEN_STATEMENT_PROPERTY ) ; } public Statement getElseStatement ( ) { return this . optionalElseStatement ; } public void setElseStatement ( Statement statement ) { ASTNode oldChild = this . optionalElseStatement ; preReplaceChild ( oldChild , statement , ELSE_STATEMENT_PROPERTY ) ; this . optionalElseStatement = statement ; postReplaceChild ( oldChild , statement , ELSE_STATEMENT_PROPERTY ) ; } int memSize ( ) { return super . memSize ( ) + 3 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . expression == null ? 0 : getExpression ( ) . treeSize ( ) ) + ( this . thenStatement == null ? 0 : getThenStatement ( ) . treeSize ( ) ) + ( this . optionalElseStatement == null ? 0 : getElseStatement ( ) . treeSize ( ) ) ; } } </s>