<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { super ( type , null , enclosingType , environment ) ; this . tagBits &= ~ TagBits . HasMissingType ; if ( ( type . tagBits & TagBits . HasMissingType ) != 0 ) { if ( type instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } else if ( type instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) type ; if ( parameterizedTypeBinding . genericType ( ) instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } } } if ( enclosingType != null && ( enclosingType . tagBits & TagBits . HasMissingType ) != 0 ) { if ( enclosingType instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } else if ( enclosingType instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedTypeBinding = ( ParameterizedTypeBinding ) enclosingType ; if ( parameterizedTypeBinding . genericType ( ) instanceof MissingTypeBinding ) { this . tagBits |= TagBits . HasMissingType ; } } } if ( enclosingType == null || ( enclosingType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == 0 ) { this . modifiers &= ~ ExtraCompilerModifiers . AccGenericSignature ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer sig = new StringBuffer ( 10 ) ; if ( isMemberType ( ) && enclosingType ( ) . isParameterizedType ( ) ) { char [ ] typeSig = enclosingType ( ) . computeUniqueKey ( false ) ; sig . append ( typeSig , 0 , typeSig . length - 1 ) ; sig . append ( '.' ) . append ( sourceName ( ) ) . append ( '<' ) . append ( '>' ) . append ( ';' ) ; } else { sig . append ( genericType ( ) . computeUniqueKey ( false ) ) ; sig . insert ( sig . length ( ) - 1 , "<>" ) ; } int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( 0 , sigLength , uniqueKey , 0 ) ; return uniqueKey ; } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { if ( originalMethod . typeVariables == Binding . NO_TYPE_VARIABLES || originalMethod . isStatic ( ) ) { return super . createParameterizedMethod ( originalMethod ) ; } return this . environment . createParameterizedGenericMethod ( originalMethod , this ) ; } public int kind ( ) { return RAW_TYPE ; } public String debugName ( ) { StringBuffer nameBuffer = new StringBuffer ( 10 ) ; nameBuffer . append ( actualType ( ) . sourceName ( ) ) . append ( "#RAW" ) ; return nameBuffer . toString ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == 0 ) { this . genericTypeSignature = genericType ( ) . signature ( ) ; } else { StringBuffer sig = new StringBuffer ( 10 ) ; if ( isMemberType ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; char [ ] typeSig = enclosing . genericTypeSignature ( ) ; sig . append ( typeSig , 0 , typeSig . length - 1 ) ; if ( ( enclosing . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != 0 ) { sig . append ( '.' ) ; } else { sig . append ( '$' ) ; } sig . append ( sourceName ( ) ) ; } else { char [ ] typeSig = genericType ( ) . signature ( ) ; sig . append ( typeSig , 0 , typeSig . length - 1 ) ; } sig . append ( ';' ) ; int sigLength = sig . length ( ) ; this . genericTypeSignature = new char [ sigLength ] ; sig . getChars ( 0 , sigLength , this . genericTypeSignature , 0 ) ; } } return this . genericTypeSignature ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType || erasure ( ) == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) == otherType . erasure ( ) ; } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { if ( this == otherType || erasure ( ) == otherType ) return false ; if ( otherType == null ) return true ; switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; } protected void initializeArguments ( ) { TypeVariableBinding [ ] typeVariables = genericType ( ) . typeVariables ( ) ; int length = typeVariables . length ; TypeBinding [ ] typeArguments = new TypeBinding [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { typeArguments [ i ] = this . environment . convertToRawType ( typeVariables [ i ] . erasure ( ) , false ) ; } this . arguments = typeArguments ; } public char [ ] readableName ( ) { char [ ] readableName ; if ( isMemberType ( ) ) { readableName = CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '.' ) ; } else { readableName = CharOperation . concatWith ( actualType ( ) . compoundName , '.' ) ; } return readableName ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '.' ) ; } else { shortReadableName = actualType ( ) . sourceName ; } return shortReadableName ; } } </s>