<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class ArrayTypeReference extends SingleTypeReference { public int dimensions ; public int originalSourceEnd ; public ArrayTypeReference ( char [ ] source , int dimensions , long pos ) { super ( source , pos ) ; this . originalSourceEnd = this . sourceEnd ; this . dimensions = dimensions ; } public int dimensions ( ) { return this . dimensions ; } public char [ ] [ ] getParameterizedTypeName ( ) { int dim = this . dimensions ; char [ ] dimChars = new char [ dim * 2 ] ; for ( int i = 0 ; i < dim ; i ++ ) { int index = i * 2 ; dimChars [ index ] = '[' ; dimChars [ index + 1 ] = ']' ; } return new char [ ] [ ] { CharOperation . concat ( this . token , dimChars ) } ; } protected TypeBinding getTypeBinding ( Scope scope ) { if ( this . resolvedType != null ) { return this . resolvedType ; } if ( this . dimensions > 255 ) { scope . problemReporter ( ) . tooManyDimensions ( this ) ; } TypeBinding leafComponentType = scope . getType ( this . token ) ; return scope . createArrayType ( leafComponentType , this . dimensions ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { super . printExpression ( indent , output ) ; if ( ( this . bits & IsVarArgs ) != 0 ) { for ( int i = 0 ; i < this . dimensions - 1 ; i ++ ) { output . append ( "[]" ) ; } output . append ( "..." ) ; } else { for ( int i = 0 ; i < this . dimensions ; i ++ ) { output . append ( "[]" ) ; } } return output ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>