<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; 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 . TypeVariableBinding ; public class TypeParameter extends AbstractVariableDeclaration { public TypeVariableBinding binding ; public TypeReference [ ] bounds ; public int getKind ( ) { return TYPE_PARAMETER ; } public void checkBounds ( Scope scope ) { if ( this . type != null ) { this . type . checkBounds ( scope ) ; } if ( this . bounds != null ) { for ( int i = 0 , length = this . bounds . length ; i < length ; i ++ ) { this . bounds [ i ] . checkBounds ( scope ) ; } } } private void internalResolve ( Scope scope , boolean staticContext ) { if ( this . binding != null ) { Binding existingType = scope . parent . getBinding ( this . name , Binding . TYPE , this , false ) ; if ( existingType != null && this . binding != existingType && existingType . isValidBinding ( ) && ( existingType . kind ( ) != Binding . TYPE_PARAMETER || ! staticContext ) ) { scope . problemReporter ( ) . typeHiding ( this , existingType ) ; } } } public void resolve ( BlockScope scope ) { internalResolve ( scope , scope . methodScope ( ) . isStatic ) ; } public void resolve ( ClassScope scope ) { internalResolve ( scope , scope . enclosingSourceType ( ) . isStatic ( ) ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { output . append ( this . name ) ; if ( this . type != null ) { output . append ( " extends " ) ; this . type . print ( 0 , output ) ; } if ( this . bounds != null ) { for ( int i = 0 ; i < this . bounds . length ; i ++ ) { output . append ( " & " ) ; this . bounds [ i ] . print ( 0 , output ) ; } } return output ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . bounds != null ) { int boundsLength = this . bounds . length ; for ( int i = 0 ; i < boundsLength ; i ++ ) { this . bounds [ i ] . traverse ( visitor , scope ) ; } } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . bounds != null ) { int boundsLength = this . bounds . length ; for ( int i = 0 ; i < boundsLength ; i ++ ) { this . bounds [ i ] . traverse ( visitor , scope ) ; } } } visitor . endVisit ( this , scope ) ; } } </s>