text
stringlengths
30
1.67M
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . io . File ; import java . io . IOException ; import java . io . InputStream ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClassFileReader extends ClassFileStruct implements IBinaryType { private int accessFlags ; private char [ ] classFileName ; private char [ ] className ; private int classNameIndex ; private int constantPoolCount ; private AnnotationInfo [ ] annotations ; private FieldInfo [ ] fields ; private int fieldsCount ; private InnerClassInfo innerInfo ; private int innerInfoIndex ; private InnerClassInfo [ ] innerInfos ; private char [ ] [ ] interfaceNames ; private int interfacesCount ; private MethodInfo [ ] methods ; private int methodsCount ; private char [ ] signature ; private char [ ] sourceName ; private char [ ] sourceFileName ; private char [ ] superclassName ; private long tagBits ; private long version ; private char [ ] enclosingTypeName ; private char [ ] [ ] [ ] missingTypeNames ; private int enclosingNameAndTypeIndex ; private char [ ] enclosingMethod ; private static String printTypeModifiers ( int modifiers ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter print = new java . io . PrintWriter ( out ) ; if ( ( modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccSuper ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccInterface ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; print . flush ( ) ; return out . toString ( ) ; } public static ClassFileReader read ( File file ) throws ClassFormatException , IOException { return read ( file , false ) ; } public static ClassFileReader read ( File file , boolean fullyInitialize ) throws ClassFormatException , IOException { byte classFileBytes [ ] = Util . getFileByteContent ( file ) ; ClassFileReader classFileReader = new ClassFileReader ( classFileBytes , file . getAbsolutePath ( ) . toCharArray ( ) ) ; if ( fullyInitialize ) { classFileReader . initialize ( ) ; } return classFileReader ; } public static ClassFileReader read ( InputStream stream , String fileName ) throws ClassFormatException , IOException { return read ( stream , fileName , false ) ; } public static ClassFileReader read ( InputStream stream , String fileName , boolean fullyInitialize ) throws ClassFormatException , IOException { byte classFileBytes [ ] = Util . getInputStreamAsByteArray ( stream , - <NUM_LIT:1> ) ; ClassFileReader classFileReader = new ClassFileReader ( classFileBytes , fileName . toCharArray ( ) ) ; if ( fullyInitialize ) { classFileReader . initialize ( ) ; } return classFileReader ; } public static ClassFileReader read ( java . util . zip . ZipFile zip , String filename ) throws ClassFormatException , java . io . IOException { return read ( zip , filename , false ) ; } public static ClassFileReader read ( java . util . zip . ZipFile zip , String filename , boolean fullyInitialize ) throws ClassFormatException , java . io . IOException { java . util . zip . ZipEntry ze = zip . getEntry ( filename ) ; if ( ze == null ) return null ; byte classFileBytes [ ] = Util . getZipEntryByteContent ( ze , zip ) ; ClassFileReader classFileReader = new ClassFileReader ( classFileBytes , filename . toCharArray ( ) ) ; if ( fullyInitialize ) { classFileReader . initialize ( ) ; } return classFileReader ; } public static ClassFileReader read ( String fileName ) throws ClassFormatException , java . io . IOException { return read ( fileName , false ) ; } public static ClassFileReader read ( String fileName , boolean fullyInitialize ) throws ClassFormatException , java . io . IOException { return read ( new File ( fileName ) , fullyInitialize ) ; } public ClassFileReader ( byte classFileBytes [ ] , char [ ] fileName ) throws ClassFormatException { this ( classFileBytes , fileName , false ) ; } public ClassFileReader ( byte [ ] classFileBytes , char [ ] fileName , boolean fullyInitialize ) throws ClassFormatException { super ( classFileBytes , null , <NUM_LIT:0> ) ; this . classFileName = fileName ; int readOffset = <NUM_LIT:10> ; try { this . version = ( ( long ) u2At ( <NUM_LIT:6> ) << <NUM_LIT:16> ) + u2At ( <NUM_LIT:4> ) ; this . constantPoolCount = u2At ( <NUM_LIT:8> ) ; this . constantPoolOffsets = new int [ this . constantPoolCount ] ; for ( int i = <NUM_LIT:1> ; i < this . constantPoolCount ; i ++ ) { int tag = u1At ( readOffset ) ; switch ( tag ) { case ClassFileConstants . Utf8Tag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += u2At ( readOffset + <NUM_LIT:1> ) ; readOffset += ClassFileConstants . ConstantUtf8FixedSize ; break ; case ClassFileConstants . IntegerTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantIntegerFixedSize ; break ; case ClassFileConstants . FloatTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantFloatFixedSize ; break ; case ClassFileConstants . LongTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantLongFixedSize ; i ++ ; break ; case ClassFileConstants . DoubleTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantDoubleFixedSize ; i ++ ; break ; case ClassFileConstants . ClassTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantClassFixedSize ; break ; case ClassFileConstants . StringTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantStringFixedSize ; break ; case ClassFileConstants . FieldRefTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantFieldRefFixedSize ; break ; case ClassFileConstants . MethodRefTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantMethodRefFixedSize ; break ; case ClassFileConstants . InterfaceMethodRefTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantInterfaceMethodRefFixedSize ; break ; case ClassFileConstants . NameAndTypeTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantNameAndTypeFixedSize ; break ; case ClassFileConstants . MethodHandleTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantMethodHandleFixedSize ; break ; case ClassFileConstants . MethodTypeTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantMethodTypeFixedSize ; break ; case ClassFileConstants . InvokeDynamicTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantInvokeDynamicFixedSize ; break ; } } this . accessFlags = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; this . classNameIndex = u2At ( readOffset ) ; this . className = getConstantClassNameAt ( this . classNameIndex ) ; readOffset += <NUM_LIT:2> ; int superclassNameIndex = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( superclassNameIndex != <NUM_LIT:0> ) { this . superclassName = getConstantClassNameAt ( superclassNameIndex ) ; } this . interfacesCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( this . interfacesCount != <NUM_LIT:0> ) { this . interfaceNames = new char [ this . interfacesCount ] [ ] ; for ( int i = <NUM_LIT:0> ; i < this . interfacesCount ; i ++ ) { this . interfaceNames [ i ] = getConstantClassNameAt ( u2At ( readOffset ) ) ; readOffset += <NUM_LIT:2> ; } } this . fieldsCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( this . fieldsCount != <NUM_LIT:0> ) { FieldInfo field ; this . fields = new FieldInfo [ this . fieldsCount ] ; for ( int i = <NUM_LIT:0> ; i < this . fieldsCount ; i ++ ) { field = FieldInfo . createField ( this . reference , this . constantPoolOffsets , readOffset ) ; this . fields [ i ] = field ; readOffset += field . sizeInBytes ( ) ; } } this . methodsCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( this . methodsCount != <NUM_LIT:0> ) { this . methods = new MethodInfo [ this . methodsCount ] ; boolean isAnnotationType = ( this . accessFlags & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . methodsCount ; i ++ ) { this . methods [ i ] = isAnnotationType ? AnnotationMethodInfo . createAnnotationMethod ( this . reference , this . constantPoolOffsets , readOffset ) : MethodInfo . createMethod ( this . reference , this . constantPoolOffsets , readOffset ) ; readOffset += this . methods [ i ] . sizeInBytes ( ) ; } } int attributesCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length == <NUM_LIT:0> ) { readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; continue ; } switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . EnclosingMethodName ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] + <NUM_LIT:1> ) ] ; this . enclosingTypeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . enclosingNameAndTypeIndex = u2At ( readOffset + <NUM_LIT:8> ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . DeprecatedName ) ) { this . accessFlags |= ClassFileConstants . AccDeprecated ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . InnerClassName ) ) { int innerOffset = readOffset + <NUM_LIT:6> ; int number_of_classes = u2At ( innerOffset ) ; if ( number_of_classes != <NUM_LIT:0> ) { innerOffset += <NUM_LIT:2> ; this . innerInfos = new InnerClassInfo [ number_of_classes ] ; for ( int j = <NUM_LIT:0> ; j < number_of_classes ; j ++ ) { this . innerInfos [ j ] = new InnerClassInfo ( this . reference , this . constantPoolOffsets , innerOffset ) ; if ( this . classNameIndex == this . innerInfos [ j ] . innerClassNameIndex ) { this . innerInfo = this . innerInfos [ j ] ; this . innerInfoIndex = j ; } innerOffset += <NUM_LIT:8> ; } if ( this . innerInfo != null ) { char [ ] enclosingType = this . innerInfo . getEnclosingTypeName ( ) ; if ( enclosingType != null ) { this . enclosingTypeName = enclosingType ; } } } } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . InconsistentHierarchy ) ) { this . tagBits |= TagBits . HierarchyHasProblems ; } break ; case '<CHAR_LIT>' : if ( attributeName . length > <NUM_LIT:2> ) { switch ( attributeName [ <NUM_LIT:1> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SourceName ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] ; this . sourceFileName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SyntheticName ) ) { this . accessFlags |= ClassFileConstants . AccSynthetic ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SignatureName ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] ; this . signature = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } } } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { decodeAnnotations ( readOffset , true ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { decodeAnnotations ( readOffset , false ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . MissingTypesName ) ) { int missingTypeOffset = readOffset + <NUM_LIT:6> ; int numberOfMissingTypes = u2At ( missingTypeOffset ) ; if ( numberOfMissingTypes != <NUM_LIT:0> ) { this . missingTypeNames = new char [ numberOfMissingTypes ] [ ] [ ] ; missingTypeOffset += <NUM_LIT:2> ; for ( int j = <NUM_LIT:0> ; j < numberOfMissingTypes ; j ++ ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ u2At ( missingTypeOffset ) ] + <NUM_LIT:1> ) ] ; char [ ] missingTypeConstantPoolName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . missingTypeNames [ j ] = CharOperation . splitOn ( '<CHAR_LIT:/>' , missingTypeConstantPoolName ) ; missingTypeOffset += <NUM_LIT:2> ; } } } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } if ( fullyInitialize ) { initialize ( ) ; } } catch ( ClassFormatException e ) { throw e ; } catch ( Exception e ) { throw new ClassFormatException ( ClassFormatException . ErrTruncatedInput , readOffset ) ; } } public int accessFlags ( ) { return this . accessFlags ; } private void decodeAnnotations ( int offset , boolean runtimeVisible ) { int numberOfAnnotations = u2At ( offset + <NUM_LIT:6> ) ; if ( numberOfAnnotations > <NUM_LIT:0> ) { int readOffset = offset + <NUM_LIT:8> ; AnnotationInfo [ ] newInfos = null ; int newInfoCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) { AnnotationInfo newInfo = new AnnotationInfo ( this . reference , this . constantPoolOffsets , readOffset , runtimeVisible , false ) ; readOffset += newInfo . readOffset ; long standardTagBits = newInfo . standardAnnotationTagBits ; if ( standardTagBits != <NUM_LIT:0> ) { this . tagBits |= standardTagBits ; } else { if ( newInfos == null ) newInfos = new AnnotationInfo [ numberOfAnnotations - i ] ; newInfos [ newInfoCount ++ ] = newInfo ; } } if ( newInfos == null ) return ; if ( this . annotations == null ) { if ( newInfoCount != newInfos . length ) System . arraycopy ( newInfos , <NUM_LIT:0> , newInfos = new AnnotationInfo [ newInfoCount ] , <NUM_LIT:0> , newInfoCount ) ; this . annotations = newInfos ; } else { int length = this . annotations . length ; AnnotationInfo [ ] temp = new AnnotationInfo [ length + newInfoCount ] ; System . arraycopy ( this . annotations , <NUM_LIT:0> , temp , <NUM_LIT:0> , length ) ; System . arraycopy ( newInfos , <NUM_LIT:0> , temp , length , newInfoCount ) ; this . annotations = temp ; } } } public IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } private char [ ] getConstantClassNameAt ( int constantPoolIndex ) { int utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ constantPoolIndex ] + <NUM_LIT:1> ) ] ; return utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } public int [ ] getConstantPoolOffsets ( ) { return this . constantPoolOffsets ; } public char [ ] getEnclosingMethod ( ) { if ( this . enclosingNameAndTypeIndex <= <NUM_LIT:0> ) { return null ; } if ( this . enclosingMethod == null ) { StringBuffer buffer = new StringBuffer ( ) ; int nameAndTypeOffset = this . constantPoolOffsets [ this . enclosingNameAndTypeIndex ] ; int utf8Offset = this . constantPoolOffsets [ u2At ( nameAndTypeOffset + <NUM_LIT:1> ) ] ; buffer . append ( utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ) ; utf8Offset = this . constantPoolOffsets [ u2At ( nameAndTypeOffset + <NUM_LIT:3> ) ] ; buffer . append ( utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ) ; this . enclosingMethod = String . valueOf ( buffer ) . toCharArray ( ) ; } return this . enclosingMethod ; } public char [ ] getEnclosingTypeName ( ) { return this . enclosingTypeName ; } public IBinaryField [ ] getFields ( ) { return this . fields ; } public char [ ] getFileName ( ) { return this . classFileName ; } public char [ ] getGenericSignature ( ) { return this . signature ; } public char [ ] getInnerSourceName ( ) { if ( this . innerInfo != null ) return this . innerInfo . getSourceName ( ) ; return null ; } public char [ ] [ ] getInterfaceNames ( ) { return this . interfaceNames ; } public IBinaryNestedType [ ] getMemberTypes ( ) { if ( this . innerInfos == null ) return null ; int length = this . innerInfos . length ; int startingIndex = this . innerInfo != null ? this . innerInfoIndex + <NUM_LIT:1> : <NUM_LIT:0> ; if ( length != startingIndex ) { IBinaryNestedType [ ] memberTypes = new IBinaryNestedType [ length - this . innerInfoIndex ] ; int memberTypeIndex = <NUM_LIT:0> ; for ( int i = startingIndex ; i < length ; i ++ ) { InnerClassInfo currentInnerInfo = this . innerInfos [ i ] ; int outerClassNameIdx = currentInnerInfo . outerClassNameIndex ; int innerNameIndex = currentInnerInfo . innerNameIndex ; if ( outerClassNameIdx != <NUM_LIT:0> && innerNameIndex != <NUM_LIT:0> && outerClassNameIdx == this . classNameIndex && currentInnerInfo . getSourceName ( ) . length != <NUM_LIT:0> ) { memberTypes [ memberTypeIndex ++ ] = currentInnerInfo ; } } if ( memberTypeIndex == <NUM_LIT:0> ) return null ; if ( memberTypeIndex != memberTypes . length ) { System . arraycopy ( memberTypes , <NUM_LIT:0> , ( memberTypes = new IBinaryNestedType [ memberTypeIndex ] ) , <NUM_LIT:0> , memberTypeIndex ) ; } return memberTypes ; } return null ; } public IBinaryMethod [ ] getMethods ( ) { return this . methods ; } public char [ ] [ ] [ ] getMissingTypeNames ( ) { return this . missingTypeNames ; } public int getModifiers ( ) { int modifiers ; if ( this . innerInfo != null ) { modifiers = this . innerInfo . getModifiers ( ) | ( this . accessFlags & ClassFileConstants . AccDeprecated ) | ( this . accessFlags & ClassFileConstants . AccSynthetic ) ; } else { modifiers = this . accessFlags ; } return modifiers ; } public char [ ] getName ( ) { return this . className ; } public char [ ] getSourceName ( ) { if ( this . sourceName != null ) return this . sourceName ; char [ ] name = getInnerSourceName ( ) ; if ( name == null ) { name = getName ( ) ; int start ; if ( isAnonymous ( ) ) { start = CharOperation . indexOf ( '<CHAR_LIT>' , name , CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , name ) + <NUM_LIT:1> ) + <NUM_LIT:1> ; } else { start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , name ) + <NUM_LIT:1> ; } if ( start > <NUM_LIT:0> ) { char [ ] newName = new char [ name . length - start ] ; System . arraycopy ( name , start , newName , <NUM_LIT:0> , newName . length ) ; name = newName ; } } return this . sourceName = name ; } public char [ ] getSuperclassName ( ) { return this . superclassName ; } public long getTagBits ( ) { return this . tagBits ; } public long getVersion ( ) { return this . version ; } private boolean hasNonSyntheticFieldChanges ( FieldInfo [ ] currentFieldInfos , FieldInfo [ ] otherFieldInfos ) { int length1 = currentFieldInfos == null ? <NUM_LIT:0> : currentFieldInfos . length ; int length2 = otherFieldInfos == null ? <NUM_LIT:0> : otherFieldInfos . length ; int index1 = <NUM_LIT:0> ; int index2 = <NUM_LIT:0> ; end : while ( index1 < length1 && index2 < length2 ) { while ( currentFieldInfos [ index1 ] . isSynthetic ( ) ) { if ( ++ index1 >= length1 ) break end ; } while ( otherFieldInfos [ index2 ] . isSynthetic ( ) ) { if ( ++ index2 >= length2 ) break end ; } if ( hasStructuralFieldChanges ( currentFieldInfos [ index1 ++ ] , otherFieldInfos [ index2 ++ ] ) ) return true ; } while ( index1 < length1 ) { if ( ! currentFieldInfos [ index1 ++ ] . isSynthetic ( ) ) return true ; } while ( index2 < length2 ) { if ( ! otherFieldInfos [ index2 ++ ] . isSynthetic ( ) ) return true ; } return false ; } private boolean hasNonSyntheticMethodChanges ( MethodInfo [ ] currentMethodInfos , MethodInfo [ ] otherMethodInfos ) { int length1 = currentMethodInfos == null ? <NUM_LIT:0> : currentMethodInfos . length ; int length2 = otherMethodInfos == null ? <NUM_LIT:0> : otherMethodInfos . length ; int index1 = <NUM_LIT:0> ; int index2 = <NUM_LIT:0> ; MethodInfo m ; end : while ( index1 < length1 && index2 < length2 ) { while ( ( m = currentMethodInfos [ index1 ] ) . isSynthetic ( ) || m . isClinit ( ) ) { if ( ++ index1 >= length1 ) break end ; } while ( ( m = otherMethodInfos [ index2 ] ) . isSynthetic ( ) || m . isClinit ( ) ) { if ( ++ index2 >= length2 ) break end ; } if ( hasStructuralMethodChanges ( currentMethodInfos [ index1 ++ ] , otherMethodInfos [ index2 ++ ] ) ) return true ; } while ( index1 < length1 ) { if ( ! ( ( m = currentMethodInfos [ index1 ++ ] ) . isSynthetic ( ) || m . isClinit ( ) ) ) return true ; } while ( index2 < length2 ) { if ( ! ( ( m = otherMethodInfos [ index2 ++ ] ) . isSynthetic ( ) || m . isClinit ( ) ) ) return true ; } return false ; } public boolean hasStructuralChanges ( byte [ ] newBytes ) { return hasStructuralChanges ( newBytes , true , true ) ; } public boolean hasStructuralChanges ( byte [ ] newBytes , boolean orderRequired , boolean excludesSynthetic ) { try { ClassFileReader newClassFile = new ClassFileReader ( newBytes , this . classFileName ) ; if ( getModifiers ( ) != newClassFile . getModifiers ( ) ) return true ; long OnlyStructuralTagBits = TagBits . AnnotationTargetMASK | TagBits . AnnotationDeprecated | TagBits . AnnotationRetentionMASK | TagBits . HierarchyHasProblems ; if ( ( getTagBits ( ) & OnlyStructuralTagBits ) != ( newClassFile . getTagBits ( ) & OnlyStructuralTagBits ) ) return true ; if ( hasStructuralAnnotationChanges ( getAnnotations ( ) , newClassFile . getAnnotations ( ) ) ) return true ; if ( ! CharOperation . equals ( getGenericSignature ( ) , newClassFile . getGenericSignature ( ) ) ) return true ; if ( ! CharOperation . equals ( getSuperclassName ( ) , newClassFile . getSuperclassName ( ) ) ) return true ; char [ ] [ ] newInterfacesNames = newClassFile . getInterfaceNames ( ) ; if ( this . interfaceNames != newInterfacesNames ) { int newInterfacesLength = newInterfacesNames == null ? <NUM_LIT:0> : newInterfacesNames . length ; if ( newInterfacesLength != this . interfacesCount ) return true ; for ( int i = <NUM_LIT:0> , max = this . interfacesCount ; i < max ; i ++ ) if ( ! CharOperation . equals ( this . interfaceNames [ i ] , newInterfacesNames [ i ] ) ) return true ; } IBinaryNestedType [ ] currentMemberTypes = getMemberTypes ( ) ; IBinaryNestedType [ ] otherMemberTypes = newClassFile . getMemberTypes ( ) ; if ( currentMemberTypes != otherMemberTypes ) { int currentMemberTypeLength = currentMemberTypes == null ? <NUM_LIT:0> : currentMemberTypes . length ; int otherMemberTypeLength = otherMemberTypes == null ? <NUM_LIT:0> : otherMemberTypes . length ; if ( currentMemberTypeLength != otherMemberTypeLength ) return true ; for ( int i = <NUM_LIT:0> ; i < currentMemberTypeLength ; i ++ ) if ( ! CharOperation . equals ( currentMemberTypes [ i ] . getName ( ) , otherMemberTypes [ i ] . getName ( ) ) || currentMemberTypes [ i ] . getModifiers ( ) != otherMemberTypes [ i ] . getModifiers ( ) ) return true ; } FieldInfo [ ] otherFieldInfos = ( FieldInfo [ ] ) newClassFile . getFields ( ) ; int otherFieldInfosLength = otherFieldInfos == null ? <NUM_LIT:0> : otherFieldInfos . length ; boolean compareFields = true ; if ( this . fieldsCount == otherFieldInfosLength ) { int i = <NUM_LIT:0> ; for ( ; i < this . fieldsCount ; i ++ ) if ( hasStructuralFieldChanges ( this . fields [ i ] , otherFieldInfos [ i ] ) ) break ; if ( ( compareFields = i != this . fieldsCount ) && ! orderRequired && ! excludesSynthetic ) return true ; } if ( compareFields ) { if ( this . fieldsCount != otherFieldInfosLength && ! excludesSynthetic ) return true ; if ( orderRequired ) { if ( this . fieldsCount != <NUM_LIT:0> ) Arrays . sort ( this . fields ) ; if ( otherFieldInfosLength != <NUM_LIT:0> ) Arrays . sort ( otherFieldInfos ) ; } if ( excludesSynthetic ) { if ( hasNonSyntheticFieldChanges ( this . fields , otherFieldInfos ) ) return true ; } else { for ( int i = <NUM_LIT:0> ; i < this . fieldsCount ; i ++ ) if ( hasStructuralFieldChanges ( this . fields [ i ] , otherFieldInfos [ i ] ) ) return true ; } } MethodInfo [ ] otherMethodInfos = ( MethodInfo [ ] ) newClassFile . getMethods ( ) ; int otherMethodInfosLength = otherMethodInfos == null ? <NUM_LIT:0> : otherMethodInfos . length ; boolean compareMethods = true ; if ( this . methodsCount == otherMethodInfosLength ) { int i = <NUM_LIT:0> ; for ( ; i < this . methodsCount ; i ++ ) if ( hasStructuralMethodChanges ( this . methods [ i ] , otherMethodInfos [ i ] ) ) break ; if ( ( compareMethods = i != this . methodsCount ) && ! orderRequired && ! excludesSynthetic ) return true ; } if ( compareMethods ) { if ( this . methodsCount != otherMethodInfosLength && ! excludesSynthetic ) return true ; if ( orderRequired ) { if ( this . methodsCount != <NUM_LIT:0> ) Arrays . sort ( this . methods ) ; if ( otherMethodInfosLength != <NUM_LIT:0> ) Arrays . sort ( otherMethodInfos ) ; } if ( excludesSynthetic ) { if ( hasNonSyntheticMethodChanges ( this . methods , otherMethodInfos ) ) return true ; } else { for ( int i = <NUM_LIT:0> ; i < this . methodsCount ; i ++ ) if ( hasStructuralMethodChanges ( this . methods [ i ] , otherMethodInfos [ i ] ) ) return true ; } } char [ ] [ ] [ ] missingTypes = getMissingTypeNames ( ) ; char [ ] [ ] [ ] newMissingTypes = newClassFile . getMissingTypeNames ( ) ; if ( missingTypes != null ) { if ( newMissingTypes == null ) { return true ; } int length = missingTypes . length ; if ( length != newMissingTypes . length ) { return true ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! CharOperation . equals ( missingTypes [ i ] , newMissingTypes [ i ] ) ) { return true ; } } } else if ( newMissingTypes != null ) { return true ; } return false ; } catch ( ClassFormatException e ) { return true ; } } private boolean hasStructuralAnnotationChanges ( IBinaryAnnotation [ ] currentAnnotations , IBinaryAnnotation [ ] otherAnnotations ) { if ( currentAnnotations == otherAnnotations ) return false ; int currentAnnotationsLength = currentAnnotations == null ? <NUM_LIT:0> : currentAnnotations . length ; int otherAnnotationsLength = otherAnnotations == null ? <NUM_LIT:0> : otherAnnotations . length ; if ( currentAnnotationsLength != otherAnnotationsLength ) return true ; for ( int i = <NUM_LIT:0> ; i < currentAnnotationsLength ; i ++ ) { if ( ! CharOperation . equals ( currentAnnotations [ i ] . getTypeName ( ) , otherAnnotations [ i ] . getTypeName ( ) ) ) return true ; IBinaryElementValuePair [ ] currentPairs = currentAnnotations [ i ] . getElementValuePairs ( ) ; IBinaryElementValuePair [ ] otherPairs = otherAnnotations [ i ] . getElementValuePairs ( ) ; int currentPairsLength = currentPairs == null ? <NUM_LIT:0> : currentPairs . length ; int otherPairsLength = otherPairs == null ? <NUM_LIT:0> : otherPairs . length ; if ( currentPairsLength != otherPairsLength ) return true ; for ( int j = <NUM_LIT:0> ; j < currentPairsLength ; j ++ ) { if ( ! CharOperation . equals ( currentPairs [ j ] . getName ( ) , otherPairs [ j ] . getName ( ) ) ) return true ; final Object value = currentPairs [ j ] . getValue ( ) ; final Object value2 = otherPairs [ j ] . getValue ( ) ; if ( value instanceof Object [ ] ) { Object [ ] currentValues = ( Object [ ] ) value ; if ( value2 instanceof Object [ ] ) { Object [ ] currentValues2 = ( Object [ ] ) value2 ; final int length = currentValues . length ; if ( length != currentValues2 . length ) { return true ; } for ( int n = <NUM_LIT:0> ; n < length ; n ++ ) { if ( ! currentValues [ n ] . equals ( currentValues2 [ n ] ) ) { return true ; } } return false ; } return true ; } else if ( ! value . equals ( value2 ) ) { return true ; } } } return false ; } private boolean hasStructuralFieldChanges ( FieldInfo currentFieldInfo , FieldInfo otherFieldInfo ) { if ( ! CharOperation . equals ( currentFieldInfo . getGenericSignature ( ) , otherFieldInfo . getGenericSignature ( ) ) ) return true ; if ( currentFieldInfo . getModifiers ( ) != otherFieldInfo . getModifiers ( ) ) return true ; if ( ( currentFieldInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) != ( otherFieldInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) ) return true ; if ( hasStructuralAnnotationChanges ( currentFieldInfo . getAnnotations ( ) , otherFieldInfo . getAnnotations ( ) ) ) return true ; if ( ! CharOperation . equals ( currentFieldInfo . getName ( ) , otherFieldInfo . getName ( ) ) ) return true ; if ( ! CharOperation . equals ( currentFieldInfo . getTypeName ( ) , otherFieldInfo . getTypeName ( ) ) ) return true ; if ( currentFieldInfo . hasConstant ( ) != otherFieldInfo . hasConstant ( ) ) return true ; if ( currentFieldInfo . hasConstant ( ) ) { Constant currentConstant = currentFieldInfo . getConstant ( ) ; Constant otherConstant = otherFieldInfo . getConstant ( ) ; if ( currentConstant . typeID ( ) != otherConstant . typeID ( ) ) return true ; if ( ! currentConstant . getClass ( ) . equals ( otherConstant . getClass ( ) ) ) return true ; switch ( currentConstant . typeID ( ) ) { case TypeIds . T_int : return currentConstant . intValue ( ) != otherConstant . intValue ( ) ; case TypeIds . T_byte : return currentConstant . byteValue ( ) != otherConstant . byteValue ( ) ; case TypeIds . T_short : return currentConstant . shortValue ( ) != otherConstant . shortValue ( ) ; case TypeIds . T_char : return currentConstant . charValue ( ) != otherConstant . charValue ( ) ; case TypeIds . T_long : return currentConstant . longValue ( ) != otherConstant . longValue ( ) ; case TypeIds . T_float : return currentConstant . floatValue ( ) != otherConstant . floatValue ( ) ; case TypeIds . T_double : return currentConstant . doubleValue ( ) != otherConstant . doubleValue ( ) ; case TypeIds . T_boolean : return currentConstant . booleanValue ( ) != otherConstant . booleanValue ( ) ; case TypeIds . T_JavaLangString : return ! currentConstant . stringValue ( ) . equals ( otherConstant . stringValue ( ) ) ; } } return false ; } private boolean hasStructuralMethodChanges ( MethodInfo currentMethodInfo , MethodInfo otherMethodInfo ) { if ( ! CharOperation . equals ( currentMethodInfo . getGenericSignature ( ) , otherMethodInfo . getGenericSignature ( ) ) ) return true ; if ( currentMethodInfo . getModifiers ( ) != otherMethodInfo . getModifiers ( ) ) return true ; if ( ( currentMethodInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) != ( otherMethodInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) ) return true ; if ( hasStructuralAnnotationChanges ( currentMethodInfo . getAnnotations ( ) , otherMethodInfo . getAnnotations ( ) ) ) return true ; int currentAnnotatedParamsCount = currentMethodInfo . getAnnotatedParametersCount ( ) ; int otherAnnotatedParamsCount = otherMethodInfo . getAnnotatedParametersCount ( ) ; if ( currentAnnotatedParamsCount != otherAnnotatedParamsCount ) return true ; for ( int i = <NUM_LIT:0> ; i < currentAnnotatedParamsCount ; i ++ ) { if ( hasStructuralAnnotationChanges ( currentMethodInfo . getParameterAnnotations ( i ) , otherMethodInfo . getParameterAnnotations ( i ) ) ) return true ; } if ( ! CharOperation . equals ( currentMethodInfo . getSelector ( ) , otherMethodInfo . getSelector ( ) ) ) return true ; if ( ! CharOperation . equals ( currentMethodInfo . getMethodDescriptor ( ) , otherMethodInfo . getMethodDescriptor ( ) ) ) return true ; if ( ! CharOperation . equals ( currentMethodInfo . getGenericSignature ( ) , otherMethodInfo . getGenericSignature ( ) ) ) return true ; char [ ] [ ] currentThrownExceptions = currentMethodInfo . getExceptionTypeNames ( ) ; char [ ] [ ] otherThrownExceptions = otherMethodInfo . getExceptionTypeNames ( ) ; if ( currentThrownExceptions != otherThrownExceptions ) { int currentThrownExceptionsLength = currentThrownExceptions == null ? <NUM_LIT:0> : currentThrownExceptions . length ; int otherThrownExceptionsLength = otherThrownExceptions == null ? <NUM_LIT:0> : otherThrownExceptions . length ; if ( currentThrownExceptionsLength != otherThrownExceptionsLength ) return true ; for ( int k = <NUM_LIT:0> ; k < currentThrownExceptionsLength ; k ++ ) if ( ! CharOperation . equals ( currentThrownExceptions [ k ] , otherThrownExceptions [ k ] ) ) return true ; } return false ; } private void initialize ( ) throws ClassFormatException { try { for ( int i = <NUM_LIT:0> , max = this . fieldsCount ; i < max ; i ++ ) { this . fields [ i ] . initialize ( ) ; } for ( int i = <NUM_LIT:0> , max = this . methodsCount ; i < max ; i ++ ) { this . methods [ i ] . initialize ( ) ; } if ( this . innerInfos != null ) { for ( int i = <NUM_LIT:0> , max = this . innerInfos . length ; i < max ; i ++ ) { this . innerInfos [ i ] . initialize ( ) ; } } if ( this . annotations != null ) { for ( int i = <NUM_LIT:0> , max = this . annotations . length ; i < max ; i ++ ) { this . annotations [ i ] . initialize ( ) ; } } this . getEnclosingMethod ( ) ; reset ( ) ; } catch ( RuntimeException e ) { ClassFormatException exception = new ClassFormatException ( e , this . classFileName ) ; throw exception ; } } public boolean isAnonymous ( ) { if ( this . innerInfo == null ) return false ; char [ ] innerSourceName = this . innerInfo . getSourceName ( ) ; return ( innerSourceName == null || innerSourceName . length == <NUM_LIT:0> ) ; } public boolean isBinaryType ( ) { return true ; } public boolean isLocal ( ) { if ( this . innerInfo == null ) return false ; if ( this . innerInfo . getEnclosingTypeName ( ) != null ) return false ; char [ ] innerSourceName = this . innerInfo . getSourceName ( ) ; return ( innerSourceName != null && innerSourceName . length > <NUM_LIT:0> ) ; } public boolean isMember ( ) { if ( this . innerInfo == null ) return false ; if ( this . innerInfo . getEnclosingTypeName ( ) == null ) return false ; char [ ] innerSourceName = this . innerInfo . getSourceName ( ) ; return ( innerSourceName != null && innerSourceName . length > <NUM_LIT:0> ) ; } public boolean isNestedType ( ) { return this . innerInfo != null ; } public char [ ] sourceFileName ( ) { return this . sourceFileName ; } public String toString ( ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter print = new java . io . PrintWriter ( out ) ; print . println ( getClass ( ) . getName ( ) + "<STR_LIT:{>" ) ; print . println ( "<STR_LIT>" + new String ( getName ( ) ) ) ; print . println ( "<STR_LIT>" + ( getSuperclassName ( ) == null ? "<STR_LIT:null>" : new String ( getSuperclassName ( ) ) ) ) ; print . println ( "<STR_LIT>" + printTypeModifiers ( accessFlags ( ) ) + "<STR_LIT:(>" + accessFlags ( ) + "<STR_LIT:)>" ) ; print . flush ( ) ; return out . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . io . PrintStream ; import java . io . PrintWriter ; public class ClassFormatException extends Exception { public static final int ErrBadMagic = <NUM_LIT:1> ; public static final int ErrBadMinorVersion = <NUM_LIT:2> ; public static final int ErrBadMajorVersion = <NUM_LIT:3> ; public static final int ErrBadConstantClass = <NUM_LIT:4> ; public static final int ErrBadConstantString = <NUM_LIT:5> ; public static final int ErrBadConstantNameAndType = <NUM_LIT:6> ; public static final int ErrBadConstantFieldRef = <NUM_LIT:7> ; public static final int ErrBadConstantMethodRef = <NUM_LIT:8> ; public static final int ErrBadConstantInterfaceMethodRef = <NUM_LIT:9> ; public static final int ErrBadConstantPoolIndex = <NUM_LIT:10> ; public static final int ErrBadSuperclassName = <NUM_LIT:11> ; public static final int ErrInterfaceCannotBeFinal = <NUM_LIT:12> ; public static final int ErrInterfaceMustBeAbstract = <NUM_LIT> ; public static final int ErrBadModifiers = <NUM_LIT> ; public static final int ErrClassCannotBeAbstractFinal = <NUM_LIT:15> ; public static final int ErrBadClassname = <NUM_LIT:16> ; public static final int ErrBadFieldInfo = <NUM_LIT> ; public static final int ErrBadMethodInfo = <NUM_LIT> ; public static final int ErrEmptyConstantPool = <NUM_LIT> ; public static final int ErrMalformedUtf8 = <NUM_LIT> ; public static final int ErrUnknownConstantTag = <NUM_LIT:20> ; public static final int ErrTruncatedInput = <NUM_LIT> ; public static final int ErrMethodMustBeAbstract = <NUM_LIT> ; public static final int ErrMalformedAttribute = <NUM_LIT> ; public static final int ErrBadInterface = <NUM_LIT:24> ; public static final int ErrInterfaceMustSubclassObject = <NUM_LIT> ; public static final int ErrIncorrectInterfaceMethods = <NUM_LIT> ; public static final int ErrInvalidMethodName = <NUM_LIT> ; public static final int ErrInvalidMethodSignature = <NUM_LIT> ; private static final long serialVersionUID = <NUM_LIT> ; private int errorCode ; private int bufferPosition ; private RuntimeException nestedException ; private char [ ] fileName ; public ClassFormatException ( RuntimeException e , char [ ] fileName ) { this . nestedException = e ; this . fileName = fileName ; } public ClassFormatException ( int code ) { this . errorCode = code ; } public ClassFormatException ( int code , int bufPos ) { this . errorCode = code ; this . bufferPosition = bufPos ; } public int getErrorCode ( ) { return this . errorCode ; } public int getBufferPosition ( ) { return this . bufferPosition ; } public Throwable getException ( ) { return this . nestedException ; } public void printStackTrace ( ) { printStackTrace ( System . err ) ; } public void printStackTrace ( PrintStream output ) { synchronized ( output ) { super . printStackTrace ( output ) ; Throwable throwable = getException ( ) ; if ( throwable != null ) { if ( this . fileName != null ) { output . print ( "<STR_LIT>" ) ; output . print ( this . fileName ) ; output . print ( "<STR_LIT>" ) ; } else { output . print ( "<STR_LIT>" ) ; } throwable . printStackTrace ( output ) ; } } } public void printStackTrace ( PrintWriter output ) { synchronized ( output ) { super . printStackTrace ( output ) ; Throwable throwable = getException ( ) ; if ( throwable != null ) { if ( this . fileName != null ) { output . print ( "<STR_LIT>" ) ; output . print ( this . fileName ) ; output . print ( "<STR_LIT>" ) ; } else { output . print ( "<STR_LIT>" ) ; } throwable . printStackTrace ( output ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; public class MethodInfoWithAnnotations extends MethodInfo { protected AnnotationInfo [ ] annotations ; MethodInfoWithAnnotations ( MethodInfo methodInfo , AnnotationInfo [ ] annotations ) { super ( methodInfo . reference , methodInfo . constantPoolOffsets , methodInfo . structOffset ) ; this . annotations = annotations ; this . accessFlags = methodInfo . accessFlags ; this . attributeBytes = methodInfo . attributeBytes ; this . descriptor = methodInfo . descriptor ; this . exceptionNames = methodInfo . exceptionNames ; this . name = methodInfo . name ; this . signature = methodInfo . signature ; this . signatureUtf8Offset = methodInfo . signatureUtf8Offset ; this . tagBits = methodInfo . tagBits ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) if ( this . annotations [ i ] != null ) this . annotations [ i ] . initialize ( ) ; super . initialize ( ) ; } protected void reset ( ) { for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) if ( this . annotations [ i ] != null ) this . annotations [ i ] . reset ( ) ; super . reset ( ) ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) { buffer . append ( this . annotations [ i ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . util . Util ; public class AnnotationInfo extends ClassFileStruct implements IBinaryAnnotation { private char [ ] typename ; private ElementValuePairInfo [ ] pairs ; long standardAnnotationTagBits = <NUM_LIT:0> ; int readOffset = <NUM_LIT:0> ; static Object [ ] EmptyValueArray = new Object [ <NUM_LIT:0> ] ; AnnotationInfo ( byte [ ] classFileBytes , int [ ] contantPoolOffsets , int offset ) { super ( classFileBytes , contantPoolOffsets , offset ) ; } AnnotationInfo ( byte [ ] classFileBytes , int [ ] contantPoolOffsets , int offset , boolean runtimeVisible , boolean populate ) { this ( classFileBytes , contantPoolOffsets , offset ) ; if ( populate ) decodeAnnotation ( ) ; else this . readOffset = scanAnnotation ( <NUM_LIT:0> , runtimeVisible , true ) ; } private void decodeAnnotation ( ) { this . readOffset = <NUM_LIT:0> ; int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:0> ) ] - this . structOffset ; this . typename = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; int numberOfPairs = u2At ( <NUM_LIT:2> ) ; this . readOffset += <NUM_LIT:4> ; this . pairs = numberOfPairs == <NUM_LIT:0> ? ElementValuePairInfo . NoMembers : new ElementValuePairInfo [ numberOfPairs ] ; for ( int i = <NUM_LIT:0> ; i < numberOfPairs ; i ++ ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] membername = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; Object value = decodeDefaultValue ( ) ; this . pairs [ i ] = new ElementValuePairInfo ( membername , value ) ; } } Object decodeDefaultValue ( ) { Object value = null ; int tag = u1At ( this . readOffset ) ; this . readOffset ++ ; int constValueOffset = - <NUM_LIT:1> ; switch ( tag ) { case '<CHAR_LIT:Z>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = BooleanConstant . fromValue ( i4At ( constValueOffset + <NUM_LIT:1> ) == <NUM_LIT:1> ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = IntConstant . fromValue ( i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = CharConstant . fromValue ( ( char ) i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = ByteConstant . fromValue ( ( byte ) i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = ShortConstant . fromValue ( ( short ) i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = DoubleConstant . fromValue ( doubleAt ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = FloatConstant . fromValue ( floatAt ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = LongConstant . fromValue ( i8At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = StringConstant . fromValue ( String . valueOf ( utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT:e>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] typeName = utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] constName = utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; value = new EnumConstantSignature ( typeName , constName ) ; break ; case '<CHAR_LIT:c>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] className = utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ; value = new ClassSignature ( className ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : value = new AnnotationInfo ( this . reference , this . constantPoolOffsets , this . readOffset + this . structOffset , false , true ) ; this . readOffset += ( ( AnnotationInfo ) value ) . readOffset ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( this . readOffset ) ; this . readOffset += <NUM_LIT:2> ; if ( numberOfValues == <NUM_LIT:0> ) { value = EmptyValueArray ; } else { Object [ ] arrayElements = new Object [ numberOfValues ] ; value = arrayElements ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) arrayElements [ i ] = decodeDefaultValue ( ) ; } break ; default : throw new IllegalStateException ( "<STR_LIT>" + ( char ) tag ) ; } return value ; } public IBinaryElementValuePair [ ] getElementValuePairs ( ) { if ( this . pairs == null ) initialize ( ) ; return this . pairs ; } public char [ ] getTypeName ( ) { return this . typename ; } void initialize ( ) { if ( this . pairs == null ) decodeAnnotation ( ) ; } private int readRetentionPolicy ( int offset ) { int currentOffset = offset ; int tag = u1At ( currentOffset ) ; currentOffset ++ ; switch ( tag ) { case '<CHAR_LIT:e>' : int utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] typeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; currentOffset += <NUM_LIT:2> ; if ( typeName . length == <NUM_LIT> && CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_RETENTIONPOLICY ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] constName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . standardAnnotationTagBits |= Annotation . getRetentionPolicy ( constName ) ; } currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : currentOffset = scanAnnotation ( currentOffset , false , false ) ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( currentOffset ) ; currentOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) currentOffset = scanElementValue ( currentOffset ) ; break ; default : throw new IllegalStateException ( ) ; } return currentOffset ; } private int readTargetValue ( int offset ) { int currentOffset = offset ; int tag = u1At ( currentOffset ) ; currentOffset ++ ; switch ( tag ) { case '<CHAR_LIT:e>' : int utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] typeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; currentOffset += <NUM_LIT:2> ; if ( typeName . length == <NUM_LIT> && CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_ELEMENTTYPE ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] constName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . standardAnnotationTagBits |= Annotation . getTargetElementType ( constName ) ; } currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : currentOffset = scanAnnotation ( currentOffset , false , false ) ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( currentOffset ) ; currentOffset += <NUM_LIT:2> ; if ( numberOfValues == <NUM_LIT:0> ) { this . standardAnnotationTagBits |= TagBits . AnnotationTarget ; } else { for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) currentOffset = readTargetValue ( currentOffset ) ; } break ; default : throw new IllegalStateException ( ) ; } return currentOffset ; } private int scanAnnotation ( int offset , boolean expectRuntimeVisibleAnno , boolean toplevel ) { int currentOffset = offset ; int utf8Offset = this . constantPoolOffsets [ u2At ( offset ) ] - this . structOffset ; char [ ] typeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( toplevel ) this . typename = typeName ; int numberOfPairs = u2At ( offset + <NUM_LIT:2> ) ; currentOffset += <NUM_LIT:4> ; if ( expectRuntimeVisibleAnno && toplevel ) { switch ( typeName . length ) { case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_DEPRECATED ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationDeprecated ; return currentOffset ; } break ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_SAFEVARARGS ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationSafeVarargs ; return currentOffset ; } break ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_TARGET ) ) { currentOffset += <NUM_LIT:2> ; return readTargetValue ( currentOffset ) ; } break ; case <NUM_LIT:32> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_RETENTION ) ) { currentOffset += <NUM_LIT:2> ; return readRetentionPolicy ( currentOffset ) ; } if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_INHERITED ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationInherited ; return currentOffset ; } break ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_DOCUMENTED ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationDocumented ; return currentOffset ; } break ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationPolymorphicSignature ; return currentOffset ; } break ; } } for ( int i = <NUM_LIT:0> ; i < numberOfPairs ; i ++ ) { currentOffset += <NUM_LIT:2> ; currentOffset = scanElementValue ( currentOffset ) ; } return currentOffset ; } private int scanElementValue ( int offset ) { int currentOffset = offset ; int tag = u1At ( currentOffset ) ; currentOffset ++ ; switch ( tag ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT:e>' : currentOffset += <NUM_LIT:4> ; break ; case '<CHAR_LIT>' : currentOffset = scanAnnotation ( currentOffset , false , false ) ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( currentOffset ) ; currentOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) currentOffset = scanElementValue ( currentOffset ) ; break ; default : throw new IllegalStateException ( ) ; } return currentOffset ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( this . typename ) ; if ( this . pairs != null ) { buffer . append ( '<CHAR_LIT:(>' ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , len = this . pairs . length ; i < len ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . pairs [ i ] ) ; } buffer . append ( '<CHAR_LIT:)>' ) ; } return buffer . toString ( ) ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + Util . hashCode ( this . pairs ) ; result = prime * result + CharOperation . hashCode ( this . typename ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } AnnotationInfo other = ( AnnotationInfo ) obj ; if ( ! Arrays . equals ( this . pairs , other . pairs ) ) { return false ; } if ( ! Arrays . equals ( this . typename , other . typename ) ) { return false ; } return true ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; abstract public class ClassFileStruct { byte [ ] reference ; int [ ] constantPoolOffsets ; int structOffset ; public ClassFileStruct ( byte [ ] classFileBytes , int [ ] offsets , int offset ) { this . reference = classFileBytes ; this . constantPoolOffsets = offsets ; this . structOffset = offset ; } public double doubleAt ( int relativeOffset ) { return ( Double . longBitsToDouble ( i8At ( relativeOffset ) ) ) ; } public float floatAt ( int relativeOffset ) { return ( Float . intBitsToFloat ( i4At ( relativeOffset ) ) ) ; } public int i4At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( this . reference [ position ] & <NUM_LIT> ) ; } public long i8At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:32> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:24> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:16> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:8> ) | ( this . reference [ position ++ ] & <NUM_LIT> ) ; } protected void reset ( ) { this . reference = null ; this . constantPoolOffsets = null ; } public int u1At ( int relativeOffset ) { return ( this . reference [ relativeOffset + this . structOffset ] & <NUM_LIT> ) ; } public int u2At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) | ( this . reference [ position ] & <NUM_LIT> ) ; } public long u4At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) | ( this . reference [ position ] & <NUM_LIT> ) ) ; } public char [ ] utf8At ( int relativeOffset , int bytesAvailable ) { int length = bytesAvailable ; char outputBuf [ ] = new char [ bytesAvailable ] ; int outputPos = <NUM_LIT:0> ; int readOffset = this . structOffset + relativeOffset ; while ( length != <NUM_LIT:0> ) { int x = this . reference [ readOffset ++ ] & <NUM_LIT> ; length -- ; if ( ( <NUM_LIT> & x ) != <NUM_LIT:0> ) { if ( ( x & <NUM_LIT> ) != <NUM_LIT:0> ) { length -= <NUM_LIT:2> ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:12> ) | ( ( this . reference [ readOffset ++ ] & <NUM_LIT> ) << <NUM_LIT:6> ) | ( this . reference [ readOffset ++ ] & <NUM_LIT> ) ; } else { length -- ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:6> ) | ( this . reference [ readOffset ++ ] & <NUM_LIT> ) ; } } outputBuf [ outputPos ++ ] = ( char ) x ; } if ( outputPos != bytesAvailable ) { System . arraycopy ( outputBuf , <NUM_LIT:0> , ( outputBuf = new char [ outputPos ] ) , <NUM_LIT:0> , outputPos ) ; } return outputBuf ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; public class AnnotationMethodInfo extends MethodInfo { protected Object defaultValue = null ; public static MethodInfo createAnnotationMethod ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { MethodInfo methodInfo = new MethodInfo ( classFileBytes , offsets , offset ) ; int attributesCount = methodInfo . u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; AnnotationInfo [ ] annotations = null ; Object defaultValue = null ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = methodInfo . constantPoolOffsets [ methodInfo . u2At ( readOffset ) ] - methodInfo . structOffset ; char [ ] attributeName = methodInfo . utf8At ( utf8Offset + <NUM_LIT:3> , methodInfo . u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length > <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:A>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . AnnotationDefaultName ) ) { AnnotationInfo info = new AnnotationInfo ( methodInfo . reference , methodInfo . constantPoolOffsets , readOffset + <NUM_LIT:6> + methodInfo . structOffset ) ; defaultValue = info . decodeDefaultValue ( ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( AttributeNamesConstants . SignatureName , attributeName ) ) methodInfo . signatureUtf8Offset = methodInfo . constantPoolOffsets [ methodInfo . u2At ( readOffset + <NUM_LIT:6> ) ] - methodInfo . structOffset ; break ; case '<CHAR_LIT>' : AnnotationInfo [ ] methodAnnotations = null ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { methodAnnotations = decodeMethodAnnotations ( readOffset , true , methodInfo ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { methodAnnotations = decodeMethodAnnotations ( readOffset , false , methodInfo ) ; } if ( methodAnnotations != null ) { if ( annotations == null ) { annotations = methodAnnotations ; } else { int length = annotations . length ; AnnotationInfo [ ] newAnnotations = new AnnotationInfo [ length + methodAnnotations . length ] ; System . arraycopy ( annotations , <NUM_LIT:0> , newAnnotations , <NUM_LIT:0> , length ) ; System . arraycopy ( methodAnnotations , <NUM_LIT:0> , newAnnotations , length , methodAnnotations . length ) ; annotations = newAnnotations ; } } break ; } } readOffset += ( <NUM_LIT:6> + methodInfo . u4At ( readOffset + <NUM_LIT:2> ) ) ; } methodInfo . attributeBytes = readOffset ; if ( defaultValue != null ) { if ( annotations != null ) { return new AnnotationMethodInfoWithAnnotations ( methodInfo , defaultValue , annotations ) ; } return new AnnotationMethodInfo ( methodInfo , defaultValue ) ; } if ( annotations != null ) return new MethodInfoWithAnnotations ( methodInfo , annotations ) ; return methodInfo ; } AnnotationMethodInfo ( MethodInfo methodInfo , Object defaultValue ) { super ( methodInfo . reference , methodInfo . constantPoolOffsets , methodInfo . structOffset ) ; this . defaultValue = defaultValue ; this . accessFlags = methodInfo . accessFlags ; this . attributeBytes = methodInfo . attributeBytes ; this . descriptor = methodInfo . descriptor ; this . exceptionNames = methodInfo . exceptionNames ; this . name = methodInfo . name ; this . signature = methodInfo . signature ; this . signatureUtf8Offset = methodInfo . signatureUtf8Offset ; this . tagBits = methodInfo . tagBits ; } public Object getDefaultValue ( ) { return this . defaultValue ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; if ( this . defaultValue != null ) { buffer . append ( "<STR_LIT>" ) ; if ( this . defaultValue instanceof Object [ ] ) { buffer . append ( '<CHAR_LIT>' ) ; Object [ ] elements = ( Object [ ] ) this . defaultValue ; for ( int i = <NUM_LIT:0> , len = elements . length ; i < len ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( elements [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } else { buffer . append ( this . defaultValue ) ; } buffer . append ( '<STR_LIT:\n>' ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public interface ClassFileConstants { int AccDefault = <NUM_LIT:0> ; int AccPublic = <NUM_LIT> ; int AccPrivate = <NUM_LIT> ; int AccProtected = <NUM_LIT> ; int AccStatic = <NUM_LIT> ; int AccFinal = <NUM_LIT> ; int AccSynchronized = <NUM_LIT> ; int AccVolatile = <NUM_LIT> ; int AccBridge = <NUM_LIT> ; int AccTransient = <NUM_LIT> ; int AccVarargs = <NUM_LIT> ; int AccNative = <NUM_LIT> ; int AccInterface = <NUM_LIT> ; int AccAbstract = <NUM_LIT> ; int AccStrictfp = <NUM_LIT> ; int AccSynthetic = <NUM_LIT> ; int AccAnnotation = <NUM_LIT> ; int AccEnum = <NUM_LIT> ; int AccSuper = <NUM_LIT> ; int AccAnnotationDefault = ASTNode . Bit18 ; int AccDeprecated = ASTNode . Bit21 ; int Utf8Tag = <NUM_LIT:1> ; int IntegerTag = <NUM_LIT:3> ; int FloatTag = <NUM_LIT:4> ; int LongTag = <NUM_LIT:5> ; int DoubleTag = <NUM_LIT:6> ; int ClassTag = <NUM_LIT:7> ; int StringTag = <NUM_LIT:8> ; int FieldRefTag = <NUM_LIT:9> ; int MethodRefTag = <NUM_LIT:10> ; int InterfaceMethodRefTag = <NUM_LIT:11> ; int NameAndTypeTag = <NUM_LIT:12> ; int MethodHandleTag = <NUM_LIT:15> ; int MethodTypeTag = <NUM_LIT:16> ; int InvokeDynamicTag = <NUM_LIT> ; int ConstantMethodRefFixedSize = <NUM_LIT:5> ; int ConstantClassFixedSize = <NUM_LIT:3> ; int ConstantDoubleFixedSize = <NUM_LIT:9> ; int ConstantFieldRefFixedSize = <NUM_LIT:5> ; int ConstantFloatFixedSize = <NUM_LIT:5> ; int ConstantIntegerFixedSize = <NUM_LIT:5> ; int ConstantInterfaceMethodRefFixedSize = <NUM_LIT:5> ; int ConstantLongFixedSize = <NUM_LIT:9> ; int ConstantStringFixedSize = <NUM_LIT:3> ; int ConstantUtf8FixedSize = <NUM_LIT:3> ; int ConstantNameAndTypeFixedSize = <NUM_LIT:5> ; int ConstantMethodHandleFixedSize = <NUM_LIT:4> ; int ConstantMethodTypeFixedSize = <NUM_LIT:3> ; int ConstantInvokeDynamicFixedSize = <NUM_LIT:5> ; int MAJOR_VERSION_1_1 = <NUM_LIT> ; int MAJOR_VERSION_1_2 = <NUM_LIT> ; int MAJOR_VERSION_1_3 = <NUM_LIT> ; int MAJOR_VERSION_1_4 = <NUM_LIT> ; int MAJOR_VERSION_1_5 = <NUM_LIT> ; int MAJOR_VERSION_1_6 = <NUM_LIT> ; int MAJOR_VERSION_1_7 = <NUM_LIT> ; int MINOR_VERSION_0 = <NUM_LIT:0> ; int MINOR_VERSION_1 = <NUM_LIT:1> ; int MINOR_VERSION_2 = <NUM_LIT:2> ; int MINOR_VERSION_3 = <NUM_LIT:3> ; int MINOR_VERSION_4 = <NUM_LIT:4> ; long JDK1_1 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_1 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_3 ; long JDK1_2 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_2 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_3 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_3 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_4 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_4 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_5 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_5 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_6 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_6 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_7 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_7 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long CLDC_1_1 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_1 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_4 ; long JDK_DEFERRED = Long . MAX_VALUE ; int INT_ARRAY = <NUM_LIT:10> ; int BYTE_ARRAY = <NUM_LIT:8> ; int BOOLEAN_ARRAY = <NUM_LIT:4> ; int SHORT_ARRAY = <NUM_LIT:9> ; int CHAR_ARRAY = <NUM_LIT:5> ; int LONG_ARRAY = <NUM_LIT:11> ; int FLOAT_ARRAY = <NUM_LIT:6> ; int DOUBLE_ARRAY = <NUM_LIT:7> ; int ATTR_SOURCE = <NUM_LIT> ; int ATTR_LINES = <NUM_LIT> ; int ATTR_VARS = <NUM_LIT> ; int ATTR_STACK_MAP_TABLE = <NUM_LIT> ; int ATTR_STACK_MAP = <NUM_LIT> ; } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; public final class FieldInfoWithAnnotation extends FieldInfo { private AnnotationInfo [ ] annotations ; FieldInfoWithAnnotation ( FieldInfo info , AnnotationInfo [ ] annos ) { super ( info . reference , info . constantPoolOffsets , info . structOffset ) ; this . accessFlags = info . accessFlags ; this . attributeBytes = info . attributeBytes ; this . constant = info . constant ; this . constantPoolOffsets = info . constantPoolOffsets ; this . descriptor = info . descriptor ; this . name = info . name ; this . signature = info . signature ; this . signatureUtf8Offset = info . signatureUtf8Offset ; this . tagBits = info . tagBits ; this . wrappedConstantValue = info . wrappedConstantValue ; this . annotations = annos ; } public org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , max = this . annotations . length ; i < max ; i ++ ) this . annotations [ i ] . initialize ( ) ; super . initialize ( ) ; } protected void reset ( ) { if ( this . annotations != null ) for ( int i = <NUM_LIT:0> , max = this . annotations . length ; i < max ; i ++ ) this . annotations [ i ] . reset ( ) ; super . reset ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( getClass ( ) . getName ( ) ) ; if ( this . annotations != null ) { buffer . append ( '<STR_LIT:\n>' ) ; for ( int i = <NUM_LIT:0> ; i < this . annotations . length ; i ++ ) { buffer . append ( this . annotations [ i ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } toStringContent ( buffer ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryField ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . Util ; public class FieldInfo extends ClassFileStruct implements IBinaryField , Comparable { protected int accessFlags ; protected int attributeBytes ; protected Constant constant ; protected char [ ] descriptor ; protected char [ ] name ; protected char [ ] signature ; protected int signatureUtf8Offset ; protected long tagBits ; protected Object wrappedConstantValue ; public static FieldInfo createField ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { FieldInfo fieldInfo = new FieldInfo ( classFileBytes , offsets , offset ) ; AnnotationInfo [ ] annotations = fieldInfo . readAttributes ( ) ; if ( annotations == null ) return fieldInfo ; return new FieldInfoWithAnnotation ( fieldInfo , annotations ) ; } protected FieldInfo ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { super ( classFileBytes , offsets , offset ) ; this . accessFlags = - <NUM_LIT:1> ; this . signatureUtf8Offset = - <NUM_LIT:1> ; } private AnnotationInfo [ ] decodeAnnotations ( int offset , boolean runtimeVisible ) { int numberOfAnnotations = u2At ( offset + <NUM_LIT:6> ) ; if ( numberOfAnnotations > <NUM_LIT:0> ) { int readOffset = offset + <NUM_LIT:8> ; AnnotationInfo [ ] newInfos = null ; int newInfoCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) { AnnotationInfo newInfo = new AnnotationInfo ( this . reference , this . constantPoolOffsets , readOffset + this . structOffset , runtimeVisible , false ) ; readOffset += newInfo . readOffset ; long standardTagBits = newInfo . standardAnnotationTagBits ; if ( standardTagBits != <NUM_LIT:0> ) { this . tagBits |= standardTagBits ; } else { if ( newInfos == null ) newInfos = new AnnotationInfo [ numberOfAnnotations - i ] ; newInfos [ newInfoCount ++ ] = newInfo ; } } if ( newInfos != null ) { if ( newInfoCount != newInfos . length ) System . arraycopy ( newInfos , <NUM_LIT:0> , newInfos = new AnnotationInfo [ newInfoCount ] , <NUM_LIT:0> , newInfoCount ) ; return newInfos ; } } return null ; } public int compareTo ( Object o ) { return new String ( getName ( ) ) . compareTo ( new String ( ( ( FieldInfo ) o ) . getName ( ) ) ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof FieldInfo ) ) { return false ; } return CharOperation . equals ( getName ( ) , ( ( FieldInfo ) o ) . getName ( ) ) ; } public int hashCode ( ) { return CharOperation . hashCode ( getName ( ) ) ; } public Constant getConstant ( ) { if ( this . constant == null ) { readConstantAttribute ( ) ; } return this . constant ; } public char [ ] getGenericSignature ( ) { if ( this . signatureUtf8Offset != - <NUM_LIT:1> ) { if ( this . signature == null ) { this . signature = utf8At ( this . signatureUtf8Offset + <NUM_LIT:3> , u2At ( this . signatureUtf8Offset + <NUM_LIT:1> ) ) ; } return this . signature ; } return null ; } public int getModifiers ( ) { if ( this . accessFlags == - <NUM_LIT:1> ) { this . accessFlags = u2At ( <NUM_LIT:0> ) ; readModifierRelatedAttributes ( ) ; } return this . accessFlags ; } public char [ ] getName ( ) { if ( this . name == null ) { int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:2> ) ] - this . structOffset ; this . name = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } return this . name ; } public long getTagBits ( ) { return this . tagBits ; } public char [ ] getTypeName ( ) { if ( this . descriptor == null ) { int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:4> ) ] - this . structOffset ; this . descriptor = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } return this . descriptor ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return null ; } public Object getWrappedConstantValue ( ) { if ( this . wrappedConstantValue == null ) { if ( hasConstant ( ) ) { Constant fieldConstant = getConstant ( ) ; switch ( fieldConstant . typeID ( ) ) { case TypeIds . T_int : this . wrappedConstantValue = new Integer ( fieldConstant . intValue ( ) ) ; break ; case TypeIds . T_byte : this . wrappedConstantValue = new Byte ( fieldConstant . byteValue ( ) ) ; break ; case TypeIds . T_short : this . wrappedConstantValue = new Short ( fieldConstant . shortValue ( ) ) ; break ; case TypeIds . T_char : this . wrappedConstantValue = new Character ( fieldConstant . charValue ( ) ) ; break ; case TypeIds . T_float : this . wrappedConstantValue = new Float ( fieldConstant . floatValue ( ) ) ; break ; case TypeIds . T_double : this . wrappedConstantValue = new Double ( fieldConstant . doubleValue ( ) ) ; break ; case TypeIds . T_boolean : this . wrappedConstantValue = Util . toBoolean ( fieldConstant . booleanValue ( ) ) ; break ; case TypeIds . T_long : this . wrappedConstantValue = new Long ( fieldConstant . longValue ( ) ) ; break ; case TypeIds . T_JavaLangString : this . wrappedConstantValue = fieldConstant . stringValue ( ) ; } } } return this . wrappedConstantValue ; } public boolean hasConstant ( ) { return getConstant ( ) != Constant . NotAConstant ; } protected void initialize ( ) { getModifiers ( ) ; getName ( ) ; getConstant ( ) ; getTypeName ( ) ; getGenericSignature ( ) ; reset ( ) ; } public boolean isSynthetic ( ) { return ( getModifiers ( ) & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } private AnnotationInfo [ ] readAttributes ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; AnnotationInfo [ ] annotations = null ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length > <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( AttributeNamesConstants . SignatureName , attributeName ) ) this . signatureUtf8Offset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] - this . structOffset ; break ; case '<CHAR_LIT>' : AnnotationInfo [ ] decodedAnnotations = null ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { decodedAnnotations = decodeAnnotations ( readOffset , true ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { decodedAnnotations = decodeAnnotations ( readOffset , false ) ; } if ( decodedAnnotations != null ) { if ( annotations == null ) { annotations = decodedAnnotations ; } else { int length = annotations . length ; AnnotationInfo [ ] combined = new AnnotationInfo [ length + decodedAnnotations . length ] ; System . arraycopy ( annotations , <NUM_LIT:0> , combined , <NUM_LIT:0> , length ) ; System . arraycopy ( decodedAnnotations , <NUM_LIT:0> , combined , length , decodedAnnotations . length ) ; annotations = combined ; } } } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } this . attributeBytes = readOffset ; return annotations ; } private void readConstantAttribute ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; boolean isConstant = false ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . ConstantValueName ) ) { isConstant = true ; int relativeOffset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] - this . structOffset ; switch ( u1At ( relativeOffset ) ) { case ClassFileConstants . IntegerTag : char [ ] sign = getTypeName ( ) ; if ( sign . length == <NUM_LIT:1> ) { switch ( sign [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : this . constant = BooleanConstant . fromValue ( i4At ( relativeOffset + <NUM_LIT:1> ) == <NUM_LIT:1> ) ; break ; case '<CHAR_LIT>' : this . constant = IntConstant . fromValue ( i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case '<CHAR_LIT>' : this . constant = CharConstant . fromValue ( ( char ) i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case '<CHAR_LIT>' : this . constant = ByteConstant . fromValue ( ( byte ) i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case '<CHAR_LIT>' : this . constant = ShortConstant . fromValue ( ( short ) i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; default : this . constant = Constant . NotAConstant ; } } else { this . constant = Constant . NotAConstant ; } break ; case ClassFileConstants . FloatTag : this . constant = FloatConstant . fromValue ( floatAt ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case ClassFileConstants . DoubleTag : this . constant = DoubleConstant . fromValue ( doubleAt ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case ClassFileConstants . LongTag : this . constant = LongConstant . fromValue ( i8At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case ClassFileConstants . StringTag : utf8Offset = this . constantPoolOffsets [ u2At ( relativeOffset + <NUM_LIT:1> ) ] - this . structOffset ; this . constant = StringConstant . fromValue ( String . valueOf ( utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ) ) ; break ; } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } if ( ! isConstant ) { this . constant = Constant . NotAConstant ; } } private void readModifierRelatedAttributes ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length != <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . DeprecatedName ) ) this . accessFlags |= ClassFileConstants . AccDeprecated ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SyntheticName ) ) this . accessFlags |= ClassFileConstants . AccSynthetic ; break ; } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } } public int sizeInBytes ( ) { return this . attributeBytes ; } public void throwFormatException ( ) throws ClassFormatException { throw new ClassFormatException ( ClassFormatException . ErrBadFieldInfo ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( getClass ( ) . getName ( ) ) ; toStringContent ( buffer ) ; return buffer . toString ( ) ; } protected void toStringContent ( StringBuffer buffer ) { int modifiers = getModifiers ( ) ; buffer . append ( '<CHAR_LIT>' ) . append ( ( ( modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT:1> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) ) . append ( getTypeName ( ) ) . append ( '<CHAR_LIT:U+0020>' ) . append ( getName ( ) ) . append ( '<CHAR_LIT:U+0020>' ) . append ( getConstant ( ) ) . append ( '<CHAR_LIT:}>' ) . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . util . Util ; class MethodInfoWithParameterAnnotations extends MethodInfoWithAnnotations { private AnnotationInfo [ ] [ ] parameterAnnotations ; MethodInfoWithParameterAnnotations ( MethodInfo methodInfo , AnnotationInfo [ ] annotations , AnnotationInfo [ ] [ ] parameterAnnotations ) { super ( methodInfo , annotations ) ; if ( methodInfo . isConstructor ( ) ) { int parametersCount = Util . getParameterCount ( methodInfo . getMethodDescriptor ( ) ) ; if ( parameterAnnotations . length < parametersCount ) { AnnotationInfo [ ] [ ] temp = new AnnotationInfo [ parametersCount ] [ ] ; System . arraycopy ( parameterAnnotations , <NUM_LIT:0> , temp , <NUM_LIT:1> , parameterAnnotations . length ) ; this . parameterAnnotations = temp ; } else { this . parameterAnnotations = parameterAnnotations ; } } else { this . parameterAnnotations = parameterAnnotations ; } } public IBinaryAnnotation [ ] getParameterAnnotations ( int index ) { return this . parameterAnnotations [ index ] ; } public int getAnnotatedParametersCount ( ) { return this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , l = this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; i < l ; i ++ ) { AnnotationInfo [ ] infos = this . parameterAnnotations [ i ] ; for ( int j = <NUM_LIT:0> , k = infos == null ? <NUM_LIT:0> : infos . length ; j < k ; j ++ ) infos [ j ] . initialize ( ) ; } super . initialize ( ) ; } protected void reset ( ) { for ( int i = <NUM_LIT:0> , l = this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; i < l ; i ++ ) { AnnotationInfo [ ] infos = this . parameterAnnotations [ i ] ; for ( int j = <NUM_LIT:0> , k = infos == null ? <NUM_LIT:0> : infos . length ; j < k ; j ++ ) infos [ j ] . reset ( ) ; } super . reset ( ) ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; for ( int i = <NUM_LIT:0> , l = this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; i < l ; i ++ ) { buffer . append ( "<STR_LIT>" + ( i - <NUM_LIT:1> ) ) ; buffer . append ( '<STR_LIT:\n>' ) ; AnnotationInfo [ ] infos = this . parameterAnnotations [ i ] ; for ( int j = <NUM_LIT:0> , k = infos == null ? <NUM_LIT:0> : infos . length ; j < k ; j ++ ) { buffer . append ( infos [ j ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ElementValuePairInfo implements org . eclipse . jdt . internal . compiler . env . IBinaryElementValuePair { static final ElementValuePairInfo [ ] NoMembers = new ElementValuePairInfo [ <NUM_LIT:0> ] ; private char [ ] name ; private Object value ; ElementValuePairInfo ( char [ ] name , Object value ) { this . name = name ; this . value = value ; } public char [ ] getName ( ) { return this . name ; } public Object getValue ( ) { return this . value ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . name ) ; buffer . append ( '<CHAR_LIT:=>' ) ; if ( this . value instanceof Object [ ] ) { final Object [ ] values = ( Object [ ] ) this . value ; buffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , l = values . length ; i < l ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( values [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } else { buffer . append ( this . value ) ; } return buffer . toString ( ) ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + CharOperation . hashCode ( this . name ) ; result = prime * result + ( ( this . value == null ) ? <NUM_LIT:0> : this . value . hashCode ( ) ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ElementValuePairInfo other = ( ElementValuePairInfo ) obj ; if ( ! Arrays . equals ( this . name , other . name ) ) { return false ; } if ( this . value == null ) { if ( other . value != null ) { return false ; } } else if ( ! this . value . equals ( other . value ) ) { return false ; } return true ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; import java . io . ByteArrayInputStream ; import java . io . InputStreamReader ; import java . io . UnsupportedEncodingException ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . Compiler ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilerOptions { public static final String OPTION_LocalVariableAttribute = "<STR_LIT>" ; public static final String OPTION_LineNumberAttribute = "<STR_LIT>" ; public static final String OPTION_SourceFileAttribute = "<STR_LIT>" ; public static final String OPTION_PreserveUnusedLocal = "<STR_LIT>" ; public static final String OPTION_DocCommentSupport = "<STR_LIT>" ; public static final String OPTION_ReportMethodWithConstructorName = "<STR_LIT>" ; public static final String OPTION_ReportOverridingPackageDefaultMethod = "<STR_LIT>" ; public static final String OPTION_ReportDeprecation = "<STR_LIT>" ; public static final String OPTION_ReportDeprecationInDeprecatedCode = "<STR_LIT>" ; public static final String OPTION_ReportDeprecationWhenOverridingDeprecatedMethod = "<STR_LIT>" ; public static final String OPTION_ReportHiddenCatchBlock = "<STR_LIT>" ; public static final String OPTION_ReportUnusedLocal = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameter = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "<STR_LIT>" ; public static final String OPTION_ReportUnusedImport = "<STR_LIT>" ; public static final String OPTION_ReportSyntheticAccessEmulation = "<STR_LIT>" ; public static final String OPTION_ReportNoEffectAssignment = "<STR_LIT>" ; public static final String OPTION_ReportLocalVariableHiding = "<STR_LIT>" ; public static final String OPTION_ReportSpecialParameterHidingField = "<STR_LIT>" ; public static final String OPTION_ReportFieldHiding = "<STR_LIT>" ; public static final String OPTION_ReportTypeParameterHiding = "<STR_LIT>" ; public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "<STR_LIT>" ; public static final String OPTION_ReportNonExternalizedStringLiteral = "<STR_LIT>" ; public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "<STR_LIT>" ; public static final String OPTION_ReportUnusedPrivateMember = "<STR_LIT>" ; public static final String OPTION_ReportNoImplicitStringConversion = "<STR_LIT>" ; public static final String OPTION_ReportAssertIdentifier = "<STR_LIT>" ; public static final String OPTION_ReportEnumIdentifier = "<STR_LIT>" ; public static final String OPTION_ReportNonStaticAccessToStatic = "<STR_LIT>" ; public static final String OPTION_ReportIndirectStaticAccess = "<STR_LIT>" ; public static final String OPTION_ReportEmptyStatement = "<STR_LIT>" ; public static final String OPTION_ReportUnnecessaryTypeCheck = "<STR_LIT>" ; public static final String OPTION_ReportUnnecessaryElse = "<STR_LIT>" ; public static final String OPTION_ReportUndocumentedEmptyBlock = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadoc = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTags = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsDeprecatedRef = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsNotVisibleRef = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTags = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsOverriding = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsMethodTypeParameters = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocComments = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagDescription = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocCommentsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocCommentsOverriding = "<STR_LIT>" ; public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownException = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = "<STR_LIT>" ; public static final String OPTION_ReportUnqualifiedFieldAccess = "<STR_LIT>" ; public static final String OPTION_ReportUnavoidableGenericTypeProblems = "<STR_LIT>" ; public static final String OPTION_ReportUncheckedTypeOperation = "<STR_LIT>" ; public static final String OPTION_ReportRawTypeReference = "<STR_LIT>" ; public static final String OPTION_ReportFinalParameterBound = "<STR_LIT>" ; public static final String OPTION_ReportMissingSerialVersion = "<STR_LIT>" ; public static final String OPTION_ReportVarargsArgumentNeedCast = "<STR_LIT>" ; public static final String OPTION_ReportUnusedTypeArgumentsForMethodInvocation = "<STR_LIT>" ; public static final String OPTION_Source = "<STR_LIT>" ; public static final String OPTION_TargetPlatform = "<STR_LIT>" ; public static final String OPTION_Compliance = "<STR_LIT>" ; public static final String OPTION_Encoding = "<STR_LIT>" ; public static final String OPTION_MaxProblemPerUnit = "<STR_LIT>" ; public static final String OPTION_TaskTags = "<STR_LIT>" ; public static final String OPTION_TaskPriorities = "<STR_LIT>" ; public static final String OPTION_TaskCaseSensitive = "<STR_LIT>" ; public static final String OPTION_InlineJsr = "<STR_LIT>" ; public static final String OPTION_ReportNullReference = "<STR_LIT>" ; public static final String OPTION_ReportPotentialNullReference = "<STR_LIT>" ; public static final String OPTION_ReportRedundantNullCheck = "<STR_LIT>" ; public static final String OPTION_ReportAutoboxing = "<STR_LIT>" ; public static final String OPTION_ReportAnnotationSuperInterface = "<STR_LIT>" ; public static final String OPTION_ReportMissingOverrideAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation = "<STR_LIT>" ; public static final String OPTION_ReportMissingDeprecatedAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportIncompleteEnumSwitch = "<STR_LIT>" ; public static final String OPTION_ReportMissingEnumCaseDespiteDefault = "<STR_LIT>" ; public static final String OPTION_ReportMissingDefaultCase = "<STR_LIT>" ; public static final String OPTION_ReportForbiddenReference = "<STR_LIT>" ; public static final String OPTION_ReportDiscouragedReference = "<STR_LIT>" ; public static final String OPTION_SuppressWarnings = "<STR_LIT>" ; public static final String OPTION_SuppressOptionalErrors = "<STR_LIT>" ; public static final String OPTION_ReportUnhandledWarningToken = "<STR_LIT>" ; public static final String OPTION_ReportUnusedWarningToken = "<STR_LIT>" ; public static final String OPTION_ReportUnusedLabel = "<STR_LIT>" ; public static final String OPTION_FatalOptionalError = "<STR_LIT>" ; public static final String OPTION_ReportParameterAssignment = "<STR_LIT>" ; public static final String OPTION_ReportFallthroughCase = "<STR_LIT>" ; public static final String OPTION_ReportOverridingMethodWithoutSuperInvocation = "<STR_LIT>" ; public static final String OPTION_GenerateClassFiles = "<STR_LIT>" ; public static final String OPTION_Process_Annotations = "<STR_LIT>" ; public static final String OPTION_ReportRedundantSuperinterface = "<STR_LIT>" ; public static final String OPTION_ReportComparingIdentical = "<STR_LIT>" ; public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "<STR_LIT>" ; public static final String OPTION_ReportMissingHashCodeMethod = "<STR_LIT>" ; public static final String OPTION_ReportDeadCode = "<STR_LIT>" ; public static final String OPTION_ReportDeadCodeInTrivialIfStatement = "<STR_LIT>" ; public static final String OPTION_ReportTasks = "<STR_LIT>" ; public static final String OPTION_ReportUnusedObjectAllocation = "<STR_LIT>" ; public static final String OPTION_IncludeNullInfoFromAsserts = "<STR_LIT>" ; public static final String OPTION_ReportMethodCanBeStatic = "<STR_LIT>" ; public static final String OPTION_ReportMethodCanBePotentiallyStatic = "<STR_LIT>" ; public static final String OPTION_ReportRedundantSpecificationOfTypeArguments = "<STR_LIT>" ; public static final String OPTION_ReportUnclosedCloseable = "<STR_LIT>" ; public static final String OPTION_ReportPotentiallyUnclosedCloseable = "<STR_LIT>" ; public static final String OPTION_ReportExplicitlyClosedAutoCloseable = "<STR_LIT>" ; public static final String OPTION_ReportNullSpecViolation = "<STR_LIT>" ; public static final String OPTION_ReportNullAnnotationInferenceConflict = "<STR_LIT>" ; public static final String OPTION_ReportNullUncheckedConversion = "<STR_LIT>" ; public static final String OPTION_ReportRedundantNullAnnotation = "<STR_LIT>" ; public static final String OPTION_AnnotationBasedNullAnalysis = "<STR_LIT>" ; public static final String OPTION_NullableAnnotationName = "<STR_LIT>" ; public static final String OPTION_NonNullAnnotationName = "<STR_LIT>" ; public static final String OPTION_NonNullByDefaultAnnotationName = "<STR_LIT>" ; static final char [ ] [ ] DEFAULT_NULLABLE_ANNOTATION_NAME = CharOperation . splitOn ( '<CHAR_LIT:.>' , "<STR_LIT>" . toCharArray ( ) ) ; static final char [ ] [ ] DEFAULT_NONNULL_ANNOTATION_NAME = CharOperation . splitOn ( '<CHAR_LIT:.>' , "<STR_LIT>" . toCharArray ( ) ) ; static final char [ ] [ ] DEFAULT_NONNULLBYDEFAULT_ANNOTATION_NAME = CharOperation . splitOn ( '<CHAR_LIT:.>' , "<STR_LIT>" . toCharArray ( ) ) ; public static final String OPTION_ReportMissingNonNullByDefaultAnnotation = "<STR_LIT>" ; public static final String OPTIONG_BuildGroovyFiles = "<STR_LIT>" ; public static final String OPTIONG_GroovyFlags = "<STR_LIT>" ; public static final String OPTIONG_GroovyClassLoaderPath = "<STR_LIT>" ; public static final String OPTIONG_GroovyProjectName = "<STR_LIT>" ; public static final String OPTIONG_GroovyExtraImports = "<STR_LIT>" ; public static final String OPTIONG_GroovyTransformsToRunOnReconcile = "<STR_LIT>" ; public static final String GENERATE = "<STR_LIT>" ; public static final String DO_NOT_GENERATE = "<STR_LIT>" ; public static final String PRESERVE = "<STR_LIT>" ; public static final String OPTIMIZE_OUT = "<STR_LIT>" ; public static final String VERSION_1_1 = "<STR_LIT>" ; public static final String VERSION_1_2 = "<STR_LIT>" ; public static final String VERSION_1_3 = "<STR_LIT>" ; public static final String VERSION_1_4 = "<STR_LIT>" ; public static final String VERSION_JSR14 = "<STR_LIT>" ; public static final String VERSION_CLDC1_1 = "<STR_LIT>" ; public static final String VERSION_1_5 = "<STR_LIT>" ; public static final String VERSION_1_6 = "<STR_LIT>" ; public static final String VERSION_1_7 = "<STR_LIT>" ; public static final String ERROR = "<STR_LIT:error>" ; public static final String WARNING = "<STR_LIT>" ; public static final String IGNORE = "<STR_LIT>" ; public static final String ENABLED = "<STR_LIT>" ; public static final String DISABLED = "<STR_LIT>" ; public static final String PUBLIC = "<STR_LIT>" ; public static final String PROTECTED = "<STR_LIT>" ; public static final String DEFAULT = "<STR_LIT:default>" ; public static final String PRIVATE = "<STR_LIT>" ; public static final String RETURN_TAG = "<STR_LIT>" ; public static final String NO_TAG = "<STR_LIT>" ; public static final String ALL_STANDARD_TAGS = "<STR_LIT>" ; public static final int MethodWithConstructorName = IrritantSet . GROUP0 | ASTNode . Bit1 ; public static final int OverriddenPackageDefaultMethod = IrritantSet . GROUP0 | ASTNode . Bit2 ; public static final int UsingDeprecatedAPI = IrritantSet . GROUP0 | ASTNode . Bit3 ; public static final int MaskedCatchBlock = IrritantSet . GROUP0 | ASTNode . Bit4 ; public static final int UnusedLocalVariable = IrritantSet . GROUP0 | ASTNode . Bit5 ; public static final int UnusedArgument = IrritantSet . GROUP0 | ASTNode . Bit6 ; public static final int NoImplicitStringConversion = IrritantSet . GROUP0 | ASTNode . Bit7 ; public static final int AccessEmulation = IrritantSet . GROUP0 | ASTNode . Bit8 ; public static final int NonExternalizedString = IrritantSet . GROUP0 | ASTNode . Bit9 ; public static final int AssertUsedAsAnIdentifier = IrritantSet . GROUP0 | ASTNode . Bit10 ; public static final int UnusedImport = IrritantSet . GROUP0 | ASTNode . Bit11 ; public static final int NonStaticAccessToStatic = IrritantSet . GROUP0 | ASTNode . Bit12 ; public static final int Task = IrritantSet . GROUP0 | ASTNode . Bit13 ; public static final int NoEffectAssignment = IrritantSet . GROUP0 | ASTNode . Bit14 ; public static final int IncompatibleNonInheritedInterfaceMethod = IrritantSet . GROUP0 | ASTNode . Bit15 ; public static final int UnusedPrivateMember = IrritantSet . GROUP0 | ASTNode . Bit16 ; public static final int LocalVariableHiding = IrritantSet . GROUP0 | ASTNode . Bit17 ; public static final int FieldHiding = IrritantSet . GROUP0 | ASTNode . Bit18 ; public static final int AccidentalBooleanAssign = IrritantSet . GROUP0 | ASTNode . Bit19 ; public static final int EmptyStatement = IrritantSet . GROUP0 | ASTNode . Bit20 ; public static final int MissingJavadocComments = IrritantSet . GROUP0 | ASTNode . Bit21 ; public static final int MissingJavadocTags = IrritantSet . GROUP0 | ASTNode . Bit22 ; public static final int UnqualifiedFieldAccess = IrritantSet . GROUP0 | ASTNode . Bit23 ; public static final int UnusedDeclaredThrownException = IrritantSet . GROUP0 | ASTNode . Bit24 ; public static final int FinallyBlockNotCompleting = IrritantSet . GROUP0 | ASTNode . Bit25 ; public static final int InvalidJavadoc = IrritantSet . GROUP0 | ASTNode . Bit26 ; public static final int UnnecessaryTypeCheck = IrritantSet . GROUP0 | ASTNode . Bit27 ; public static final int UndocumentedEmptyBlock = IrritantSet . GROUP0 | ASTNode . Bit28 ; public static final int IndirectStaticAccess = IrritantSet . GROUP0 | ASTNode . Bit29 ; public static final int UnnecessaryElse = IrritantSet . GROUP1 | ASTNode . Bit1 ; public static final int UncheckedTypeOperation = IrritantSet . GROUP1 | ASTNode . Bit2 ; public static final int FinalParameterBound = IrritantSet . GROUP1 | ASTNode . Bit3 ; public static final int MissingSerialVersion = IrritantSet . GROUP1 | ASTNode . Bit4 ; public static final int EnumUsedAsAnIdentifier = IrritantSet . GROUP1 | ASTNode . Bit5 ; public static final int ForbiddenReference = IrritantSet . GROUP1 | ASTNode . Bit6 ; public static final int VarargsArgumentNeedCast = IrritantSet . GROUP1 | ASTNode . Bit7 ; public static final int NullReference = IrritantSet . GROUP1 | ASTNode . Bit8 ; public static final int AutoBoxing = IrritantSet . GROUP1 | ASTNode . Bit9 ; public static final int AnnotationSuperInterface = IrritantSet . GROUP1 | ASTNode . Bit10 ; public static final int TypeHiding = IrritantSet . GROUP1 | ASTNode . Bit11 ; public static final int MissingOverrideAnnotation = IrritantSet . GROUP1 | ASTNode . Bit12 ; public static final int MissingEnumConstantCase = IrritantSet . GROUP1 | ASTNode . Bit13 ; public static final int MissingDeprecatedAnnotation = IrritantSet . GROUP1 | ASTNode . Bit14 ; public static final int DiscouragedReference = IrritantSet . GROUP1 | ASTNode . Bit15 ; public static final int UnhandledWarningToken = IrritantSet . GROUP1 | ASTNode . Bit16 ; public static final int RawTypeReference = IrritantSet . GROUP1 | ASTNode . Bit17 ; public static final int UnusedLabel = IrritantSet . GROUP1 | ASTNode . Bit18 ; public static final int ParameterAssignment = IrritantSet . GROUP1 | ASTNode . Bit19 ; public static final int FallthroughCase = IrritantSet . GROUP1 | ASTNode . Bit20 ; public static final int OverridingMethodWithoutSuperInvocation = IrritantSet . GROUP1 | ASTNode . Bit21 ; public static final int PotentialNullReference = IrritantSet . GROUP1 | ASTNode . Bit22 ; public static final int RedundantNullCheck = IrritantSet . GROUP1 | ASTNode . Bit23 ; public static final int MissingJavadocTagDescription = IrritantSet . GROUP1 | ASTNode . Bit24 ; public static final int UnusedTypeArguments = IrritantSet . GROUP1 | ASTNode . Bit25 ; public static final int UnusedWarningToken = IrritantSet . GROUP1 | ASTNode . Bit26 ; public static final int RedundantSuperinterface = IrritantSet . GROUP1 | ASTNode . Bit27 ; public static final int ComparingIdentical = IrritantSet . GROUP1 | ASTNode . Bit28 ; public static final int MissingSynchronizedModifierInInheritedMethod = IrritantSet . GROUP1 | ASTNode . Bit29 ; public static final int ShouldImplementHashcode = IrritantSet . GROUP2 | ASTNode . Bit1 ; public static final int DeadCode = IrritantSet . GROUP2 | ASTNode . Bit2 ; public static final int Tasks = IrritantSet . GROUP2 | ASTNode . Bit3 ; public static final int UnusedObjectAllocation = IrritantSet . GROUP2 | ASTNode . Bit4 ; public static final int MethodCanBeStatic = IrritantSet . GROUP2 | ASTNode . Bit5 ; public static final int MethodCanBePotentiallyStatic = IrritantSet . GROUP2 | ASTNode . Bit6 ; public static final int RedundantSpecificationOfTypeArguments = IrritantSet . GROUP2 | ASTNode . Bit7 ; public static final int UnclosedCloseable = IrritantSet . GROUP2 | ASTNode . Bit8 ; public static final int PotentiallyUnclosedCloseable = IrritantSet . GROUP2 | ASTNode . Bit9 ; public static final int ExplicitlyClosedAutoCloseable = IrritantSet . GROUP2 | ASTNode . Bit10 ; public static final int NullSpecViolation = IrritantSet . GROUP2 | ASTNode . Bit11 ; public static final int NullAnnotationInferenceConflict = IrritantSet . GROUP2 | ASTNode . Bit12 ; public static final int NullUncheckedConversion = IrritantSet . GROUP2 | ASTNode . Bit13 ; public static final int RedundantNullAnnotation = IrritantSet . GROUP2 | ASTNode . Bit14 ; public static final int MissingNonNullByDefaultAnnotation = IrritantSet . GROUP2 | ASTNode . Bit15 ; public static final int MissingDefaultCase = IrritantSet . GROUP2 | ASTNode . Bit16 ; protected IrritantSet errorThreshold ; protected IrritantSet warningThreshold ; public int produceDebugAttributes ; public long complianceLevel ; public long originalComplianceLevel ; public long sourceLevel ; public long originalSourceLevel ; public long targetJDK ; public String defaultEncoding ; public boolean verbose ; public boolean produceReferenceInfo ; public boolean preserveAllLocalVariables ; public boolean parseLiteralExpressionsAsConstants ; public int maxProblemsPerUnit ; public char [ ] [ ] taskTags ; public char [ ] [ ] taskPriorities ; public boolean isTaskCaseSensitive ; public boolean reportDeprecationInsideDeprecatedCode ; public boolean reportDeprecationWhenOverridingDeprecatedMethod ; public boolean reportUnusedParameterWhenImplementingAbstract ; public boolean reportUnusedParameterWhenOverridingConcrete ; public boolean reportUnusedParameterIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionWhenOverriding ; public boolean reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ; public boolean reportSpecialParameterHidingField ; public boolean reportDeadCodeInTrivialIfStatement ; public boolean docCommentSupport ; public boolean reportInvalidJavadocTags ; public int reportInvalidJavadocTagsVisibility ; public boolean reportInvalidJavadocTagsDeprecatedRef ; public boolean reportInvalidJavadocTagsNotVisibleRef ; public String reportMissingJavadocTagDescription ; public int reportMissingJavadocTagsVisibility ; public boolean reportMissingJavadocTagsOverriding ; public boolean reportMissingJavadocTagsMethodTypeParameters ; public int reportMissingJavadocCommentsVisibility ; public boolean reportMissingJavadocCommentsOverriding ; public boolean inlineJsrBytecode ; public boolean suppressWarnings ; public boolean suppressOptionalErrors ; public boolean treatOptionalErrorAsFatal ; public boolean performMethodsFullRecovery ; public boolean performStatementsRecovery ; public boolean processAnnotations ; public boolean storeAnnotations ; public boolean reportMissingOverrideAnnotationForInterfaceMethodImplementation ; public boolean generateClassFiles ; public boolean ignoreMethodBodies ; public boolean includeNullInfoFromAsserts ; public boolean reportUnavoidableGenericTypeProblems ; public boolean ignoreSourceFolderWarningOption ; public int buildGroovyFiles = <NUM_LIT:0> ; public int groovyFlags = <NUM_LIT:0> ; public String groovyClassLoaderPath = null ; public String groovyExtraImports = null ; public String groovyProjectName = null ; public String groovyTransformsToRunOnReconcile = null ; public boolean isAnnotationBasedNullAnalysisEnabled ; public char [ ] [ ] nullableAnnotationName ; public char [ ] [ ] nonNullAnnotationName ; public char [ ] [ ] nonNullByDefaultAnnotationName ; public long intendedDefaultNonNullness ; public boolean analyseResourceLeaks ; public boolean reportMissingEnumCaseDespiteDefault ; public static boolean tolerateIllegalAmbiguousVarargsInvocation ; { String tolerateIllegalAmbiguousVarargs = System . getProperty ( "<STR_LIT>" ) ; tolerateIllegalAmbiguousVarargsInvocation = tolerateIllegalAmbiguousVarargs != null && tolerateIllegalAmbiguousVarargs . equalsIgnoreCase ( "<STR_LIT:true>" ) ; } public final static String [ ] warningTokens = { "<STR_LIT:all>" , "<STR_LIT>" , "<STR_LIT:cast>" , "<STR_LIT>" , "<STR_LIT:deprecation>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:null>" , "<STR_LIT:rawtypes>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:serial>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:unchecked>" , "<STR_LIT>" , "<STR_LIT:unused>" , } ; public CompilerOptions ( ) { this ( null ) ; } public CompilerOptions ( Map settings ) { resetDefaults ( ) ; if ( settings != null ) { set ( settings ) ; } } public CompilerOptions ( Map settings , boolean parseLiteralExpressionsAsConstants ) { this ( settings ) ; this . parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants ; } public static String optionKeyFromIrritant ( int irritant ) { switch ( irritant ) { case MethodWithConstructorName : return OPTION_ReportMethodWithConstructorName ; case OverriddenPackageDefaultMethod : return OPTION_ReportOverridingPackageDefaultMethod ; case UsingDeprecatedAPI : case ( InvalidJavadoc | UsingDeprecatedAPI ) : return OPTION_ReportDeprecation ; case MaskedCatchBlock : return OPTION_ReportHiddenCatchBlock ; case UnusedLocalVariable : return OPTION_ReportUnusedLocal ; case UnusedArgument : return OPTION_ReportUnusedParameter ; case NoImplicitStringConversion : return OPTION_ReportNoImplicitStringConversion ; case AccessEmulation : return OPTION_ReportSyntheticAccessEmulation ; case NonExternalizedString : return OPTION_ReportNonExternalizedStringLiteral ; case AssertUsedAsAnIdentifier : return OPTION_ReportAssertIdentifier ; case UnusedImport : return OPTION_ReportUnusedImport ; case NonStaticAccessToStatic : return OPTION_ReportNonStaticAccessToStatic ; case Task : return OPTION_TaskTags ; case NoEffectAssignment : return OPTION_ReportNoEffectAssignment ; case IncompatibleNonInheritedInterfaceMethod : return OPTION_ReportIncompatibleNonInheritedInterfaceMethod ; case UnusedPrivateMember : return OPTION_ReportUnusedPrivateMember ; case LocalVariableHiding : return OPTION_ReportLocalVariableHiding ; case FieldHiding : return OPTION_ReportFieldHiding ; case AccidentalBooleanAssign : return OPTION_ReportPossibleAccidentalBooleanAssignment ; case EmptyStatement : return OPTION_ReportEmptyStatement ; case MissingJavadocComments : return OPTION_ReportMissingJavadocComments ; case MissingJavadocTags : return OPTION_ReportMissingJavadocTags ; case UnqualifiedFieldAccess : return OPTION_ReportUnqualifiedFieldAccess ; case UnusedDeclaredThrownException : return OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ; case FinallyBlockNotCompleting : return OPTION_ReportFinallyBlockNotCompletingNormally ; case InvalidJavadoc : return OPTION_ReportInvalidJavadoc ; case UnnecessaryTypeCheck : return OPTION_ReportUnnecessaryTypeCheck ; case UndocumentedEmptyBlock : return OPTION_ReportUndocumentedEmptyBlock ; case IndirectStaticAccess : return OPTION_ReportIndirectStaticAccess ; case UnnecessaryElse : return OPTION_ReportUnnecessaryElse ; case UncheckedTypeOperation : return OPTION_ReportUncheckedTypeOperation ; case FinalParameterBound : return OPTION_ReportFinalParameterBound ; case MissingSerialVersion : return OPTION_ReportMissingSerialVersion ; case EnumUsedAsAnIdentifier : return OPTION_ReportEnumIdentifier ; case ForbiddenReference : return OPTION_ReportForbiddenReference ; case VarargsArgumentNeedCast : return OPTION_ReportVarargsArgumentNeedCast ; case NullReference : return OPTION_ReportNullReference ; case PotentialNullReference : return OPTION_ReportPotentialNullReference ; case RedundantNullCheck : return OPTION_ReportRedundantNullCheck ; case AutoBoxing : return OPTION_ReportAutoboxing ; case AnnotationSuperInterface : return OPTION_ReportAnnotationSuperInterface ; case TypeHiding : return OPTION_ReportTypeParameterHiding ; case MissingOverrideAnnotation : return OPTION_ReportMissingOverrideAnnotation ; case MissingEnumConstantCase : return OPTION_ReportIncompleteEnumSwitch ; case MissingDefaultCase : return OPTION_ReportMissingDefaultCase ; case MissingDeprecatedAnnotation : return OPTION_ReportMissingDeprecatedAnnotation ; case DiscouragedReference : return OPTION_ReportDiscouragedReference ; case UnhandledWarningToken : return OPTION_ReportUnhandledWarningToken ; case RawTypeReference : return OPTION_ReportRawTypeReference ; case UnusedLabel : return OPTION_ReportUnusedLabel ; case ParameterAssignment : return OPTION_ReportParameterAssignment ; case FallthroughCase : return OPTION_ReportFallthroughCase ; case OverridingMethodWithoutSuperInvocation : return OPTION_ReportOverridingMethodWithoutSuperInvocation ; case MissingJavadocTagDescription : return OPTION_ReportMissingJavadocTagDescription ; case UnusedTypeArguments : return OPTION_ReportUnusedTypeArgumentsForMethodInvocation ; case UnusedWarningToken : return OPTION_ReportUnusedWarningToken ; case RedundantSuperinterface : return OPTION_ReportRedundantSuperinterface ; case ComparingIdentical : return OPTION_ReportComparingIdentical ; case MissingSynchronizedModifierInInheritedMethod : return OPTION_ReportMissingSynchronizedOnInheritedMethod ; case ShouldImplementHashcode : return OPTION_ReportMissingHashCodeMethod ; case DeadCode : return OPTION_ReportDeadCode ; case UnusedObjectAllocation : return OPTION_ReportUnusedObjectAllocation ; case MethodCanBeStatic : return OPTION_ReportMethodCanBeStatic ; case MethodCanBePotentiallyStatic : return OPTION_ReportMethodCanBePotentiallyStatic ; case MissingNonNullByDefaultAnnotation : return OPTION_ReportMissingNonNullByDefaultAnnotation ; case RedundantSpecificationOfTypeArguments : return OPTION_ReportRedundantSpecificationOfTypeArguments ; case UnclosedCloseable : return OPTION_ReportUnclosedCloseable ; case PotentiallyUnclosedCloseable : return OPTION_ReportPotentiallyUnclosedCloseable ; case ExplicitlyClosedAutoCloseable : return OPTION_ReportExplicitlyClosedAutoCloseable ; case NullSpecViolation : return OPTION_ReportNullSpecViolation ; case NullAnnotationInferenceConflict : return OPTION_ReportNullAnnotationInferenceConflict ; case NullUncheckedConversion : return OPTION_ReportNullUncheckedConversion ; case RedundantNullAnnotation : return OPTION_ReportRedundantNullAnnotation ; } return null ; } public static String versionFromJdkLevel ( long jdkLevel ) { switch ( ( int ) ( jdkLevel > > <NUM_LIT:16> ) ) { case ClassFileConstants . MAJOR_VERSION_1_1 : if ( jdkLevel == ClassFileConstants . JDK1_1 ) return VERSION_1_1 ; break ; case ClassFileConstants . MAJOR_VERSION_1_2 : if ( jdkLevel == ClassFileConstants . JDK1_2 ) return VERSION_1_2 ; break ; case ClassFileConstants . MAJOR_VERSION_1_3 : if ( jdkLevel == ClassFileConstants . JDK1_3 ) return VERSION_1_3 ; break ; case ClassFileConstants . MAJOR_VERSION_1_4 : if ( jdkLevel == ClassFileConstants . JDK1_4 ) return VERSION_1_4 ; break ; case ClassFileConstants . MAJOR_VERSION_1_5 : if ( jdkLevel == ClassFileConstants . JDK1_5 ) return VERSION_1_5 ; break ; case ClassFileConstants . MAJOR_VERSION_1_6 : if ( jdkLevel == ClassFileConstants . JDK1_6 ) return VERSION_1_6 ; break ; case ClassFileConstants . MAJOR_VERSION_1_7 : if ( jdkLevel == ClassFileConstants . JDK1_7 ) return VERSION_1_7 ; break ; } return Util . EMPTY_STRING ; } public static long versionToJdkLevel ( Object versionID ) { if ( versionID instanceof String ) { String version = ( String ) versionID ; if ( version . length ( ) == <NUM_LIT:3> && version . charAt ( <NUM_LIT:0> ) == '<CHAR_LIT:1>' && version . charAt ( <NUM_LIT:1> ) == '<CHAR_LIT:.>' ) { switch ( version . charAt ( <NUM_LIT:2> ) ) { case '<CHAR_LIT:1>' : return ClassFileConstants . JDK1_1 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_2 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_3 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_4 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_5 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_6 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_7 ; default : return <NUM_LIT:0> ; } } if ( VERSION_JSR14 . equals ( versionID ) ) { return ClassFileConstants . JDK1_4 ; } if ( VERSION_CLDC1_1 . equals ( versionID ) ) { return ClassFileConstants . CLDC_1_1 ; } } return <NUM_LIT:0> ; } public static String [ ] warningOptionNames ( ) { String [ ] result = { OPTION_ReportAnnotationSuperInterface , OPTION_ReportAssertIdentifier , OPTION_ReportAutoboxing , OPTION_ReportComparingIdentical , OPTION_ReportDeadCode , OPTION_ReportDeadCodeInTrivialIfStatement , OPTION_ReportDeprecation , OPTION_ReportDeprecationInDeprecatedCode , OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , OPTION_ReportDiscouragedReference , OPTION_ReportEmptyStatement , OPTION_ReportEnumIdentifier , OPTION_ReportFallthroughCase , OPTION_ReportFieldHiding , OPTION_ReportFinallyBlockNotCompletingNormally , OPTION_ReportFinalParameterBound , OPTION_ReportForbiddenReference , OPTION_ReportHiddenCatchBlock , OPTION_ReportIncompatibleNonInheritedInterfaceMethod , OPTION_ReportMissingDefaultCase , OPTION_ReportIncompleteEnumSwitch , OPTION_ReportMissingEnumCaseDespiteDefault , OPTION_ReportIndirectStaticAccess , OPTION_ReportInvalidJavadoc , OPTION_ReportInvalidJavadocTags , OPTION_ReportInvalidJavadocTagsDeprecatedRef , OPTION_ReportInvalidJavadocTagsNotVisibleRef , OPTION_ReportInvalidJavadocTagsVisibility , OPTION_ReportLocalVariableHiding , OPTION_ReportMethodCanBePotentiallyStatic , OPTION_ReportMethodCanBeStatic , OPTION_ReportMethodWithConstructorName , OPTION_ReportMissingDeprecatedAnnotation , OPTION_ReportMissingHashCodeMethod , OPTION_ReportMissingJavadocComments , OPTION_ReportMissingJavadocCommentsOverriding , OPTION_ReportMissingJavadocCommentsVisibility , OPTION_ReportMissingJavadocTagDescription , OPTION_ReportMissingJavadocTags , OPTION_ReportMissingJavadocTagsMethodTypeParameters , OPTION_ReportMissingJavadocTagsOverriding , OPTION_ReportMissingJavadocTagsVisibility , OPTION_ReportMissingOverrideAnnotation , OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , OPTION_ReportMissingSerialVersion , OPTION_ReportMissingSynchronizedOnInheritedMethod , OPTION_ReportNoEffectAssignment , OPTION_ReportNoImplicitStringConversion , OPTION_ReportNonExternalizedStringLiteral , OPTION_ReportNonStaticAccessToStatic , OPTION_ReportNullReference , OPTION_ReportOverridingMethodWithoutSuperInvocation , OPTION_ReportOverridingPackageDefaultMethod , OPTION_ReportParameterAssignment , OPTION_ReportPossibleAccidentalBooleanAssignment , OPTION_ReportPotentialNullReference , OPTION_ReportRawTypeReference , OPTION_ReportRedundantNullCheck , OPTION_ReportRedundantSuperinterface , OPTION_ReportRedundantSpecificationOfTypeArguments , OPTION_ReportSpecialParameterHidingField , OPTION_ReportSyntheticAccessEmulation , OPTION_ReportTasks , OPTION_ReportTypeParameterHiding , OPTION_ReportUnavoidableGenericTypeProblems , OPTION_ReportUncheckedTypeOperation , OPTION_ReportUndocumentedEmptyBlock , OPTION_ReportUnhandledWarningToken , OPTION_ReportUnnecessaryElse , OPTION_ReportUnnecessaryTypeCheck , OPTION_ReportUnqualifiedFieldAccess , OPTION_ReportUnusedDeclaredThrownException , OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , OPTION_ReportUnusedImport , OPTION_ReportUnusedLabel , OPTION_ReportUnusedLocal , OPTION_ReportUnusedObjectAllocation , OPTION_ReportUnusedParameter , OPTION_ReportUnusedParameterIncludeDocCommentReference , OPTION_ReportUnusedParameterWhenImplementingAbstract , OPTION_ReportUnusedParameterWhenOverridingConcrete , OPTION_ReportUnusedPrivateMember , OPTION_ReportUnusedTypeArgumentsForMethodInvocation , OPTION_ReportUnusedWarningToken , OPTION_ReportVarargsArgumentNeedCast , OPTION_ReportUnclosedCloseable , OPTION_ReportPotentiallyUnclosedCloseable , OPTION_ReportExplicitlyClosedAutoCloseable , OPTION_AnnotationBasedNullAnalysis , OPTION_NonNullAnnotationName , OPTION_NullableAnnotationName , OPTION_NonNullByDefaultAnnotationName , OPTION_ReportMissingNonNullByDefaultAnnotation , OPTION_ReportNullSpecViolation , OPTION_ReportNullAnnotationInferenceConflict , OPTION_ReportNullUncheckedConversion , OPTION_ReportRedundantNullAnnotation } ; return result ; } public static String warningTokenFromIrritant ( int irritant ) { switch ( irritant ) { case ( InvalidJavadoc | UsingDeprecatedAPI ) : case UsingDeprecatedAPI : return "<STR_LIT:deprecation>" ; case FinallyBlockNotCompleting : return "<STR_LIT>" ; case FieldHiding : case LocalVariableHiding : case MaskedCatchBlock : return "<STR_LIT>" ; case NonExternalizedString : return "<STR_LIT>" ; case UnnecessaryTypeCheck : return "<STR_LIT:cast>" ; case IndirectStaticAccess : case NonStaticAccessToStatic : return "<STR_LIT>" ; case AccessEmulation : return "<STR_LIT>" ; case UnqualifiedFieldAccess : return "<STR_LIT>" ; case UncheckedTypeOperation : return "<STR_LIT:unchecked>" ; case MissingSerialVersion : return "<STR_LIT:serial>" ; case AutoBoxing : return "<STR_LIT>" ; case TypeHiding : return "<STR_LIT>" ; case MissingEnumConstantCase : case MissingDefaultCase : return "<STR_LIT>" ; case MissingDeprecatedAnnotation : return "<STR_LIT>" ; case RawTypeReference : return "<STR_LIT:rawtypes>" ; case UnusedLabel : case UnusedTypeArguments : case RedundantSuperinterface : case UnusedLocalVariable : case UnusedArgument : case UnusedImport : case UnusedPrivateMember : case UnusedDeclaredThrownException : case DeadCode : case UnusedObjectAllocation : case RedundantSpecificationOfTypeArguments : return "<STR_LIT:unused>" ; case DiscouragedReference : case ForbiddenReference : return "<STR_LIT>" ; case NullReference : case PotentialNullReference : case RedundantNullCheck : case NullSpecViolation : case NullAnnotationInferenceConflict : case NullUncheckedConversion : case RedundantNullAnnotation : case MissingNonNullByDefaultAnnotation : return "<STR_LIT:null>" ; case FallthroughCase : return "<STR_LIT>" ; case OverridingMethodWithoutSuperInvocation : return "<STR_LIT>" ; case MethodCanBeStatic : case MethodCanBePotentiallyStatic : return "<STR_LIT>" ; case PotentiallyUnclosedCloseable : case UnclosedCloseable : case ExplicitlyClosedAutoCloseable : return "<STR_LIT>" ; case InvalidJavadoc : case MissingJavadocComments : case MissingJavadocTags : return "<STR_LIT>" ; case MissingSynchronizedModifierInInheritedMethod : return "<STR_LIT>" ; } return null ; } public static IrritantSet warningTokenToIrritants ( String warningToken ) { if ( warningToken == null || warningToken . length ( ) == <NUM_LIT:0> ) return null ; switch ( warningToken . charAt ( <NUM_LIT:0> ) ) { case '<CHAR_LIT:a>' : if ( "<STR_LIT:all>" . equals ( warningToken ) ) return IrritantSet . ALL ; break ; case '<CHAR_LIT:b>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . BOXING ; break ; case '<CHAR_LIT:c>' : if ( "<STR_LIT:cast>" . equals ( warningToken ) ) return IrritantSet . CAST ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:deprecation>" . equals ( warningToken ) ) return IrritantSet . DEPRECATION ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . DEP_ANN ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . FALLTHROUGH ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . FINALLY ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . HIDING ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . INCOMPLETE_SWITCH ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . JAVADOC ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . NLS ; if ( "<STR_LIT:null>" . equals ( warningToken ) ) return IrritantSet . NULL ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:rawtypes>" . equals ( warningToken ) ) return IrritantSet . RAW ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . RESOURCE ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . RESTRICTION ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:serial>" . equals ( warningToken ) ) return IrritantSet . SERIAL ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . STATIC_ACCESS ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . STATIC_METHOD ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . SYNTHETIC_ACCESS ; if ( "<STR_LIT>" . equals ( warningToken ) ) { return IrritantSet . SUPER ; } if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . SYNCHRONIZED ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:unused>" . equals ( warningToken ) ) return IrritantSet . UNUSED ; if ( "<STR_LIT:unchecked>" . equals ( warningToken ) ) return IrritantSet . UNCHECKED ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . UNQUALIFIED_FIELD_ACCESS ; break ; } return null ; } public Map getMap ( ) { Map optionsMap = new HashMap ( <NUM_LIT:30> ) ; optionsMap . put ( OPTION_LocalVariableAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_LineNumberAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_SourceFileAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_PreserveUnusedLocal , this . preserveAllLocalVariables ? PRESERVE : OPTIMIZE_OUT ) ; optionsMap . put ( OPTION_DocCommentSupport , this . docCommentSupport ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodWithConstructorName , getSeverityString ( MethodWithConstructorName ) ) ; optionsMap . put ( OPTION_ReportOverridingPackageDefaultMethod , getSeverityString ( OverriddenPackageDefaultMethod ) ) ; optionsMap . put ( OPTION_ReportDeprecation , getSeverityString ( UsingDeprecatedAPI ) ) ; optionsMap . put ( OPTION_ReportDeprecationInDeprecatedCode , this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportHiddenCatchBlock , getSeverityString ( MaskedCatchBlock ) ) ; optionsMap . put ( OPTION_ReportUnusedLocal , getSeverityString ( UnusedLocalVariable ) ) ; optionsMap . put ( OPTION_ReportUnusedParameter , getSeverityString ( UnusedArgument ) ) ; optionsMap . put ( OPTION_ReportUnusedImport , getSeverityString ( UnusedImport ) ) ; optionsMap . put ( OPTION_ReportSyntheticAccessEmulation , getSeverityString ( AccessEmulation ) ) ; optionsMap . put ( OPTION_ReportNoEffectAssignment , getSeverityString ( NoEffectAssignment ) ) ; optionsMap . put ( OPTION_ReportNonExternalizedStringLiteral , getSeverityString ( NonExternalizedString ) ) ; optionsMap . put ( OPTION_ReportNoImplicitStringConversion , getSeverityString ( NoImplicitStringConversion ) ) ; optionsMap . put ( OPTION_ReportNonStaticAccessToStatic , getSeverityString ( NonStaticAccessToStatic ) ) ; optionsMap . put ( OPTION_ReportIndirectStaticAccess , getSeverityString ( IndirectStaticAccess ) ) ; optionsMap . put ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod , getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; optionsMap . put ( OPTION_ReportUnusedPrivateMember , getSeverityString ( UnusedPrivateMember ) ) ; optionsMap . put ( OPTION_ReportLocalVariableHiding , getSeverityString ( LocalVariableHiding ) ) ; optionsMap . put ( OPTION_ReportFieldHiding , getSeverityString ( FieldHiding ) ) ; optionsMap . put ( OPTION_ReportTypeParameterHiding , getSeverityString ( TypeHiding ) ) ; optionsMap . put ( OPTION_ReportPossibleAccidentalBooleanAssignment , getSeverityString ( AccidentalBooleanAssign ) ) ; optionsMap . put ( OPTION_ReportEmptyStatement , getSeverityString ( EmptyStatement ) ) ; optionsMap . put ( OPTION_ReportAssertIdentifier , getSeverityString ( AssertUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportEnumIdentifier , getSeverityString ( EnumUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportUndocumentedEmptyBlock , getSeverityString ( UndocumentedEmptyBlock ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryTypeCheck , getSeverityString ( UnnecessaryTypeCheck ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryElse , getSeverityString ( UnnecessaryElse ) ) ; optionsMap . put ( OPTION_ReportAutoboxing , getSeverityString ( AutoBoxing ) ) ; optionsMap . put ( OPTION_ReportAnnotationSuperInterface , getSeverityString ( AnnotationSuperInterface ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( MissingEnumConstantCase ) ) ; optionsMap . put ( OPTION_ReportMissingEnumCaseDespiteDefault , this . reportMissingEnumCaseDespiteDefault ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingDefaultCase , getSeverityString ( MissingDefaultCase ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadoc , getSeverityString ( InvalidJavadoc ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsVisibility , getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTags , this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsDeprecatedRef , this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsNotVisibleRef , this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTags , getSeverityString ( MissingJavadocTags ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsVisibility , getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsOverriding , this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsMethodTypeParameters , this . reportMissingJavadocTagsMethodTypeParameters ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocComments , getSeverityString ( MissingJavadocComments ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagDescription , this . reportMissingJavadocTagDescription ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsVisibility , getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsOverriding , this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportFinallyBlockNotCompletingNormally , getSeverityString ( FinallyBlockNotCompleting ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownException , getSeverityString ( UnusedDeclaredThrownException ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnqualifiedFieldAccess , getSeverityString ( UnqualifiedFieldAccess ) ) ; optionsMap . put ( OPTION_ReportUnavoidableGenericTypeProblems , this . reportUnavoidableGenericTypeProblems ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUncheckedTypeOperation , getSeverityString ( UncheckedTypeOperation ) ) ; optionsMap . put ( OPTION_ReportRawTypeReference , getSeverityString ( RawTypeReference ) ) ; optionsMap . put ( OPTION_ReportFinalParameterBound , getSeverityString ( FinalParameterBound ) ) ; optionsMap . put ( OPTION_ReportMissingSerialVersion , getSeverityString ( MissingSerialVersion ) ) ; optionsMap . put ( OPTION_ReportForbiddenReference , getSeverityString ( ForbiddenReference ) ) ; optionsMap . put ( OPTION_ReportDiscouragedReference , getSeverityString ( DiscouragedReference ) ) ; optionsMap . put ( OPTION_ReportVarargsArgumentNeedCast , getSeverityString ( VarargsArgumentNeedCast ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotation , getSeverityString ( MissingOverrideAnnotation ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingDeprecatedAnnotation , getSeverityString ( MissingDeprecatedAnnotation ) ) ; optionsMap . put ( OPTION_ReportUnusedLabel , getSeverityString ( UnusedLabel ) ) ; optionsMap . put ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation , getSeverityString ( UnusedTypeArguments ) ) ; optionsMap . put ( OPTION_Compliance , versionFromJdkLevel ( this . complianceLevel ) ) ; optionsMap . put ( OPTION_Source , versionFromJdkLevel ( this . sourceLevel ) ) ; optionsMap . put ( OPTION_TargetPlatform , versionFromJdkLevel ( this . targetJDK ) ) ; optionsMap . put ( OPTION_FatalOptionalError , this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; if ( this . defaultEncoding != null ) { optionsMap . put ( OPTION_Encoding , this . defaultEncoding ) ; } optionsMap . put ( OPTION_TaskTags , this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; optionsMap . put ( OPTION_TaskPriorities , this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; optionsMap . put ( OPTION_TaskCaseSensitive , this . isTaskCaseSensitive ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenImplementingAbstract , this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenOverridingConcrete , this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterIncludeDocCommentReference , this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportSpecialParameterHidingField , this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_MaxProblemPerUnit , String . valueOf ( this . maxProblemsPerUnit ) ) ; optionsMap . put ( OPTION_InlineJsr , this . inlineJsrBytecode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportNullReference , getSeverityString ( NullReference ) ) ; optionsMap . put ( OPTION_ReportPotentialNullReference , getSeverityString ( PotentialNullReference ) ) ; optionsMap . put ( OPTION_ReportRedundantNullCheck , getSeverityString ( RedundantNullCheck ) ) ; optionsMap . put ( OPTION_SuppressWarnings , this . suppressWarnings ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_SuppressOptionalErrors , this . suppressOptionalErrors ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnhandledWarningToken , getSeverityString ( UnhandledWarningToken ) ) ; optionsMap . put ( OPTION_ReportUnusedWarningToken , getSeverityString ( UnusedWarningToken ) ) ; optionsMap . put ( OPTION_ReportParameterAssignment , getSeverityString ( ParameterAssignment ) ) ; optionsMap . put ( OPTION_ReportFallthroughCase , getSeverityString ( FallthroughCase ) ) ; optionsMap . put ( OPTION_ReportOverridingMethodWithoutSuperInvocation , getSeverityString ( OverridingMethodWithoutSuperInvocation ) ) ; optionsMap . put ( OPTION_GenerateClassFiles , this . generateClassFiles ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_Process_Annotations , this . processAnnotations ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportRedundantSuperinterface , getSeverityString ( RedundantSuperinterface ) ) ; optionsMap . put ( OPTION_ReportComparingIdentical , getSeverityString ( ComparingIdentical ) ) ; optionsMap . put ( OPTION_ReportMissingSynchronizedOnInheritedMethod , getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; optionsMap . put ( OPTION_ReportMissingHashCodeMethod , getSeverityString ( ShouldImplementHashcode ) ) ; optionsMap . put ( OPTION_ReportDeadCode , getSeverityString ( DeadCode ) ) ; optionsMap . put ( OPTION_ReportDeadCodeInTrivialIfStatement , this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportTasks , getSeverityString ( Tasks ) ) ; optionsMap . put ( OPTION_ReportUnusedObjectAllocation , getSeverityString ( UnusedObjectAllocation ) ) ; optionsMap . put ( OPTION_IncludeNullInfoFromAsserts , this . includeNullInfoFromAsserts ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodCanBeStatic , getSeverityString ( MethodCanBeStatic ) ) ; optionsMap . put ( OPTION_ReportMethodCanBePotentiallyStatic , getSeverityString ( MethodCanBePotentiallyStatic ) ) ; optionsMap . put ( OPTION_ReportRedundantSpecificationOfTypeArguments , getSeverityString ( RedundantSpecificationOfTypeArguments ) ) ; optionsMap . put ( OPTION_ReportUnclosedCloseable , getSeverityString ( UnclosedCloseable ) ) ; optionsMap . put ( OPTION_ReportPotentiallyUnclosedCloseable , getSeverityString ( PotentiallyUnclosedCloseable ) ) ; optionsMap . put ( OPTION_ReportExplicitlyClosedAutoCloseable , getSeverityString ( ExplicitlyClosedAutoCloseable ) ) ; optionsMap . put ( OPTION_AnnotationBasedNullAnalysis , this . isAnnotationBasedNullAnalysisEnabled ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportNullSpecViolation , getSeverityString ( NullSpecViolation ) ) ; optionsMap . put ( OPTION_ReportNullAnnotationInferenceConflict , getSeverityString ( NullAnnotationInferenceConflict ) ) ; optionsMap . put ( OPTION_ReportNullUncheckedConversion , getSeverityString ( NullUncheckedConversion ) ) ; optionsMap . put ( OPTION_ReportRedundantNullAnnotation , getSeverityString ( RedundantNullAnnotation ) ) ; optionsMap . put ( OPTION_NullableAnnotationName , String . valueOf ( CharOperation . concatWith ( this . nullableAnnotationName , '<CHAR_LIT:.>' ) ) ) ; optionsMap . put ( OPTION_NonNullAnnotationName , String . valueOf ( CharOperation . concatWith ( this . nonNullAnnotationName , '<CHAR_LIT:.>' ) ) ) ; optionsMap . put ( OPTION_NonNullByDefaultAnnotationName , String . valueOf ( CharOperation . concatWith ( this . nonNullByDefaultAnnotationName , '<CHAR_LIT:.>' ) ) ) ; optionsMap . put ( OPTION_ReportMissingNonNullByDefaultAnnotation , getSeverityString ( MissingNonNullByDefaultAnnotation ) ) ; optionsMap . put ( OPTIONG_GroovyTransformsToRunOnReconcile , "<STR_LIT>" ) ; return optionsMap ; } public int getSeverity ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) { if ( ( irritant & ( IrritantSet . GROUP_MASK | UnusedWarningToken ) ) == UnusedWarningToken ) { return ProblemSeverities . Error | ProblemSeverities . Optional ; } return this . treatOptionalErrorAsFatal ? ProblemSeverities . Error | ProblemSeverities . Optional | ProblemSeverities . Fatal : ProblemSeverities . Error | ProblemSeverities . Optional ; } if ( this . warningThreshold . isSet ( irritant ) ) { return ProblemSeverities . Warning | ProblemSeverities . Optional ; } return ProblemSeverities . Ignore ; } public String getSeverityString ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) return ERROR ; if ( this . warningThreshold . isSet ( irritant ) ) return WARNING ; return IGNORE ; } public String getVisibilityString ( int level ) { switch ( level & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : return PUBLIC ; case ClassFileConstants . AccProtected : return PROTECTED ; case ClassFileConstants . AccPrivate : return PRIVATE ; default : return DEFAULT ; } } public boolean isAnyEnabled ( IrritantSet irritants ) { return this . warningThreshold . isAnySet ( irritants ) || this . errorThreshold . isAnySet ( irritants ) ; } protected void resetDefaults ( ) { this . errorThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_ERRORS ) ; this . warningThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_WARNINGS ) ; this . produceDebugAttributes = ClassFileConstants . ATTR_SOURCE | ClassFileConstants . ATTR_LINES ; this . complianceLevel = this . originalComplianceLevel = ClassFileConstants . JDK1_4 ; this . sourceLevel = this . originalSourceLevel = ClassFileConstants . JDK1_3 ; this . targetJDK = ClassFileConstants . JDK1_2 ; this . defaultEncoding = null ; this . verbose = Compiler . DEBUG ; this . produceReferenceInfo = false ; this . preserveAllLocalVariables = false ; this . parseLiteralExpressionsAsConstants = true ; this . maxProblemsPerUnit = <NUM_LIT:100> ; this . taskTags = null ; this . taskPriorities = null ; this . isTaskCaseSensitive = true ; this . reportDeprecationInsideDeprecatedCode = false ; this . reportDeprecationWhenOverridingDeprecatedMethod = false ; this . reportUnusedParameterWhenImplementingAbstract = false ; this . reportUnusedParameterWhenOverridingConcrete = false ; this . reportUnusedParameterIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; this . reportSpecialParameterHidingField = false ; this . reportUnavoidableGenericTypeProblems = true ; this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportInvalidJavadocTags = false ; this . reportInvalidJavadocTagsDeprecatedRef = false ; this . reportInvalidJavadocTagsNotVisibleRef = false ; this . reportMissingJavadocTagDescription = RETURN_TAG ; this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocTagsOverriding = false ; this . reportMissingJavadocTagsMethodTypeParameters = false ; this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocCommentsOverriding = false ; this . inlineJsrBytecode = false ; this . docCommentSupport = false ; this . suppressWarnings = true ; this . suppressOptionalErrors = false ; this . treatOptionalErrorAsFatal = false ; this . performMethodsFullRecovery = true ; this . performStatementsRecovery = true ; this . storeAnnotations = false ; this . generateClassFiles = true ; this . processAnnotations = false ; this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; this . reportDeadCodeInTrivialIfStatement = false ; this . ignoreMethodBodies = false ; this . ignoreSourceFolderWarningOption = false ; this . includeNullInfoFromAsserts = false ; this . isAnnotationBasedNullAnalysisEnabled = false ; this . nullableAnnotationName = DEFAULT_NULLABLE_ANNOTATION_NAME ; this . nonNullAnnotationName = DEFAULT_NONNULL_ANNOTATION_NAME ; this . nonNullByDefaultAnnotationName = DEFAULT_NONNULLBYDEFAULT_ANNOTATION_NAME ; this . intendedDefaultNonNullness = <NUM_LIT:0> ; this . analyseResourceLeaks = true ; this . reportMissingEnumCaseDespiteDefault = false ; } public void set ( Map optionsMap ) { Object optionValue ; if ( ( optionValue = optionsMap . get ( OPTION_LocalVariableAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_VARS ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_VARS ; } } if ( ( optionValue = optionsMap . get ( OPTION_LineNumberAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_LINES ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_LINES ; } } if ( ( optionValue = optionsMap . get ( OPTION_SourceFileAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_SOURCE ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_SOURCE ; } } if ( ( optionValue = optionsMap . get ( OPTION_PreserveUnusedLocal ) ) != null ) { if ( PRESERVE . equals ( optionValue ) ) { this . preserveAllLocalVariables = true ; } else if ( OPTIMIZE_OUT . equals ( optionValue ) ) { this . preserveAllLocalVariables = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationInDeprecatedCode ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Compliance ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) this . complianceLevel = this . originalComplianceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_Source ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) this . sourceLevel = this . originalSourceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_TargetPlatform ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) { this . targetJDK = level ; } if ( this . targetJDK >= ClassFileConstants . JDK1_5 ) this . inlineJsrBytecode = true ; } if ( ( optionValue = optionsMap . get ( OPTION_Encoding ) ) != null ) { if ( optionValue instanceof String ) { this . defaultEncoding = null ; String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > <NUM_LIT:0> ) { try { new InputStreamReader ( new ByteArrayInputStream ( new byte [ <NUM_LIT:0> ] ) , stringValue ) ; this . defaultEncoding = stringValue ; } catch ( UnsupportedEncodingException e ) { } } } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenImplementingAbstract ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenOverridingConcrete ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportSpecialParameterHidingField ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnavoidableGenericTypeProblems ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnavoidableGenericTypeProblems = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnavoidableGenericTypeProblems = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCodeInTrivialIfStatement ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_MaxProblemPerUnit ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; try { int val = Integer . parseInt ( stringValue ) ; if ( val >= <NUM_LIT:0> ) this . maxProblemsPerUnit = val ; } catch ( NumberFormatException e ) { } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskTags ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { this . taskTags = null ; } else { this . taskTags = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskPriorities ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { this . taskPriorities = null ; } else { this . taskPriorities = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskCaseSensitive ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_InlineJsr ) ) != null ) { if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { if ( ENABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = false ; } } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressWarnings ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressWarnings = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressWarnings = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressOptionalErrors ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_FatalOptionalError ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_IncludeNullInfoFromAsserts ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . includeNullInfoFromAsserts = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . includeNullInfoFromAsserts = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodWithConstructorName ) ) != null ) updateSeverity ( MethodWithConstructorName , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingPackageDefaultMethod ) ) != null ) updateSeverity ( OverriddenPackageDefaultMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecation ) ) != null ) updateSeverity ( UsingDeprecatedAPI , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportHiddenCatchBlock ) ) != null ) updateSeverity ( MaskedCatchBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLocal ) ) != null ) updateSeverity ( UnusedLocalVariable , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameter ) ) != null ) updateSeverity ( UnusedArgument , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedImport ) ) != null ) updateSeverity ( UnusedImport , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedPrivateMember ) ) != null ) updateSeverity ( UnusedPrivateMember , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownException ) ) != null ) updateSeverity ( UnusedDeclaredThrownException , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoImplicitStringConversion ) ) != null ) updateSeverity ( NoImplicitStringConversion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportSyntheticAccessEmulation ) ) != null ) updateSeverity ( AccessEmulation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportLocalVariableHiding ) ) != null ) updateSeverity ( LocalVariableHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFieldHiding ) ) != null ) updateSeverity ( FieldHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTypeParameterHiding ) ) != null ) updateSeverity ( TypeHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPossibleAccidentalBooleanAssignment ) ) != null ) updateSeverity ( AccidentalBooleanAssign , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEmptyStatement ) ) != null ) updateSeverity ( EmptyStatement , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonExternalizedStringLiteral ) ) != null ) updateSeverity ( NonExternalizedString , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAssertIdentifier ) ) != null ) updateSeverity ( AssertUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEnumIdentifier ) ) != null ) updateSeverity ( EnumUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonStaticAccessToStatic ) ) != null ) updateSeverity ( NonStaticAccessToStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIndirectStaticAccess ) ) != null ) updateSeverity ( IndirectStaticAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod ) ) != null ) updateSeverity ( IncompatibleNonInheritedInterfaceMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUndocumentedEmptyBlock ) ) != null ) updateSeverity ( UndocumentedEmptyBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryTypeCheck ) ) != null ) updateSeverity ( UnnecessaryTypeCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryElse ) ) != null ) updateSeverity ( UnnecessaryElse , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinallyBlockNotCompletingNormally ) ) != null ) updateSeverity ( FinallyBlockNotCompleting , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnqualifiedFieldAccess ) ) != null ) updateSeverity ( UnqualifiedFieldAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoEffectAssignment ) ) != null ) updateSeverity ( NoEffectAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUncheckedTypeOperation ) ) != null ) updateSeverity ( UncheckedTypeOperation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRawTypeReference ) ) != null ) updateSeverity ( RawTypeReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinalParameterBound ) ) != null ) updateSeverity ( FinalParameterBound , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSerialVersion ) ) != null ) updateSeverity ( MissingSerialVersion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportForbiddenReference ) ) != null ) updateSeverity ( ForbiddenReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDiscouragedReference ) ) != null ) updateSeverity ( DiscouragedReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportVarargsArgumentNeedCast ) ) != null ) updateSeverity ( VarargsArgumentNeedCast , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNullReference ) ) != null ) updateSeverity ( NullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPotentialNullReference ) ) != null ) updateSeverity ( PotentialNullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantNullCheck ) ) != null ) updateSeverity ( RedundantNullCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAutoboxing ) ) != null ) updateSeverity ( AutoBoxing , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAnnotationSuperInterface ) ) != null ) updateSeverity ( AnnotationSuperInterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotation ) ) != null ) updateSeverity ( MissingOverrideAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingDeprecatedAnnotation ) ) != null ) updateSeverity ( MissingDeprecatedAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompleteEnumSwitch ) ) != null ) updateSeverity ( MissingEnumConstantCase , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingEnumCaseDespiteDefault ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingEnumCaseDespiteDefault = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingEnumCaseDespiteDefault = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingDefaultCase ) ) != null ) updateSeverity ( MissingDefaultCase , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnhandledWarningToken ) ) != null ) updateSeverity ( UnhandledWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedWarningToken ) ) != null ) updateSeverity ( UnusedWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLabel ) ) != null ) updateSeverity ( UnusedLabel , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportParameterAssignment ) ) != null ) updateSeverity ( ParameterAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFallthroughCase ) ) != null ) updateSeverity ( FallthroughCase , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingMethodWithoutSuperInvocation ) ) != null ) updateSeverity ( OverridingMethodWithoutSuperInvocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation ) ) != null ) updateSeverity ( UnusedTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSuperinterface ) ) != null ) updateSeverity ( RedundantSuperinterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportComparingIdentical ) ) != null ) updateSeverity ( ComparingIdentical , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSynchronizedOnInheritedMethod ) ) != null ) updateSeverity ( MissingSynchronizedModifierInInheritedMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingHashCodeMethod ) ) != null ) updateSeverity ( ShouldImplementHashcode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCode ) ) != null ) updateSeverity ( DeadCode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTasks ) ) != null ) updateSeverity ( Tasks , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedObjectAllocation ) ) != null ) updateSeverity ( UnusedObjectAllocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodCanBeStatic ) ) != null ) updateSeverity ( MethodCanBeStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodCanBePotentiallyStatic ) ) != null ) updateSeverity ( MethodCanBePotentiallyStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSpecificationOfTypeArguments ) ) != null ) updateSeverity ( RedundantSpecificationOfTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnclosedCloseable ) ) != null ) updateSeverity ( UnclosedCloseable , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPotentiallyUnclosedCloseable ) ) != null ) updateSeverity ( PotentiallyUnclosedCloseable , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportExplicitlyClosedAutoCloseable ) ) != null ) updateSeverity ( ExplicitlyClosedAutoCloseable , optionValue ) ; if ( getSeverity ( UnclosedCloseable ) == ProblemSeverities . Ignore && getSeverity ( PotentiallyUnclosedCloseable ) == ProblemSeverities . Ignore && getSeverity ( ExplicitlyClosedAutoCloseable ) == ProblemSeverities . Ignore ) { this . analyseResourceLeaks = false ; } else { this . analyseResourceLeaks = true ; } if ( ( optionValue = optionsMap . get ( OPTION_AnnotationBasedNullAnalysis ) ) != null ) { this . isAnnotationBasedNullAnalysisEnabled = ENABLED . equals ( optionValue ) ; } if ( this . isAnnotationBasedNullAnalysisEnabled ) { if ( ( optionValue = optionsMap . get ( OPTION_ReportNullSpecViolation ) ) != null ) { if ( ERROR . equals ( optionValue ) ) { this . errorThreshold . set ( NullSpecViolation ) ; this . warningThreshold . clear ( NullSpecViolation ) ; } else if ( WARNING . equals ( optionValue ) ) { this . errorThreshold . clear ( NullSpecViolation ) ; this . warningThreshold . set ( NullSpecViolation ) ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportNullAnnotationInferenceConflict ) ) != null ) updateSeverity ( NullAnnotationInferenceConflict , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNullUncheckedConversion ) ) != null ) updateSeverity ( NullUncheckedConversion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantNullAnnotation ) ) != null ) updateSeverity ( RedundantNullAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_NullableAnnotationName ) ) != null ) { this . nullableAnnotationName = CharOperation . splitAndTrimOn ( '<CHAR_LIT:.>' , ( ( String ) optionValue ) . toCharArray ( ) ) ; } if ( ( optionValue = optionsMap . get ( OPTION_NonNullAnnotationName ) ) != null ) { this . nonNullAnnotationName = CharOperation . splitAndTrimOn ( '<CHAR_LIT:.>' , ( ( String ) optionValue ) . toCharArray ( ) ) ; } if ( ( optionValue = optionsMap . get ( OPTION_NonNullByDefaultAnnotationName ) ) != null ) { this . nonNullByDefaultAnnotationName = CharOperation . splitAndTrimOn ( '<CHAR_LIT:.>' , ( ( String ) optionValue ) . toCharArray ( ) ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingNonNullByDefaultAnnotation ) ) != null ) updateSeverity ( MissingNonNullByDefaultAnnotation , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_DocCommentSupport ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . docCommentSupport = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . docCommentSupport = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadoc ) ) != null ) { updateSeverity ( InvalidJavadoc , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTags ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsDeprecatedRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsNotVisibleRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTags ) ) != null ) { updateSeverity ( MissingJavadocTags , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsMethodTypeParameters ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsMethodTypeParameters = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsMethodTypeParameters = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocComments ) ) != null ) { updateSeverity ( MissingJavadocComments , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagDescription ) ) != null ) { this . reportMissingJavadocTagDescription = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_GenerateClassFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . generateClassFiles = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . generateClassFiles = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Process_Annotations ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . processAnnotations = true ; this . storeAnnotations = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . processAnnotations = false ; this . storeAnnotations = false ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_BuildGroovyFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . buildGroovyFiles = <NUM_LIT:2> ; this . storeAnnotations = true ; String s = ( String ) optionsMap . get ( OPTIONG_GroovyFlags ) ; if ( s != null && s . equals ( "<STR_LIT:1>" ) ) { this . groovyFlags = <NUM_LIT> ; } else { this . groovyFlags = <NUM_LIT:0> ; } } else if ( DISABLED . equals ( optionValue ) ) { this . buildGroovyFiles = <NUM_LIT:1> ; this . groovyFlags = <NUM_LIT:0> ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyClassLoaderPath ) ) != null ) { this . groovyClassLoaderPath = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyExtraImports ) ) != null ) { this . groovyExtraImports = ( String ) optionValue ; } else { if ( sysPropConfiguredExtraImports != null ) { this . groovyExtraImports = sysPropConfiguredExtraImports ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyProjectName ) ) != null ) { this . groovyProjectName = ( String ) optionValue ; } optionValue = optionsMap . get ( OPTIONG_GroovyTransformsToRunOnReconcile ) ; if ( optionValue != null && ( ( String ) optionValue ) . length ( ) != <NUM_LIT:0> ) { this . groovyTransformsToRunOnReconcile = ( String ) optionValue ; } else { if ( sysPropConfiguredGroovyTransforms != null ) { this . groovyTransformsToRunOnReconcile = sysPropConfiguredGroovyTransforms ; } } } static String sysPropConfiguredExtraImports = null ; static String sysPropConfiguredGroovyTransforms = null ; static { try { sysPropConfiguredExtraImports = System . getProperty ( "<STR_LIT>" ) ; } catch ( Exception e ) { sysPropConfiguredExtraImports = null ; } try { sysPropConfiguredGroovyTransforms = System . getProperty ( "<STR_LIT>" ) ; } catch ( Exception e ) { sysPropConfiguredGroovyTransforms = null ; } } public String toString ( ) { StringBuffer buf = new StringBuffer ( "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . preserveAllLocalVariables ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodWithConstructorName ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( OverriddenPackageDefaultMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UsingDeprecatedAPI ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MaskedCatchBlock ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedLocalVariable ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedArgument ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedImport ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AccessEmulation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NoEffectAssignment ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NonExternalizedString ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NonStaticAccessToStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IndirectStaticAccess ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedPrivateMember ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( LocalVariableHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FieldHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( TypeHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AccidentalBooleanAssign ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( EmptyStatement ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UndocumentedEmptyBlock ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnnecessaryTypeCheck ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . docCommentSupport ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( InvalidJavadoc ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingJavadocTags ) ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagsMethodTypeParameters ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingJavadocComments ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagDescription ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FinallyBlockNotCompleting ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedDeclaredThrownException ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnnecessaryElse ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . complianceLevel ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . sourceLevel ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . targetJDK ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . verbose ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . produceReferenceInfo ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . parseLiteralExpressionsAsConstants ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . defaultEncoding == null ? "<STR_LIT>" : this . defaultEncoding ) ; buf . append ( "<STR_LIT>" ) . append ( this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . inlineJsrBytecode ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnavoidableGenericTypeProblems ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UncheckedTypeOperation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RawTypeReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FinalParameterBound ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingSerialVersion ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( VarargsArgumentNeedCast ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ForbiddenReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( DiscouragedReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NullReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( PotentialNullReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantNullCheck ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AutoBoxing ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AnnotationSuperInterface ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingOverrideAnnotation ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingDeprecatedAnnotation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingEnumConstantCase ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . includeNullInfoFromAsserts ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . suppressWarnings ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . suppressOptionalErrors ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnhandledWarningToken ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedWarningToken ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedLabel ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ParameterAssignment ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . generateClassFiles ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . processAnnotations ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedTypeArguments ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantSuperinterface ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ComparingIdentical ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ShouldImplementHashcode ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( DeadCode ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( Tasks ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedObjectAllocation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodCanBeStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodCanBePotentiallyStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantSpecificationOfTypeArguments ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnclosedCloseable ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( PotentiallyUnclosedCloseable ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ExplicitlyClosedAutoCloseable ) ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . buildGroovyFiles == <NUM_LIT:0> ) ? "<STR_LIT>" : ( this . buildGroovyFiles == <NUM_LIT:1> ? "<STR_LIT>" : "<STR_LIT:yes>" ) ) ; buf . append ( "<STR_LIT>" ) . append ( Integer . toHexString ( this . groovyFlags ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . groovyClassLoaderPath ) ; buf . append ( "<STR_LIT>" ) . append ( this . groovyProjectName ) ; buf . append ( "<STR_LIT>" ) . append ( this . groovyExtraImports ) ; return buf . toString ( ) ; } protected void updateSeverity ( int irritant , Object severityString ) { if ( ERROR . equals ( severityString ) ) { this . errorThreshold . set ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } else if ( WARNING . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . set ( irritant ) ; } else if ( IGNORE . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; public interface ReferenceContext { void abort ( int abortLevel , CategorizedProblem problem ) ; CompilationResult compilationResult ( ) ; CompilationUnitDeclaration getCompilationUnitDeclaration ( ) ; boolean hasErrors ( ) ; void tagAsHavingErrors ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . problem . ShouldNotImplement ; import org . eclipse . jdt . internal . compiler . util . Messages ; public abstract class Constant implements TypeIds , OperatorIds { public static final Constant NotAConstant = DoubleConstant . fromValue ( Double . NaN ) ; public boolean booleanValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:boolean>" } ) ) ; } public byte byteValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public final Constant castTo ( int conversionToTargetType ) { if ( this == NotAConstant ) return NotAConstant ; switch ( conversionToTargetType ) { case T_undefined : return this ; case ( T_byte << <NUM_LIT:4> ) + T_byte : return this ; case ( T_byte << <NUM_LIT:4> ) + T_long : return ByteConstant . fromValue ( ( byte ) longValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_short : return ByteConstant . fromValue ( ( byte ) shortValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_double : return ByteConstant . fromValue ( ( byte ) doubleValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_float : return ByteConstant . fromValue ( ( byte ) floatValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_char : return ByteConstant . fromValue ( ( byte ) charValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_int : return ByteConstant . fromValue ( ( byte ) intValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_byte : return LongConstant . fromValue ( byteValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_long : return this ; case ( T_long << <NUM_LIT:4> ) + T_short : return LongConstant . fromValue ( shortValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_double : return LongConstant . fromValue ( ( long ) doubleValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_float : return LongConstant . fromValue ( ( long ) floatValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_char : return LongConstant . fromValue ( charValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_int : return LongConstant . fromValue ( intValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_byte : return ShortConstant . fromValue ( byteValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_long : return ShortConstant . fromValue ( ( short ) longValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_short : return this ; case ( T_short << <NUM_LIT:4> ) + T_double : return ShortConstant . fromValue ( ( short ) doubleValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_float : return ShortConstant . fromValue ( ( short ) floatValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_char : return ShortConstant . fromValue ( ( short ) charValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_int : return ShortConstant . fromValue ( ( short ) intValue ( ) ) ; case ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangString : return this ; case ( T_double << <NUM_LIT:4> ) + T_byte : return DoubleConstant . fromValue ( byteValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_long : return DoubleConstant . fromValue ( longValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_short : return DoubleConstant . fromValue ( shortValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_double : return this ; case ( T_double << <NUM_LIT:4> ) + T_float : return DoubleConstant . fromValue ( floatValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_char : return DoubleConstant . fromValue ( charValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_int : return DoubleConstant . fromValue ( intValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_byte : return FloatConstant . fromValue ( byteValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_long : return FloatConstant . fromValue ( longValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_short : return FloatConstant . fromValue ( shortValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_double : return FloatConstant . fromValue ( ( float ) doubleValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_float : return this ; case ( T_float << <NUM_LIT:4> ) + T_char : return FloatConstant . fromValue ( charValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_int : return FloatConstant . fromValue ( intValue ( ) ) ; case ( T_boolean << <NUM_LIT:4> ) + T_boolean : return this ; case ( T_char << <NUM_LIT:4> ) + T_byte : return CharConstant . fromValue ( ( char ) byteValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_long : return CharConstant . fromValue ( ( char ) longValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_short : return CharConstant . fromValue ( ( char ) shortValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_double : return CharConstant . fromValue ( ( char ) doubleValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_float : return CharConstant . fromValue ( ( char ) floatValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_char : return this ; case ( T_char << <NUM_LIT:4> ) + T_int : return CharConstant . fromValue ( ( char ) intValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_byte : return IntConstant . fromValue ( byteValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_long : return IntConstant . fromValue ( ( int ) longValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_short : return IntConstant . fromValue ( shortValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_double : return IntConstant . fromValue ( ( int ) doubleValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_float : return IntConstant . fromValue ( ( int ) floatValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_char : return IntConstant . fromValue ( charValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_int : return this ; } return NotAConstant ; } public char charValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public static final Constant computeConstantOperation ( Constant cst , int id , int operator ) { switch ( operator ) { case NOT : return BooleanConstant . fromValue ( ! cst . booleanValue ( ) ) ; case PLUS : return computeConstantOperationPLUS ( IntConstant . fromValue ( <NUM_LIT:0> ) , T_int , cst , id ) ; case MINUS : switch ( id ) { case T_float : float f ; if ( ( f = cst . floatValue ( ) ) == <NUM_LIT:0.0f> ) { if ( Float . floatToIntBits ( f ) == <NUM_LIT:0> ) return FloatConstant . fromValue ( - <NUM_LIT:0.0f> ) ; else return FloatConstant . fromValue ( <NUM_LIT:0.0f> ) ; } break ; case T_double : double d ; if ( ( d = cst . doubleValue ( ) ) == <NUM_LIT> ) { if ( Double . doubleToLongBits ( d ) == <NUM_LIT:0> ) return DoubleConstant . fromValue ( - <NUM_LIT> ) ; else return DoubleConstant . fromValue ( <NUM_LIT> ) ; } break ; } return computeConstantOperationMINUS ( IntConstant . fromValue ( <NUM_LIT:0> ) , T_int , cst , id ) ; case TWIDDLE : switch ( id ) { case T_char : return IntConstant . fromValue ( ~ cst . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( ~ cst . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( ~ cst . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( ~ cst . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( ~ cst . longValue ( ) ) ; default : return NotAConstant ; } default : return NotAConstant ; } } public static final Constant computeConstantOperation ( Constant left , int leftId , int operator , Constant right , int rightId ) { switch ( operator ) { case AND : return computeConstantOperationAND ( left , leftId , right , rightId ) ; case AND_AND : return computeConstantOperationAND_AND ( left , leftId , right , rightId ) ; case DIVIDE : return computeConstantOperationDIVIDE ( left , leftId , right , rightId ) ; case GREATER : return computeConstantOperationGREATER ( left , leftId , right , rightId ) ; case GREATER_EQUAL : return computeConstantOperationGREATER_EQUAL ( left , leftId , right , rightId ) ; case LEFT_SHIFT : return computeConstantOperationLEFT_SHIFT ( left , leftId , right , rightId ) ; case LESS : return computeConstantOperationLESS ( left , leftId , right , rightId ) ; case LESS_EQUAL : return computeConstantOperationLESS_EQUAL ( left , leftId , right , rightId ) ; case MINUS : return computeConstantOperationMINUS ( left , leftId , right , rightId ) ; case MULTIPLY : return computeConstantOperationMULTIPLY ( left , leftId , right , rightId ) ; case OR : return computeConstantOperationOR ( left , leftId , right , rightId ) ; case OR_OR : return computeConstantOperationOR_OR ( left , leftId , right , rightId ) ; case PLUS : return computeConstantOperationPLUS ( left , leftId , right , rightId ) ; case REMAINDER : return computeConstantOperationREMAINDER ( left , leftId , right , rightId ) ; case RIGHT_SHIFT : return computeConstantOperationRIGHT_SHIFT ( left , leftId , right , rightId ) ; case UNSIGNED_RIGHT_SHIFT : return computeConstantOperationUNSIGNED_RIGHT_SHIFT ( left , leftId , right , rightId ) ; case XOR : return computeConstantOperationXOR ( left , leftId , right , rightId ) ; default : return NotAConstant ; } } public static final Constant computeConstantOperationAND ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) & right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) & right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) & right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) & right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) & right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) & right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) & right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) & right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) & right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationAND_AND ( Constant left , int leftId , Constant right , int rightId ) { return BooleanConstant . fromValue ( left . booleanValue ( ) && right . booleanValue ( ) ) ; } public static final Constant computeConstantOperationDIVIDE ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) / right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) / right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) / right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) / right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) / right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) / right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) / right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) / right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) / right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) / right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) / right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) / right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) / right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationEQUAL_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : if ( rightId == T_boolean ) { return BooleanConstant . fromValue ( left . booleanValue ( ) == right . booleanValue ( ) ) ; } break ; case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) == right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) == right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) == right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) == right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) == right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) == right . longValue ( ) ) ; } break ; case T_JavaLangString : if ( rightId == T_JavaLangString ) { return BooleanConstant . fromValue ( ( ( StringConstant ) left ) . hasSameValue ( right ) ) ; } break ; case T_null : if ( rightId == T_JavaLangString ) { return BooleanConstant . fromValue ( false ) ; } else { if ( rightId == T_null ) { return BooleanConstant . fromValue ( true ) ; } } } return BooleanConstant . fromValue ( false ) ; } public static final Constant computeConstantOperationGREATER ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) > right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) > right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationGREATER_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) >= right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) >= right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) >= right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLEFT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) << right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) << right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) << right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) << right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) << right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) << right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) << right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) << right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) << right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLESS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) < right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) < right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) < right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) < right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) < right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) < right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLESS_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) <= right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) <= right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) <= right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationMINUS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) - right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) - right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) - right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) - right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) - right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) - right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) - right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) - right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) - right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) - right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) - right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) - right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) - right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationMULTIPLY ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) * right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) * right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) * right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) * right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) * right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) * right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) * right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) * right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) * right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) * right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) * right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) * right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) * right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationOR ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) | right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) | right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) | right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) | right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) | right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) | right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) | right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) | right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) | right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationOR_OR ( Constant left , int leftId , Constant right , int rightId ) { return BooleanConstant . fromValue ( left . booleanValue ( ) || right . booleanValue ( ) ) ; } public static final Constant computeConstantOperationPLUS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_JavaLangObject : if ( rightId == T_JavaLangString ) { return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_boolean : if ( rightId == T_JavaLangString ) { return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) + right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) + right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) + right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) + right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) + right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) + right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) + right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_JavaLangString : switch ( rightId ) { case T_char : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . charValue ( ) ) ) ; case T_float : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . floatValue ( ) ) ) ; case T_double : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . doubleValue ( ) ) ) ; case T_byte : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . byteValue ( ) ) ) ; case T_short : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . shortValue ( ) ) ) ; case T_int : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . intValue ( ) ) ) ; case T_long : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . longValue ( ) ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; case T_boolean : return StringConstant . fromValue ( left . stringValue ( ) + right . booleanValue ( ) ) ; } break ; } return NotAConstant ; } public static final Constant computeConstantOperationREMAINDER ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) % right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) % right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) % right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) % right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) % right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) % right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) % right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) % right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) % right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) % right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) % right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) % right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) % right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationRIGHT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) > > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) > > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) > > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) > > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) > > right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) > > right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) > > right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) > > right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) > > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationUNSIGNED_RIGHT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) > > > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) > > > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) > > > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) > > > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) > > > right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) > > > right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) > > > right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) > > > right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) > > > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationXOR ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) ^ right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) ^ right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) ^ right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) ^ right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) ^ right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) ^ right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) ^ right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) ^ right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) ^ right . longValue ( ) ) ; } } return NotAConstant ; } public double doubleValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:double>" } ) ) ; } public float floatValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:float>" } ) ) ; } public boolean hasSameValue ( Constant otherConstant ) { if ( this == otherConstant ) return true ; int typeID ; if ( ( typeID = typeID ( ) ) != otherConstant . typeID ( ) ) return false ; switch ( typeID ) { case TypeIds . T_boolean : return booleanValue ( ) == otherConstant . booleanValue ( ) ; case TypeIds . T_byte : return byteValue ( ) == otherConstant . byteValue ( ) ; case TypeIds . T_char : return charValue ( ) == otherConstant . charValue ( ) ; case TypeIds . T_double : return doubleValue ( ) == otherConstant . doubleValue ( ) ; case TypeIds . T_float : return floatValue ( ) == otherConstant . floatValue ( ) ; case TypeIds . T_int : return intValue ( ) == otherConstant . intValue ( ) ; case TypeIds . T_short : return shortValue ( ) == otherConstant . shortValue ( ) ; case TypeIds . T_long : return longValue ( ) == otherConstant . longValue ( ) ; case TypeIds . T_JavaLangString : String value = stringValue ( ) ; return value == null ? otherConstant . stringValue ( ) == null : value . equals ( otherConstant . stringValue ( ) ) ; } return false ; } public int intValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:int>" } ) ) ; } public long longValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:long>" } ) ) ; } public short shortValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotConvertedTo , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public String stringValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotConvertedTo , new String [ ] { typeName ( ) , "<STR_LIT:String>" } ) ) ; } public String toString ( ) { if ( this == NotAConstant ) return "<STR_LIT>" ; return super . toString ( ) ; } public abstract int typeID ( ) ; public String typeName ( ) { switch ( typeID ( ) ) { case T_int : return "<STR_LIT:int>" ; case T_byte : return "<STR_LIT>" ; case T_short : return "<STR_LIT>" ; case T_char : return "<STR_LIT>" ; case T_float : return "<STR_LIT:float>" ; case T_double : return "<STR_LIT:double>" ; case T_boolean : return "<STR_LIT:boolean>" ; case T_long : return "<STR_LIT:long>" ; case T_JavaLangString : return "<STR_LIT>" ; default : return "<STR_LIT:unknown>" ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class FloatConstant extends Constant { float value ; public static Constant fromValue ( float value ) { return new FloatConstant ( value ) ; } private FloatConstant ( float value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return ( long ) this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_float ; } public int hashCode ( ) { return Float . floatToIntBits ( this . value ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } FloatConstant other = ( FloatConstant ) obj ; return Float . floatToIntBits ( this . value ) == Float . floatToIntBits ( other . value ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class ByteConstant extends Constant { private byte value ; public static Constant fromValue ( byte value ) { return new ByteConstant ( value ) ; } private ByteConstant ( byte value ) { this . value = value ; } public byte byteValue ( ) { return this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_byte ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ByteConstant other = ( ByteConstant ) obj ; return this . value == other . value ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class CharConstant extends Constant { private char value ; public static Constant fromValue ( char value ) { return new CharConstant ( value ) ; } private CharConstant ( char value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_char ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } CharConstant other = ( CharConstant ) obj ; return this . value == other . value ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class ShortConstant extends Constant { private short value ; public static Constant fromValue ( short value ) { return new ShortConstant ( value ) ; } private ShortConstant ( short value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_short ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ShortConstant other = ( ShortConstant ) obj ; return this . value == other . value ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . env . ISourceType ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; public interface ITypeRequestor { void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) ; void accept ( ICompilationUnit unit , AccessRestriction accessRestriction ) ; void accept ( ISourceType [ ] sourceType , PackageBinding packageBinding , AccessRestriction accessRestriction ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class StringConstant extends Constant { private String value ; public static Constant fromValue ( String value ) { return new StringConstant ( value ) ; } private StringConstant ( String value ) { this . value = value ; } public String stringValue ( ) { return this . value ; } public String toString ( ) { return "<STR_LIT>" + this . value + "<STR_LIT:\">" ; } public int typeID ( ) { return T_JavaLangString ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + ( ( this . value == null ) ? <NUM_LIT:0> : this . value . hashCode ( ) ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } StringConstant other = ( StringConstant ) obj ; if ( this . value == null ) { return other . value == null ; } else { return this . value . equals ( other . value ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public class IrritantSet { public final static int GROUP_MASK = ASTNode . Bit32 | ASTNode . Bit31 | ASTNode . Bit30 ; public final static int GROUP_SHIFT = <NUM_LIT> ; public final static int GROUP_MAX = <NUM_LIT:3> ; public final static int GROUP0 = <NUM_LIT:0> << GROUP_SHIFT ; public final static int GROUP1 = <NUM_LIT:1> << GROUP_SHIFT ; public final static int GROUP2 = <NUM_LIT:2> << GROUP_SHIFT ; public static final IrritantSet ALL = new IrritantSet ( <NUM_LIT> & ~ GROUP_MASK ) ; public static final IrritantSet BOXING = new IrritantSet ( CompilerOptions . AutoBoxing ) ; public static final IrritantSet CAST = new IrritantSet ( CompilerOptions . UnnecessaryTypeCheck ) ; public static final IrritantSet DEPRECATION = new IrritantSet ( CompilerOptions . UsingDeprecatedAPI ) ; public static final IrritantSet DEP_ANN = new IrritantSet ( CompilerOptions . MissingDeprecatedAnnotation ) ; public static final IrritantSet FALLTHROUGH = new IrritantSet ( CompilerOptions . FallthroughCase ) ; public static final IrritantSet FINALLY = new IrritantSet ( CompilerOptions . FinallyBlockNotCompleting ) ; public static final IrritantSet HIDING = new IrritantSet ( CompilerOptions . MaskedCatchBlock ) ; public static final IrritantSet INCOMPLETE_SWITCH = new IrritantSet ( CompilerOptions . MissingEnumConstantCase ) ; public static final IrritantSet NLS = new IrritantSet ( CompilerOptions . NonExternalizedString ) ; public static final IrritantSet NULL = new IrritantSet ( CompilerOptions . NullReference ) ; public static final IrritantSet RAW = new IrritantSet ( CompilerOptions . RawTypeReference ) ; public static final IrritantSet RESTRICTION = new IrritantSet ( CompilerOptions . ForbiddenReference ) ; public static final IrritantSet SERIAL = new IrritantSet ( CompilerOptions . MissingSerialVersion ) ; public static final IrritantSet STATIC_ACCESS = new IrritantSet ( CompilerOptions . IndirectStaticAccess ) ; public static final IrritantSet STATIC_METHOD = new IrritantSet ( CompilerOptions . MethodCanBeStatic ) ; public static final IrritantSet SYNTHETIC_ACCESS = new IrritantSet ( CompilerOptions . AccessEmulation ) ; public static final IrritantSet SYNCHRONIZED = new IrritantSet ( CompilerOptions . MissingSynchronizedModifierInInheritedMethod ) ; public static final IrritantSet SUPER = new IrritantSet ( CompilerOptions . OverridingMethodWithoutSuperInvocation ) ; public static final IrritantSet UNUSED = new IrritantSet ( CompilerOptions . UnusedLocalVariable ) ; public static final IrritantSet UNCHECKED = new IrritantSet ( CompilerOptions . UncheckedTypeOperation ) ; public static final IrritantSet UNQUALIFIED_FIELD_ACCESS = new IrritantSet ( CompilerOptions . UnqualifiedFieldAccess ) ; public static final IrritantSet RESOURCE = new IrritantSet ( CompilerOptions . UnclosedCloseable ) ; public static final IrritantSet JAVADOC = new IrritantSet ( CompilerOptions . InvalidJavadoc ) ; public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet ( <NUM_LIT:0> ) ; public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet ( <NUM_LIT:0> ) ; static { COMPILER_DEFAULT_WARNINGS . set ( CompilerOptions . MethodWithConstructorName | CompilerOptions . OverriddenPackageDefaultMethod | CompilerOptions . UsingDeprecatedAPI | CompilerOptions . MaskedCatchBlock | CompilerOptions . UnusedLocalVariable | CompilerOptions . NoImplicitStringConversion | CompilerOptions . AssertUsedAsAnIdentifier | CompilerOptions . UnusedImport | CompilerOptions . NonStaticAccessToStatic | CompilerOptions . NoEffectAssignment | CompilerOptions . IncompatibleNonInheritedInterfaceMethod | CompilerOptions . UnusedPrivateMember | CompilerOptions . FinallyBlockNotCompleting ) . set ( CompilerOptions . UncheckedTypeOperation | CompilerOptions . FinalParameterBound | CompilerOptions . MissingSerialVersion | CompilerOptions . EnumUsedAsAnIdentifier | CompilerOptions . ForbiddenReference | CompilerOptions . VarargsArgumentNeedCast | CompilerOptions . NullReference | CompilerOptions . AnnotationSuperInterface | CompilerOptions . TypeHiding | CompilerOptions . DiscouragedReference | CompilerOptions . UnhandledWarningToken | CompilerOptions . RawTypeReference | CompilerOptions . UnusedLabel | CompilerOptions . UnusedTypeArguments | CompilerOptions . UnusedWarningToken | CompilerOptions . ComparingIdentical | CompilerOptions . MissingEnumConstantCase ) . set ( CompilerOptions . DeadCode | CompilerOptions . Tasks | CompilerOptions . UnclosedCloseable | CompilerOptions . NullUncheckedConversion | CompilerOptions . RedundantNullAnnotation ) ; COMPILER_DEFAULT_ERRORS . set ( CompilerOptions . NullSpecViolation | CompilerOptions . NullAnnotationInferenceConflict ) ; ALL . setAll ( ) ; HIDING . set ( CompilerOptions . FieldHiding ) . set ( CompilerOptions . LocalVariableHiding ) . set ( CompilerOptions . TypeHiding ) ; NULL . set ( CompilerOptions . PotentialNullReference ) . set ( CompilerOptions . RedundantNullCheck ) . set ( CompilerOptions . NullSpecViolation ) . set ( CompilerOptions . NullAnnotationInferenceConflict ) . set ( CompilerOptions . NullUncheckedConversion ) . set ( CompilerOptions . RedundantNullAnnotation ) ; RESTRICTION . set ( CompilerOptions . DiscouragedReference ) ; STATIC_ACCESS . set ( CompilerOptions . NonStaticAccessToStatic ) ; UNUSED . set ( CompilerOptions . UnusedArgument ) . set ( CompilerOptions . UnusedPrivateMember ) . set ( CompilerOptions . UnusedDeclaredThrownException ) . set ( CompilerOptions . UnusedLabel ) . set ( CompilerOptions . UnusedImport ) . set ( CompilerOptions . UnusedTypeArguments ) . set ( CompilerOptions . RedundantSuperinterface ) . set ( CompilerOptions . DeadCode ) . set ( CompilerOptions . UnusedObjectAllocation ) . set ( CompilerOptions . RedundantSpecificationOfTypeArguments ) ; STATIC_METHOD . set ( CompilerOptions . MethodCanBePotentiallyStatic ) ; RESOURCE . set ( CompilerOptions . PotentiallyUnclosedCloseable ) . set ( CompilerOptions . ExplicitlyClosedAutoCloseable ) ; INCOMPLETE_SWITCH . set ( CompilerOptions . MissingDefaultCase ) ; String suppressRawWhenUnchecked = System . getProperty ( "<STR_LIT>" ) ; if ( suppressRawWhenUnchecked != null && "<STR_LIT:true>" . equalsIgnoreCase ( suppressRawWhenUnchecked ) ) { UNCHECKED . set ( CompilerOptions . RawTypeReference ) ; } JAVADOC . set ( CompilerOptions . MissingJavadocComments ) . set ( CompilerOptions . MissingJavadocTags ) ; } private int [ ] bits = new int [ GROUP_MAX ] ; public IrritantSet ( int singleGroupIrritants ) { initialize ( singleGroupIrritants ) ; } public IrritantSet ( IrritantSet other ) { initialize ( other ) ; } public boolean areAllSet ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( this . bits [ i ] != ( <NUM_LIT> & ~ GROUP_MASK ) ) return false ; } return true ; } public IrritantSet clear ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] &= ~ singleGroupIrritants ; return this ; } public IrritantSet clearAll ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { this . bits [ i ] = <NUM_LIT:0> ; } return this ; } public void initialize ( int singleGroupIrritants ) { if ( singleGroupIrritants == <NUM_LIT:0> ) return ; int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] = singleGroupIrritants & ~ GROUP_MASK ; } public void initialize ( IrritantSet other ) { if ( other == null ) return ; System . arraycopy ( other . bits , <NUM_LIT:0> , this . bits = new int [ GROUP_MAX ] , <NUM_LIT:0> , GROUP_MAX ) ; } public boolean isAnySet ( IrritantSet other ) { if ( other == null ) return false ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( ( this . bits [ i ] & other . bits [ i ] ) != <NUM_LIT:0> ) return true ; } return false ; } public boolean hasSameIrritants ( IrritantSet irritantSet ) { if ( irritantSet == null ) return false ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( this . bits [ i ] != irritantSet . bits [ i ] ) return false ; } return true ; } public boolean isSet ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; return ( this . bits [ group ] & singleGroupIrritants ) != <NUM_LIT:0> ; } public IrritantSet set ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] |= ( singleGroupIrritants & ~ GROUP_MASK ) ; return this ; } public IrritantSet set ( IrritantSet other ) { if ( other == null ) return this ; boolean wasNoOp = true ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { int otherIrritant = other . bits [ i ] & ~ GROUP_MASK ; if ( ( this . bits [ i ] & otherIrritant ) != otherIrritant ) { wasNoOp = false ; this . bits [ i ] |= otherIrritant ; } } return wasNoOp ? null : this ; } public IrritantSet setAll ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { this . bits [ i ] |= <NUM_LIT> & ~ GROUP_MASK ; } return this ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class BooleanConstant extends Constant { private boolean value ; private static final BooleanConstant TRUE = new BooleanConstant ( true ) ; private static final BooleanConstant FALSE = new BooleanConstant ( false ) ; public static Constant fromValue ( boolean value ) { return value ? BooleanConstant . TRUE : BooleanConstant . FALSE ; } private BooleanConstant ( boolean value ) { this . value = value ; } public boolean booleanValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_boolean ; } public int hashCode ( ) { return this . value ? <NUM_LIT> : <NUM_LIT> ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } return false ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class IntConstant extends Constant { int value ; private static final IntConstant MIN_VALUE = new IntConstant ( Integer . MIN_VALUE ) ; private static final IntConstant MINUS_FOUR = new IntConstant ( - <NUM_LIT:4> ) ; private static final IntConstant MINUS_THREE = new IntConstant ( - <NUM_LIT:3> ) ; private static final IntConstant MINUS_TWO = new IntConstant ( - <NUM_LIT:2> ) ; private static final IntConstant MINUS_ONE = new IntConstant ( - <NUM_LIT:1> ) ; private static final IntConstant ZERO = new IntConstant ( <NUM_LIT:0> ) ; private static final IntConstant ONE = new IntConstant ( <NUM_LIT:1> ) ; private static final IntConstant TWO = new IntConstant ( <NUM_LIT:2> ) ; private static final IntConstant THREE = new IntConstant ( <NUM_LIT:3> ) ; private static final IntConstant FOUR = new IntConstant ( <NUM_LIT:4> ) ; private static final IntConstant FIVE = new IntConstant ( <NUM_LIT:5> ) ; private static final IntConstant SIX = new IntConstant ( <NUM_LIT:6> ) ; private static final IntConstant SEVEN = new IntConstant ( <NUM_LIT:7> ) ; private static final IntConstant EIGHT = new IntConstant ( <NUM_LIT:8> ) ; private static final IntConstant NINE = new IntConstant ( <NUM_LIT:9> ) ; private static final IntConstant TEN = new IntConstant ( <NUM_LIT:10> ) ; public static Constant fromValue ( int value ) { switch ( value ) { case Integer . MIN_VALUE : return IntConstant . MIN_VALUE ; case - <NUM_LIT:4> : return IntConstant . MINUS_FOUR ; case - <NUM_LIT:3> : return IntConstant . MINUS_THREE ; case - <NUM_LIT:2> : return IntConstant . MINUS_TWO ; case - <NUM_LIT:1> : return IntConstant . MINUS_ONE ; case <NUM_LIT:0> : return IntConstant . ZERO ; case <NUM_LIT:1> : return IntConstant . ONE ; case <NUM_LIT:2> : return IntConstant . TWO ; case <NUM_LIT:3> : return IntConstant . THREE ; case <NUM_LIT:4> : return IntConstant . FOUR ; case <NUM_LIT:5> : return IntConstant . FIVE ; case <NUM_LIT:6> : return IntConstant . SIX ; case <NUM_LIT:7> : return IntConstant . SEVEN ; case <NUM_LIT:8> : return IntConstant . EIGHT ; case <NUM_LIT:9> : return IntConstant . NINE ; case <NUM_LIT:10> : return IntConstant . TEN ; } return new IntConstant ( value ) ; } private IntConstant ( int value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_int ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } IntConstant other = ( IntConstant ) obj ; return this . value == other . value ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class LongConstant extends Constant { private static final LongConstant ZERO = new LongConstant ( <NUM_LIT> ) ; private static final LongConstant MIN_VALUE = new LongConstant ( Long . MIN_VALUE ) ; private long value ; public static Constant fromValue ( long value ) { if ( value == <NUM_LIT> ) { return ZERO ; } else if ( value == Long . MIN_VALUE ) { return MIN_VALUE ; } return new LongConstant ( value ) ; } private LongConstant ( long value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_long ; } public int hashCode ( ) { return ( int ) ( this . value ^ ( this . value > > > <NUM_LIT:32> ) ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } LongConstant other = ( LongConstant ) obj ; return this . value == other . value ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class DoubleConstant extends Constant { private double value ; public static Constant fromValue ( double value ) { return new DoubleConstant ( value ) ; } private DoubleConstant ( double value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return ( float ) this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return ( long ) this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { if ( this == NotAConstant ) return "<STR_LIT>" ; return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_double ; } public int hashCode ( ) { long temp = Double . doubleToLongBits ( this . value ) ; return ( int ) ( temp ^ ( temp > > > <NUM_LIT:32> ) ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } DoubleConstant other = ( DoubleConstant ) obj ; return Double . doubleToLongBits ( this . value ) == Double . doubleToLongBits ( other . value ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . impl ; public class CompilerStats implements Comparable { public long startTime ; public long endTime ; public long lineCount ; public long parseTime ; public long resolveTime ; public long analyzeTime ; public long generateTime ; public long elapsedTime ( ) { return this . endTime - this . startTime ; } public int compareTo ( Object o ) { CompilerStats otherStats = ( CompilerStats ) o ; long time1 = elapsedTime ( ) ; long time2 = otherStats . elapsedTime ( ) ; return time1 < time2 ? - <NUM_LIT:1> : ( time1 == time2 ? <NUM_LIT:0> : <NUM_LIT:1> ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . AnnotationMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . ArrayInitializer ; import org . eclipse . jdt . internal . compiler . ast . ClassLiteralAccess ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . MemberValuePair ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . NormalAnnotation ; import org . eclipse . jdt . internal . compiler . ast . QualifiedNameReference ; import org . eclipse . jdt . internal . compiler . ast . SingleMemberAnnotation ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; import org . eclipse . jdt . internal . compiler . codegen . ExceptionLabel ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrame ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream . ExceptionMarker ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream . StackDepthMarker ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream . StackMarker ; import org . eclipse . jdt . internal . compiler . codegen . VerificationTypeInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . StringConstant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . LookupEnvironment ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . SyntheticArgumentBinding ; import org . eclipse . jdt . internal . compiler . lookup . SyntheticMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . problem . ShouldNotImplement ; import org . eclipse . jdt . internal . compiler . util . Messages ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClassFile implements TypeConstants , TypeIds { private byte [ ] bytes ; public CodeStream codeStream ; public ConstantPool constantPool ; public int constantPoolOffset ; public byte [ ] contents ; public int contentsOffset ; protected boolean creatingProblemType ; public ClassFile enclosingClassFile ; public byte [ ] header ; public int headerOffset ; public Set innerClassesBindings ; public int methodCount ; public int methodCountOffset ; boolean isShared = false ; public int produceAttributes ; public SourceTypeBinding referenceBinding ; public boolean isNestedType ; public long targetJDK ; public List missingTypes = null ; public Set visitedTypes ; public static final int INITIAL_CONTENTS_SIZE = <NUM_LIT> ; public static final int INITIAL_HEADER_SIZE = <NUM_LIT> ; public static final int INNER_CLASSES_SIZE = <NUM_LIT:5> ; public static void createProblemType ( TypeDeclaration typeDeclaration , CompilationResult unitResult ) { SourceTypeBinding typeBinding = typeDeclaration . binding ; ClassFile classFile = ClassFile . getNewInstance ( typeBinding ) ; classFile . initialize ( typeBinding , null , true ) ; if ( typeBinding . hasMemberTypes ( ) ) { ReferenceBinding [ ] members = typeBinding . memberTypes ; for ( int i = <NUM_LIT:0> , l = members . length ; i < l ; i ++ ) classFile . recordInnerClasses ( members [ i ] ) ; } if ( typeBinding . isNestedType ( ) ) { classFile . recordInnerClasses ( typeBinding ) ; } TypeVariableBinding [ ] typeVariables = typeBinding . typeVariables ( ) ; for ( int i = <NUM_LIT:0> , max = typeVariables . length ; i < max ; i ++ ) { TypeVariableBinding typeVariableBinding = typeVariables [ i ] ; if ( ( typeVariableBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( classFile , typeVariableBinding ) ; } } FieldBinding [ ] fields = typeBinding . fields ( ) ; if ( ( fields != null ) && ( fields != Binding . NO_FIELDS ) ) { classFile . addFieldInfos ( ) ; } else { classFile . contents [ classFile . contentsOffset ++ ] = <NUM_LIT:0> ; classFile . contents [ classFile . contentsOffset ++ ] = <NUM_LIT:0> ; } classFile . setForMethodInfos ( ) ; int problemsLength ; CategorizedProblem [ ] problems = unitResult . getErrors ( ) ; if ( problems == null ) { problems = new CategorizedProblem [ <NUM_LIT:0> ] ; } CategorizedProblem [ ] problemsCopy = new CategorizedProblem [ problemsLength = problems . length ] ; System . arraycopy ( problems , <NUM_LIT:0> , problemsCopy , <NUM_LIT:0> , problemsLength ) ; AbstractMethodDeclaration [ ] methodDecls = typeDeclaration . methods ; if ( methodDecls != null ) { if ( typeBinding . isInterface ( ) ) { classFile . addProblemClinit ( problemsCopy ) ; for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { AbstractMethodDeclaration methodDecl = methodDecls [ i ] ; MethodBinding method = methodDecl . binding ; if ( method == null || method . isConstructor ( ) ) continue ; method . modifiers = ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract ; classFile . addAbstractMethod ( methodDecl , method ) ; } } else { for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { AbstractMethodDeclaration methodDecl = methodDecls [ i ] ; MethodBinding method = methodDecl . binding ; if ( method == null ) continue ; if ( method . isConstructor ( ) ) { classFile . addProblemConstructor ( methodDecl , method , problemsCopy ) ; } else if ( method . isAbstract ( ) ) { classFile . addAbstractMethod ( methodDecl , method ) ; } else { classFile . addProblemMethod ( methodDecl , method , problemsCopy ) ; } } } classFile . addDefaultAbstractMethods ( ) ; } if ( typeDeclaration . memberTypes != null ) { for ( int i = <NUM_LIT:0> , max = typeDeclaration . memberTypes . length ; i < max ; i ++ ) { TypeDeclaration memberType = typeDeclaration . memberTypes [ i ] ; if ( memberType . binding != null ) { ClassFile . createProblemType ( memberType , unitResult ) ; } } } classFile . addAttributes ( ) ; unitResult . record ( typeBinding . constantPoolName ( ) , classFile ) ; } public static ClassFile getNewInstance ( SourceTypeBinding typeBinding ) { LookupEnvironment env = typeBinding . scope . environment ( ) ; return env . classFilePool . acquire ( typeBinding ) ; } protected ClassFile ( ) { } public ClassFile ( SourceTypeBinding typeBinding ) { this . constantPool = new ConstantPool ( this ) ; final CompilerOptions options = typeBinding . scope . compilerOptions ( ) ; this . targetJDK = options . targetJDK ; this . produceAttributes = options . produceDebugAttributes ; this . referenceBinding = typeBinding ; this . isNestedType = typeBinding . isNestedType ( ) ; if ( this . targetJDK >= ClassFileConstants . JDK1_6 ) { this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP_TABLE ; this . codeStream = new StackMapFrameCodeStream ( this ) ; } else if ( this . targetJDK == ClassFileConstants . CLDC_1_1 ) { this . targetJDK = ClassFileConstants . JDK1_1 ; this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP ; this . codeStream = new StackMapFrameCodeStream ( this ) ; } else { this . codeStream = new CodeStream ( this ) ; } initByteArrays ( ) ; } public void addAbstractMethod ( AbstractMethodDeclaration method , MethodBinding methodBinding ) { this . generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = this . generateMethodInfoAttributes ( methodBinding ) ; completeMethodInfo ( methodBinding , methodAttributeOffset , attributeNumber ) ; } public void addAttributes ( ) { this . contents [ this . methodCountOffset ++ ] = ( byte ) ( this . methodCount > > <NUM_LIT:8> ) ; this . contents [ this . methodCountOffset ] = ( byte ) this . methodCount ; int attributesNumber = <NUM_LIT:0> ; int attributeOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ) { String fullFileName = new String ( this . referenceBinding . scope . referenceCompilationUnit ( ) . getFileName ( ) ) ; fullFileName = fullFileName . replace ( '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; int lastIndex = fullFileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; if ( lastIndex != - <NUM_LIT:1> ) { fullFileName = fullFileName . substring ( lastIndex + <NUM_LIT:1> , fullFileName . length ( ) ) ; } attributesNumber += generateSourceAttribute ( fullFileName ) ; } if ( this . referenceBinding . isDeprecated ( ) ) { attributesNumber += generateDeprecatedAttribute ( ) ; } char [ ] genericSignature = this . referenceBinding . genericSignature ( ) ; if ( genericSignature != null ) { attributesNumber += generateSignatureAttribute ( genericSignature ) ; } if ( this . targetJDK >= ClassFileConstants . JDK1_5 && this . referenceBinding . isNestedType ( ) && ! this . referenceBinding . isMemberType ( ) ) { attributesNumber += generateEnclosingMethodAttribute ( ) ; } if ( this . targetJDK >= ClassFileConstants . JDK1_4 ) { TypeDeclaration typeDeclaration = this . referenceBinding . scope . referenceContext ; if ( typeDeclaration != null ) { final Annotation [ ] annotations = typeDeclaration . annotations ; if ( annotations != null ) { attributesNumber += generateRuntimeAnnotations ( annotations ) ; } } } if ( this . referenceBinding . isHierarchyInconsistent ( ) ) { ReferenceBinding superclass = this . referenceBinding . superclass ; if ( superclass != null ) { this . missingTypes = superclass . collectMissingTypes ( this . missingTypes ) ; } ReferenceBinding [ ] superInterfaces = this . referenceBinding . superInterfaces ( ) ; for ( int i = <NUM_LIT:0> , max = superInterfaces . length ; i < max ; i ++ ) { this . missingTypes = superInterfaces [ i ] . collectMissingTypes ( this . missingTypes ) ; } attributesNumber += generateHierarchyInconsistentAttribute ( ) ; } int numberOfInnerClasses = this . innerClassesBindings == null ? <NUM_LIT:0> : this . innerClassesBindings . size ( ) ; if ( numberOfInnerClasses != <NUM_LIT:0> ) { ReferenceBinding [ ] innerClasses = new ReferenceBinding [ numberOfInnerClasses ] ; this . innerClassesBindings . toArray ( innerClasses ) ; Arrays . sort ( innerClasses , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { TypeBinding binding1 = ( TypeBinding ) o1 ; TypeBinding binding2 = ( TypeBinding ) o2 ; return CharOperation . compareTo ( binding1 . constantPoolName ( ) , binding2 . constantPoolName ( ) ) ; } } ) ; attributesNumber += generateInnerClassAttribute ( numberOfInnerClasses , innerClasses ) ; } if ( this . missingTypes != null ) { generateMissingTypesAttribute ( ) ; attributesNumber ++ ; } if ( attributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ attributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ attributeOffset ] = ( byte ) attributesNumber ; this . header = this . constantPool . poolContent ; this . headerOffset = this . constantPool . currentOffset ; int constantPoolCount = this . constantPool . currentIndex ; this . header [ this . constantPoolOffset ++ ] = ( byte ) ( constantPoolCount > > <NUM_LIT:8> ) ; this . header [ this . constantPoolOffset ] = ( byte ) constantPoolCount ; } public void addDefaultAbstractMethods ( ) { MethodBinding [ ] defaultAbstractMethods = this . referenceBinding . getDefaultAbstractMethods ( ) ; for ( int i = <NUM_LIT:0> , max = defaultAbstractMethods . length ; i < max ; i ++ ) { MethodBinding methodBinding = defaultAbstractMethods [ i ] ; generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; completeMethodInfo ( methodBinding , methodAttributeOffset , attributeNumber ) ; } } private int addFieldAttributes ( FieldBinding fieldBinding , int fieldAttributeOffset ) { int attributesNumber = <NUM_LIT:0> ; Constant fieldConstant = fieldBinding . constant ( ) ; if ( fieldConstant != Constant . NotAConstant ) { attributesNumber += generateConstantValueAttribute ( fieldConstant , fieldBinding , fieldAttributeOffset ) ; } if ( this . targetJDK < ClassFileConstants . JDK1_5 && fieldBinding . isSynthetic ( ) ) { attributesNumber += generateSyntheticAttribute ( ) ; } if ( fieldBinding . isDeprecated ( ) ) { attributesNumber += generateDeprecatedAttribute ( ) ; } char [ ] genericSignature = fieldBinding . genericSignature ( ) ; if ( genericSignature != null ) { attributesNumber += generateSignatureAttribute ( genericSignature ) ; } if ( this . targetJDK >= ClassFileConstants . JDK1_4 ) { FieldDeclaration fieldDeclaration = fieldBinding . sourceField ( ) ; if ( fieldDeclaration != null ) { Annotation [ ] annotations = fieldDeclaration . annotations ; if ( annotations != null ) { attributesNumber += generateRuntimeAnnotations ( annotations ) ; } } } if ( ( fieldBinding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . missingTypes = fieldBinding . type . collectMissingTypes ( this . missingTypes ) ; } return attributesNumber ; } private void addFieldInfo ( FieldBinding fieldBinding ) { if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int accessFlags = fieldBinding . getAccessFlags ( ) ; if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { accessFlags &= ~ ClassFileConstants . AccSynthetic ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; int nameIndex = this . constantPool . literalIndex ( fieldBinding . name ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; int descriptorIndex = this . constantPool . literalIndex ( fieldBinding . type ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) descriptorIndex ; int fieldAttributeOffset = this . contentsOffset ; int attributeNumber = <NUM_LIT:0> ; this . contentsOffset += <NUM_LIT:2> ; attributeNumber += addFieldAttributes ( fieldBinding , fieldAttributeOffset ) ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ fieldAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ fieldAttributeOffset ] = ( byte ) attributeNumber ; } public void addFieldInfos ( ) { SourceTypeBinding currentBinding = this . referenceBinding ; FieldBinding [ ] syntheticFields = currentBinding . syntheticFields ( ) ; int fieldCount = currentBinding . fieldCount ( ) + ( syntheticFields == null ? <NUM_LIT:0> : syntheticFields . length ) ; if ( fieldCount > <NUM_LIT> ) { this . referenceBinding . scope . problemReporter ( ) . tooManyFields ( this . referenceBinding . scope . referenceType ( ) ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( fieldCount > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) fieldCount ; FieldDeclaration [ ] fieldDecls = currentBinding . scope . referenceContext . fields ; for ( int i = <NUM_LIT:0> , max = fieldDecls == null ? <NUM_LIT:0> : fieldDecls . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDecls [ i ] ; if ( fieldDecl . binding != null ) { addFieldInfo ( fieldDecl . binding ) ; } } if ( syntheticFields != null ) { for ( int i = <NUM_LIT:0> , max = syntheticFields . length ; i < max ; i ++ ) { addFieldInfo ( syntheticFields [ i ] ) ; } } } private void addMissingAbstractProblemMethod ( MethodDeclaration methodDeclaration , MethodBinding methodBinding , CategorizedProblem problem , CompilationResult compilationResult ) { generateMethodInfoHeader ( methodBinding , methodBinding . modifiers & ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccNative | ClassFileConstants . AccAbstract ) ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; attributeNumber ++ ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; String problemString = buffer . toString ( ) ; this . codeStream . init ( this ) ; this . codeStream . preserveUnusedLocals = true ; this . codeStream . initializeMaxLocals ( methodBinding ) ; this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; completeCodeAttributeForMissingAbstractProblemMethod ( methodBinding , codeAttributeOffset , compilationResult . getLineSeparatorPositions ( ) , problem . getSourceLineNumber ( ) ) ; completeMethodInfo ( methodBinding , methodAttributeOffset , attributeNumber ) ; } public void addProblemClinit ( CategorizedProblem [ ] problems ) { generateMethodInfoHeaderForClinit ( ) ; this . contentsOffset -= <NUM_LIT:2> ; int attributeOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int attributeNumber = <NUM_LIT:0> ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; this . codeStream . resetForProblemClinit ( this ) ; String problemString = "<STR_LIT>" ; int problemLine = <NUM_LIT:0> ; if ( problems != null ) { int max = problems . length ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( ( problem != null ) && ( problem . isError ( ) ) ) { buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; count ++ ; if ( problemLine == <NUM_LIT:0> ) { problemLine = problem . getSourceLineNumber ( ) ; } problems [ i ] = null ; } } if ( count > <NUM_LIT:1> ) { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblems ) ; } else { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; } problemString = buffer . toString ( ) ; } this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; attributeNumber ++ ; completeCodeAttributeForClinit ( codeAttributeOffset , problemLine ) ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ attributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ attributeOffset ] = ( byte ) attributeNumber ; } public void addProblemConstructor ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems ) { generateMethodInfoHeader ( methodBinding , methodBinding . modifiers & ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccNative | ClassFileConstants . AccAbstract ) ) ; int methodAttributeOffset = this . contentsOffset ; int attributesNumber = generateMethodInfoAttributes ( methodBinding ) ; attributesNumber ++ ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; this . codeStream . reset ( method , this ) ; String problemString = "<STR_LIT>" ; int problemLine = <NUM_LIT:0> ; if ( problems != null ) { int max = problems . length ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( ( problem != null ) && ( problem . isError ( ) ) ) { buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; count ++ ; if ( problemLine == <NUM_LIT:0> ) { problemLine = problem . getSourceLineNumber ( ) ; } } } if ( count > <NUM_LIT:1> ) { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblems ) ; } else { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; } problemString = buffer . toString ( ) ; } this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; completeCodeAttributeForProblemMethod ( method , methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) , problemLine ) ; completeMethodInfo ( methodBinding , methodAttributeOffset , attributesNumber ) ; } public void addProblemConstructor ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems , int savedOffset ) { this . contentsOffset = savedOffset ; this . methodCount -- ; addProblemConstructor ( method , methodBinding , problems ) ; } public void addProblemMethod ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems ) { if ( methodBinding . isAbstract ( ) && methodBinding . declaringClass . isInterface ( ) ) { method . abort ( ProblemSeverities . AbortType , null ) ; } generateMethodInfoHeader ( methodBinding , methodBinding . modifiers & ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccNative | ClassFileConstants . AccAbstract ) ) ; int methodAttributeOffset = this . contentsOffset ; int attributesNumber = generateMethodInfoAttributes ( methodBinding ) ; attributesNumber ++ ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; this . codeStream . reset ( method , this ) ; String problemString = "<STR_LIT>" ; int problemLine = <NUM_LIT:0> ; if ( problems != null ) { int max = problems . length ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( ( problem != null ) && ( problem . isError ( ) ) && ( problem . getSourceStart ( ) >= method . declarationSourceStart ) && ( problem . getSourceEnd ( ) <= method . declarationSourceEnd ) ) { buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; count ++ ; if ( problemLine == <NUM_LIT:0> ) { problemLine = problem . getSourceLineNumber ( ) ; } problems [ i ] = null ; } } if ( count > <NUM_LIT:1> ) { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblems ) ; } else { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; } problemString = buffer . toString ( ) ; } this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; completeCodeAttributeForProblemMethod ( method , methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) , problemLine ) ; completeMethodInfo ( methodBinding , methodAttributeOffset , attributesNumber ) ; } public void addProblemMethod ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems , int savedOffset ) { this . contentsOffset = savedOffset ; this . methodCount -- ; addProblemMethod ( method , methodBinding , problems ) ; } public void addSpecialMethods ( ) { generateMissingAbstractMethods ( this . referenceBinding . scope . referenceType ( ) . missingAbstractMethods , this . referenceBinding . scope . referenceCompilationUnit ( ) . compilationResult ) ; MethodBinding [ ] defaultAbstractMethods = this . referenceBinding . getDefaultAbstractMethods ( ) ; for ( int i = <NUM_LIT:0> , max = defaultAbstractMethods . length ; i < max ; i ++ ) { MethodBinding methodBinding = defaultAbstractMethods [ i ] ; generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; completeMethodInfo ( methodBinding , methodAttributeOffset , attributeNumber ) ; } SyntheticMethodBinding [ ] syntheticMethods = this . referenceBinding . syntheticMethods ( ) ; if ( syntheticMethods != null ) { for ( int i = <NUM_LIT:0> , max = syntheticMethods . length ; i < max ; i ++ ) { SyntheticMethodBinding syntheticMethod = syntheticMethods [ i ] ; switch ( syntheticMethod . purpose ) { case SyntheticMethodBinding . FieldReadAccess : case SyntheticMethodBinding . SuperFieldReadAccess : addSyntheticFieldReadAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . FieldWriteAccess : case SyntheticMethodBinding . SuperFieldWriteAccess : addSyntheticFieldWriteAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . MethodAccess : case SyntheticMethodBinding . SuperMethodAccess : case SyntheticMethodBinding . BridgeMethod : addSyntheticMethodAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . ConstructorAccess : addSyntheticConstructorAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . EnumValues : addSyntheticEnumValuesMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . EnumValueOf : addSyntheticEnumValueOfMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . SwitchTable : addSyntheticSwitchTable ( syntheticMethod ) ; break ; case SyntheticMethodBinding . TooManyEnumsConstants : addSyntheticEnumInitializationMethod ( syntheticMethod ) ; } } } } public void addSyntheticConstructorAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForConstructorAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticEnumValueOfMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForEnumValueOf ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticEnumValuesMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForEnumValues ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticEnumInitializationMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForEnumInitializationMethod ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticFieldReadAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForFieldReadAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticFieldWriteAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForFieldWriteAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticMethodAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForMethodAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticSwitchTable ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttributes ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForSwitchTable ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( true , methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void completeCodeAttribute ( int codeAttributeOffset ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int code_length = this . codeStream . position ; if ( code_length > <NUM_LIT> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . bytecodeExceeds64KLimit ( this . codeStream . methodDeclaration ) ; } if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; boolean addStackMaps = ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ; ExceptionLabel [ ] exceptionLabels = this . codeStream . exceptionLabels ; int exceptionHandlersCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . codeStream . exceptionLabelsCounter ; i < length ; i ++ ) { exceptionHandlersCount += this . codeStream . exceptionLabels [ i ] . getCount ( ) / <NUM_LIT:2> ; } int exSize = exceptionHandlersCount * <NUM_LIT:8> + <NUM_LIT:2> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionHandlersCount > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionHandlersCount ; for ( int i = <NUM_LIT:0> , max = this . codeStream . exceptionLabelsCounter ; i < max ; i ++ ) { ExceptionLabel exceptionLabel = exceptionLabels [ i ] ; if ( exceptionLabel != null ) { int iRange = <NUM_LIT:0> , maxRange = exceptionLabel . getCount ( ) ; if ( ( maxRange & <NUM_LIT:1> ) != <NUM_LIT:0> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidExceptionAttribute , new String ( this . codeStream . methodDeclaration . selector ) ) , this . codeStream . methodDeclaration ) ; } while ( iRange < maxRange ) { int start = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( start > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) start ; int end = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( end > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) end ; int handlerPC = exceptionLabel . position ; if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . addFramePosition ( handlerPC ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( handlerPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) handlerPC ; if ( exceptionLabel . exceptionType == null ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } else { int nameIndex ; if ( exceptionLabel . exceptionType == TypeBinding . NULL ) { nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ; } else { nameIndex = this . constantPool . literalIndexForType ( exceptionLabel . exceptionType ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } } } } int codeAttributeAttributeOffset = localContentsOffset ; int attributesNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { attributesNumber += generateLineNumberAttribute ( ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { final boolean methodDeclarationIsStatic = this . codeStream . methodDeclaration . isStatic ( ) ; attributesNumber += generateLocalVariableTableAttribute ( code_length , methodDeclarationIsStatic , false ) ; } if ( addStackMaps ) { attributesNumber += generateStackMapTableAttribute ( this . codeStream . methodDeclaration . binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapAttribute ( this . codeStream . methodDeclaration . binding , code_length , codeAttributeOffset , max_locals , false ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributesNumber ; int codeAttributeLength = this . contentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; } public void completeCodeAttributeForClinit ( int codeAttributeOffset ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int code_length = this . codeStream . position ; if ( code_length > <NUM_LIT> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . bytecodeExceeds64KLimit ( this . codeStream . methodDeclaration . scope . referenceType ( ) ) ; } if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; boolean addStackMaps = ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ; ExceptionLabel [ ] exceptionLabels = this . codeStream . exceptionLabels ; int exceptionHandlersCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . codeStream . exceptionLabelsCounter ; i < length ; i ++ ) { exceptionHandlersCount += this . codeStream . exceptionLabels [ i ] . getCount ( ) / <NUM_LIT:2> ; } int exSize = exceptionHandlersCount * <NUM_LIT:8> + <NUM_LIT:2> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionHandlersCount > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionHandlersCount ; for ( int i = <NUM_LIT:0> , max = this . codeStream . exceptionLabelsCounter ; i < max ; i ++ ) { ExceptionLabel exceptionLabel = exceptionLabels [ i ] ; if ( exceptionLabel != null ) { int iRange = <NUM_LIT:0> , maxRange = exceptionLabel . getCount ( ) ; if ( ( maxRange & <NUM_LIT:1> ) != <NUM_LIT:0> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidExceptionAttribute , new String ( this . codeStream . methodDeclaration . selector ) ) , this . codeStream . methodDeclaration ) ; } while ( iRange < maxRange ) { int start = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( start > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) start ; int end = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( end > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) end ; int handlerPC = exceptionLabel . position ; this . contents [ localContentsOffset ++ ] = ( byte ) ( handlerPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) handlerPC ; if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . addFramePosition ( handlerPC ) ; } if ( exceptionLabel . exceptionType == null ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } else { int nameIndex ; if ( exceptionLabel . exceptionType == TypeBinding . NULL ) { nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ; } else { nameIndex = this . constantPool . literalIndexForType ( exceptionLabel . exceptionType ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } } } } int codeAttributeAttributeOffset = localContentsOffset ; int attributesNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { attributesNumber += generateLineNumberAttribute ( ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { attributesNumber += generateLocalVariableTableAttribute ( code_length , true , false ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapTableAttribute ( null , code_length , codeAttributeOffset , max_locals , true ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapAttribute ( null , code_length , codeAttributeOffset , max_locals , true ) ; } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributesNumber ; int codeAttributeLength = this . contentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; } public void completeCodeAttributeForClinit ( int codeAttributeOffset , int problemLine ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int code_length = this . codeStream . position ; if ( code_length > <NUM_LIT> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . bytecodeExceeds64KLimit ( this . codeStream . methodDeclaration . scope . referenceType ( ) ) ; } if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; int codeAttributeAttributeOffset = localContentsOffset ; int attributesNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { attributesNumber += generateLineNumberAttribute ( problemLine ) ; } localContentsOffset = this . contentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; attributesNumber ++ ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapTableAttribute ( null , code_length , codeAttributeOffset , max_locals , true ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapAttribute ( null , code_length , codeAttributeOffset , max_locals , true ) ; } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributesNumber ; int codeAttributeLength = this . contentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; } public void completeCodeAttributeForMissingAbstractProblemMethod ( MethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes , int problemLine ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; int code_length = this . codeStream . position ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; if ( localContentsOffset + <NUM_LIT> >= this . contents . length ) { resizeContents ( <NUM_LIT> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; int codeAttributeAttributeOffset = localContentsOffset ; int attributesNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { if ( problemLine == <NUM_LIT:0> ) { problemLine = Util . getLineNumber ( binding . sourceStart ( ) , startLineIndexes , <NUM_LIT:0> , startLineIndexes . length - <NUM_LIT:1> ) ; } attributesNumber += generateLineNumberAttribute ( problemLine ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapTableAttribute ( binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapAttribute ( binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributesNumber ; int codeAttributeLength = this . contentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; } public void completeCodeAttributeForProblemMethod ( AbstractMethodDeclaration method , MethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes , int problemLine ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; int code_length = this . codeStream . position ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; if ( localContentsOffset + <NUM_LIT> >= this . contents . length ) { resizeContents ( <NUM_LIT> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; int codeAttributeAttributeOffset = localContentsOffset ; int attributesNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { if ( problemLine == <NUM_LIT:0> ) { problemLine = Util . getLineNumber ( binding . sourceStart ( ) , startLineIndexes , <NUM_LIT:0> , startLineIndexes . length - <NUM_LIT:1> ) ; } attributesNumber += generateLineNumberAttribute ( problemLine ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { final boolean methodDeclarationIsStatic = this . codeStream . methodDeclaration . isStatic ( ) ; attributesNumber += generateLocalVariableTableAttribute ( code_length , methodDeclarationIsStatic , false ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapTableAttribute ( binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapAttribute ( binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributesNumber ; int codeAttributeLength = this . contentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; } public void completeCodeAttributeForSyntheticMethod ( boolean hasExceptionHandlers , SyntheticMethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; int code_length = this . codeStream . position ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; if ( ( localContentsOffset + <NUM_LIT> ) >= this . contents . length ) { resizeContents ( <NUM_LIT> ) ; } boolean addStackMaps = ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ; if ( hasExceptionHandlers ) { ExceptionLabel [ ] exceptionLabels = this . codeStream . exceptionLabels ; int exceptionHandlersCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . codeStream . exceptionLabelsCounter ; i < length ; i ++ ) { exceptionHandlersCount += this . codeStream . exceptionLabels [ i ] . getCount ( ) / <NUM_LIT:2> ; } int exSize = exceptionHandlersCount * <NUM_LIT:8> + <NUM_LIT:2> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionHandlersCount > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionHandlersCount ; for ( int i = <NUM_LIT:0> , max = this . codeStream . exceptionLabelsCounter ; i < max ; i ++ ) { ExceptionLabel exceptionLabel = exceptionLabels [ i ] ; if ( exceptionLabel != null ) { int iRange = <NUM_LIT:0> , maxRange = exceptionLabel . getCount ( ) ; if ( ( maxRange & <NUM_LIT:1> ) != <NUM_LIT:0> ) { this . referenceBinding . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidExceptionAttribute , new String ( binding . selector ) , this . referenceBinding . scope . problemReporter ( ) . referenceContext ) ) ; } while ( iRange < maxRange ) { int start = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( start > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) start ; int end = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( end > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) end ; int handlerPC = exceptionLabel . position ; if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . addFramePosition ( handlerPC ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( handlerPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) handlerPC ; if ( exceptionLabel . exceptionType == null ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } else { int nameIndex ; switch ( exceptionLabel . exceptionType . id ) { case T_null : nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ; break ; case T_long : nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangNoSuchFieldErrorConstantPoolName ) ; break ; default : nameIndex = this . constantPool . literalIndexForType ( exceptionLabel . exceptionType ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } } } } } else { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } int codeAttributeAttributeOffset = localContentsOffset ; int attributesNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contentsOffset = localContentsOffset ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { int lineNumber = Util . getLineNumber ( binding . sourceStart , startLineIndexes , <NUM_LIT:0> , startLineIndexes . length - <NUM_LIT:1> ) ; attributesNumber += generateLineNumberAttribute ( lineNumber ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { final boolean methodDeclarationIsStatic = binding . isStatic ( ) ; attributesNumber += generateLocalVariableTableAttribute ( code_length , methodDeclarationIsStatic , true ) ; } if ( addStackMaps ) { attributesNumber += generateStackMapTableAttribute ( binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { attributesNumber += generateStackMapAttribute ( binding , code_length , codeAttributeOffset , max_locals , false ) ; } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributesNumber ; int codeAttributeLength = this . contentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; } public void completeCodeAttributeForSyntheticMethod ( SyntheticMethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes ) { this . completeCodeAttributeForSyntheticMethod ( false , binding , codeAttributeOffset , startLineIndexes ) ; } public void completeMethodInfo ( MethodBinding binding , int methodAttributeOffset , int attributesNumber ) { this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributesNumber ; } public char [ ] fileName ( ) { return this . constantPool . UTF8Cache . returnKeyFor ( <NUM_LIT:2> ) ; } private void generateAnnotation ( Annotation annotation , int currentOffset ) { int startingContentsOffset = currentOffset ; if ( this . contentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } TypeBinding annotationTypeBinding = annotation . resolvedType ; if ( annotationTypeBinding == null ) { this . contentsOffset = startingContentsOffset ; return ; } final int typeIndex = this . constantPool . literalIndex ( annotationTypeBinding . signature ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( typeIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) typeIndex ; if ( annotation instanceof NormalAnnotation ) { NormalAnnotation normalAnnotation = ( NormalAnnotation ) annotation ; MemberValuePair [ ] memberValuePairs = normalAnnotation . memberValuePairs ; if ( memberValuePairs != null ) { final int memberValuePairsLength = memberValuePairs . length ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( memberValuePairsLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) memberValuePairsLength ; for ( int i = <NUM_LIT:0> ; i < memberValuePairsLength ; i ++ ) { MemberValuePair memberValuePair = memberValuePairs [ i ] ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } final int elementNameIndex = this . constantPool . literalIndex ( memberValuePair . name ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( elementNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) elementNameIndex ; MethodBinding methodBinding = memberValuePair . binding ; if ( methodBinding == null ) { this . contentsOffset = startingContentsOffset ; } else { try { generateElementValue ( memberValuePair . value , methodBinding . returnType , startingContentsOffset ) ; } catch ( ClassCastException e ) { this . contentsOffset = startingContentsOffset ; } catch ( ShouldNotImplement e ) { this . contentsOffset = startingContentsOffset ; } } } } else { this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; } } else if ( annotation instanceof SingleMemberAnnotation ) { SingleMemberAnnotation singleMemberAnnotation = ( SingleMemberAnnotation ) annotation ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:1> ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } final int elementNameIndex = this . constantPool . literalIndex ( VALUE ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( elementNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) elementNameIndex ; MethodBinding methodBinding = singleMemberAnnotation . memberValuePairs ( ) [ <NUM_LIT:0> ] . binding ; if ( methodBinding == null ) { this . contentsOffset = startingContentsOffset ; } else { try { generateElementValue ( singleMemberAnnotation . memberValue , methodBinding . returnType , startingContentsOffset ) ; } catch ( ClassCastException e ) { this . contentsOffset = startingContentsOffset ; } catch ( ShouldNotImplement e ) { this . contentsOffset = startingContentsOffset ; } } } else { this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; } } private int generateAnnotationDefaultAttribute ( AnnotationMethodDeclaration declaration , int attributeOffset ) { int attributesNumber = <NUM_LIT:0> ; int annotationDefaultNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . AnnotationDefaultName ) ; if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( annotationDefaultNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) annotationDefaultNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; generateElementValue ( declaration . defaultValue , declaration . binding . returnType , attributeOffset ) ; if ( this . contentsOffset != attributeOffset ) { int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } return attributesNumber ; } public void generateCodeAttributeHeader ( ) { if ( this . contentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int constantValueNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . CodeName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( constantValueNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) constantValueNameIndex ; this . contentsOffset += <NUM_LIT:12> ; } private int generateConstantValueAttribute ( Constant fieldConstant , FieldBinding fieldBinding , int fieldAttributeOffset ) { int localContentsOffset = this . contentsOffset ; int attributesNumber = <NUM_LIT:1> ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int constantValueNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . ConstantValueName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( constantValueNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) constantValueNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:2> ; switch ( fieldConstant . typeID ( ) ) { case T_boolean : int booleanValueIndex = this . constantPool . literalIndex ( fieldConstant . booleanValue ( ) ? <NUM_LIT:1> : <NUM_LIT:0> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( booleanValueIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) booleanValueIndex ; break ; case T_byte : case T_char : case T_int : case T_short : int integerValueIndex = this . constantPool . literalIndex ( fieldConstant . intValue ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_float : int floatValueIndex = this . constantPool . literalIndex ( fieldConstant . floatValue ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( floatValueIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) floatValueIndex ; break ; case T_double : int doubleValueIndex = this . constantPool . literalIndex ( fieldConstant . doubleValue ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( doubleValueIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) doubleValueIndex ; break ; case T_long : int longValueIndex = this . constantPool . literalIndex ( fieldConstant . longValue ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( longValueIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) longValueIndex ; break ; case T_JavaLangString : int stringValueIndex = this . constantPool . literalIndex ( ( ( StringConstant ) fieldConstant ) . stringValue ( ) ) ; if ( stringValueIndex == - <NUM_LIT:1> ) { if ( ! this . creatingProblemType ) { TypeDeclaration typeDeclaration = this . referenceBinding . scope . referenceContext ; FieldDeclaration [ ] fieldDecls = typeDeclaration . fields ; int max = fieldDecls == null ? <NUM_LIT:0> : fieldDecls . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { if ( fieldDecls [ i ] . binding == fieldBinding ) { typeDeclaration . scope . problemReporter ( ) . stringConstantIsExceedingUtf8Limit ( fieldDecls [ i ] ) ; } } } else { this . contentsOffset = fieldAttributeOffset ; attributesNumber = <NUM_LIT:0> ; } } else { this . contents [ localContentsOffset ++ ] = ( byte ) ( stringValueIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stringValueIndex ; } } this . contentsOffset = localContentsOffset ; return attributesNumber ; } private int generateDeprecatedAttribute ( ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int deprecatedAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . DeprecatedName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( deprecatedAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) deprecatedAttributeNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private void generateElementValue ( Expression defaultValue , TypeBinding memberValuePairReturnType , int attributeOffset ) { Constant constant = defaultValue . constant ; TypeBinding defaultValueBinding = defaultValue . resolvedType ; if ( defaultValueBinding == null ) { this . contentsOffset = attributeOffset ; } else { if ( memberValuePairReturnType . isArrayType ( ) && ! defaultValueBinding . isArrayType ( ) ) { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:[>' ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:1> ; } if ( constant != null && constant != Constant . NotAConstant ) { generateElementValue ( attributeOffset , defaultValue , constant , memberValuePairReturnType . leafComponentType ( ) ) ; } else { generateElementValueForNonConstantExpression ( defaultValue , attributeOffset , defaultValueBinding ) ; } } } private void generateElementValue ( int attributeOffset , Expression defaultValue , Constant constant , TypeBinding binding ) { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } switch ( binding . id ) { case T_boolean : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:Z>' ; int booleanValueIndex = this . constantPool . literalIndex ( constant . booleanValue ( ) ? <NUM_LIT:1> : <NUM_LIT:0> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( booleanValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) booleanValueIndex ; break ; case T_byte : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_char : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_int : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_short : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_float : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int floatValueIndex = this . constantPool . literalIndex ( constant . floatValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( floatValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) floatValueIndex ; break ; case T_double : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int doubleValueIndex = this . constantPool . literalIndex ( constant . doubleValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( doubleValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) doubleValueIndex ; break ; case T_long : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int longValueIndex = this . constantPool . literalIndex ( constant . longValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( longValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) longValueIndex ; break ; case T_JavaLangString : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int stringValueIndex = this . constantPool . literalIndex ( ( ( StringConstant ) constant ) . stringValue ( ) . toCharArray ( ) ) ; if ( stringValueIndex == - <NUM_LIT:1> ) { if ( ! this . creatingProblemType ) { TypeDeclaration typeDeclaration = this . referenceBinding . scope . referenceContext ; typeDeclaration . scope . problemReporter ( ) . stringConstantIsExceedingUtf8Limit ( defaultValue ) ; } else { this . contentsOffset = attributeOffset ; } } else { this . contents [ this . contentsOffset ++ ] = ( byte ) ( stringValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) stringValueIndex ; } } } private void generateElementValueForNonConstantExpression ( Expression defaultValue , int attributeOffset , TypeBinding defaultValueBinding ) { if ( defaultValueBinding != null ) { if ( defaultValueBinding . isEnum ( ) ) { if ( this . contentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:e>' ; FieldBinding fieldBinding = null ; if ( defaultValue instanceof QualifiedNameReference ) { QualifiedNameReference nameReference = ( QualifiedNameReference ) defaultValue ; fieldBinding = ( FieldBinding ) nameReference . binding ; } else if ( defaultValue instanceof SingleNameReference ) { SingleNameReference nameReference = ( SingleNameReference ) defaultValue ; fieldBinding = ( FieldBinding ) nameReference . binding ; } else { this . contentsOffset = attributeOffset ; } if ( fieldBinding != null ) { final int enumConstantTypeNameIndex = this . constantPool . literalIndex ( fieldBinding . type . signature ( ) ) ; final int enumConstantNameIndex = this . constantPool . literalIndex ( fieldBinding . name ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( enumConstantTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) enumConstantTypeNameIndex ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( enumConstantNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) enumConstantNameIndex ; } } else if ( defaultValueBinding . isAnnotationType ( ) ) { if ( this . contentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; generateAnnotation ( ( Annotation ) defaultValue , attributeOffset ) ; } else if ( defaultValueBinding . isArrayType ( ) ) { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:[>' ; if ( defaultValue instanceof ArrayInitializer ) { ArrayInitializer arrayInitializer = ( ArrayInitializer ) defaultValue ; int arrayLength = arrayInitializer . expressions != null ? arrayInitializer . expressions . length : <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( arrayLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) arrayLength ; for ( int i = <NUM_LIT:0> ; i < arrayLength ; i ++ ) { generateElementValue ( arrayInitializer . expressions [ i ] , defaultValueBinding . leafComponentType ( ) , attributeOffset ) ; } } else { this . contentsOffset = attributeOffset ; } } else { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:c>' ; if ( defaultValue instanceof ClassLiteralAccess ) { ClassLiteralAccess classLiteralAccess = ( ClassLiteralAccess ) defaultValue ; final int classInfoIndex = this . constantPool . literalIndex ( classLiteralAccess . targetType . signature ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( classInfoIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) classInfoIndex ; } else { this . contentsOffset = attributeOffset ; } } } else { this . contentsOffset = attributeOffset ; } } private int generateEnclosingMethodAttribute ( ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } int enclosingMethodAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . EnclosingMethodName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( enclosingMethodAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) enclosingMethodAttributeNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:4> ; int enclosingTypeIndex = this . constantPool . literalIndexForType ( this . referenceBinding . enclosingType ( ) . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( enclosingTypeIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) enclosingTypeIndex ; byte methodIndexByte1 = <NUM_LIT:0> ; byte methodIndexByte2 = <NUM_LIT:0> ; if ( this . referenceBinding instanceof LocalTypeBinding ) { MethodBinding methodBinding = ( ( LocalTypeBinding ) this . referenceBinding ) . enclosingMethod ; if ( methodBinding != null ) { int enclosingMethodIndex = this . constantPool . literalIndexForNameAndType ( methodBinding . selector , methodBinding . signature ( this ) ) ; methodIndexByte1 = ( byte ) ( enclosingMethodIndex > > <NUM_LIT:8> ) ; methodIndexByte2 = ( byte ) enclosingMethodIndex ; } } this . contents [ localContentsOffset ++ ] = methodIndexByte1 ; this . contents [ localContentsOffset ++ ] = methodIndexByte2 ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateExceptionsAttribute ( ReferenceBinding [ ] thrownsExceptions ) { int localContentsOffset = this . contentsOffset ; int length = thrownsExceptions . length ; int exSize = <NUM_LIT:8> + length * <NUM_LIT:2> ; if ( exSize + this . contentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } int exceptionNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . ExceptionsName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionNameIndex ; int attributeLength = length * <NUM_LIT:2> + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) attributeLength ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { int exceptionIndex = this . constantPool . literalIndexForType ( thrownsExceptions [ i ] ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionIndex ; } this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateHierarchyInconsistentAttribute ( ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int inconsistentHierarchyNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . InconsistentHierarchy ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( inconsistentHierarchyNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) inconsistentHierarchyNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateInnerClassAttribute ( int numberOfInnerClasses , ReferenceBinding [ ] innerClasses ) { int localContentsOffset = this . contentsOffset ; int exSize = <NUM_LIT:8> * numberOfInnerClasses + <NUM_LIT:8> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } int attributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . InnerClassName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( attributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) attributeNameIndex ; int value = ( numberOfInnerClasses << <NUM_LIT:3> ) + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) value ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfInnerClasses > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfInnerClasses ; for ( int i = <NUM_LIT:0> ; i < numberOfInnerClasses ; i ++ ) { ReferenceBinding innerClass = innerClasses [ i ] ; int accessFlags = innerClass . getAccessFlags ( ) ; int innerClassIndex = this . constantPool . literalIndexForType ( innerClass . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( innerClassIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) innerClassIndex ; if ( innerClass . isMemberType ( ) ) { int outerClassIndex = this . constantPool . literalIndexForType ( innerClass . enclosingType ( ) . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( outerClassIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) outerClassIndex ; } else { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } if ( ! innerClass . isAnonymousType ( ) ) { int nameIndex = this . constantPool . literalIndex ( innerClass . sourceName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } else { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } if ( innerClass . isAnonymousType ( ) ) { accessFlags &= ~ ClassFileConstants . AccFinal ; } else if ( innerClass . isMemberType ( ) && innerClass . isInterface ( ) ) { accessFlags |= ClassFileConstants . AccStatic ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) accessFlags ; } this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateLineNumberAttribute ( ) { int localContentsOffset = this . contentsOffset ; int attributesNumber = <NUM_LIT:0> ; int [ ] pcToSourceMapTable ; if ( ( ( pcToSourceMapTable = this . codeStream . pcToSourceMap ) != null ) && ( this . codeStream . pcToSourceMapSize != <NUM_LIT:0> ) ) { int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; int lineNumberTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int numberOfEntries = <NUM_LIT:0> ; int length = this . codeStream . pcToSourceMapSize ; for ( int i = <NUM_LIT:0> ; i < length ; ) { if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int pc = pcToSourceMapTable [ i ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( pc > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) pc ; int lineNumber = pcToSourceMapTable [ i ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumber > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumber ; numberOfEntries ++ ; } int lineNumberAttr_length = numberOfEntries * <NUM_LIT:4> + <NUM_LIT:2> ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:24> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:16> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:8> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) lineNumberAttr_length ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) numberOfEntries ; attributesNumber = <NUM_LIT:1> ; } this . contentsOffset = localContentsOffset ; return attributesNumber ; } private int generateLineNumberAttribute ( int problemLine ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:12> >= this . contents . length ) { resizeContents ( <NUM_LIT:12> ) ; } int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:6> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:1> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( problemLine > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) problemLine ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateLocalVariableTableAttribute ( int code_length , boolean methodDeclarationIsStatic , boolean isSynthetic ) { int attributesNumber = <NUM_LIT:0> ; int localContentsOffset = this . contentsOffset ; int numberOfEntries = <NUM_LIT:0> ; int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; int maxOfEntries = <NUM_LIT:8> + <NUM_LIT:10> * ( methodDeclarationIsStatic ? <NUM_LIT:0> : <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:0> ; i < this . codeStream . allLocalsCounter ; i ++ ) { LocalVariableBinding localVariableBinding = this . codeStream . locals [ i ] ; maxOfEntries += <NUM_LIT:10> * localVariableBinding . initializationCount ; } if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; int localVariableTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int nameIndex ; int descriptorIndex ; SourceTypeBinding declaringClassBinding = null ; if ( ! methodDeclarationIsStatic && ! isSynthetic ) { numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( ConstantPool . This ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; declaringClassBinding = ( SourceTypeBinding ) this . codeStream . methodDeclaration . binding . declaringClass ; descriptorIndex = this . constantPool . literalIndex ( declaringClassBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } int genericLocalVariablesCounter = <NUM_LIT:0> ; LocalVariableBinding [ ] genericLocalVariables = null ; int numberOfGenericEntries = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; int initializationCount = localVariable . initializationCount ; if ( initializationCount == <NUM_LIT:0> ) continue ; if ( localVariable . declaration == null ) continue ; final TypeBinding localVariableTypeBinding = localVariable . type ; boolean isParameterizedType = localVariableTypeBinding . isParameterizedType ( ) || localVariableTypeBinding . isTypeVariable ( ) ; if ( isParameterizedType ) { if ( genericLocalVariables == null ) { genericLocalVariables = new LocalVariableBinding [ max ] ; } genericLocalVariables [ genericLocalVariablesCounter ++ ] = localVariable ; } for ( int j = <NUM_LIT:0> ; j < initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { if ( endPC == - <NUM_LIT:1> ) { localVariable . declaringScope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidAttribute , new String ( localVariable . name ) ) , ( ASTNode ) localVariable . declaringScope . methodScope ( ) . referenceContext ) ; } if ( isParameterizedType ) { numberOfGenericEntries ++ ; } numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariableTypeBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } int value = numberOfEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) value ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ] = ( byte ) numberOfEntries ; attributesNumber ++ ; final boolean currentInstanceIsGeneric = ! methodDeclarationIsStatic && declaringClassBinding != null && declaringClassBinding . typeVariables != Binding . NO_TYPE_VARIABLES ; if ( genericLocalVariablesCounter != <NUM_LIT:0> || currentInstanceIsGeneric ) { numberOfGenericEntries += ( currentInstanceIsGeneric ? <NUM_LIT:1> : <NUM_LIT:0> ) ; maxOfEntries = <NUM_LIT:8> + numberOfGenericEntries * <NUM_LIT:10> ; if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } int localVariableTypeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTypeTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableTypeNameIndex ; value = numberOfGenericEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) value ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfGenericEntries > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfGenericEntries ; if ( currentInstanceIsGeneric ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( ConstantPool . This ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( declaringClassBinding . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } for ( int i = <NUM_LIT:0> ; i < genericLocalVariablesCounter ; i ++ ) { LocalVariableBinding localVariable = genericLocalVariables [ i ] ; for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariable . type . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } attributesNumber ++ ; } this . contentsOffset = localContentsOffset ; return attributesNumber ; } public int generateMethodInfoAttributes ( MethodBinding methodBinding ) { this . contentsOffset += <NUM_LIT:2> ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } ReferenceBinding [ ] thrownsExceptions ; int attributesNumber = <NUM_LIT:0> ; if ( ( thrownsExceptions = methodBinding . thrownExceptions ) != Binding . NO_EXCEPTIONS ) { attributesNumber += generateExceptionsAttribute ( thrownsExceptions ) ; } if ( methodBinding . isDeprecated ( ) ) { attributesNumber += generateDeprecatedAttribute ( ) ; } if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { if ( methodBinding . isSynthetic ( ) ) { attributesNumber += generateSyntheticAttribute ( ) ; } if ( methodBinding . isVarargs ( ) ) { attributesNumber += generateVarargsAttribute ( ) ; } } char [ ] genericSignature = methodBinding . genericSignature ( ) ; if ( genericSignature != null ) { attributesNumber += generateSignatureAttribute ( genericSignature ) ; } if ( this . targetJDK >= ClassFileConstants . JDK1_4 ) { AbstractMethodDeclaration methodDeclaration = methodBinding . sourceMethod ( ) ; if ( methodDeclaration != null ) { Annotation [ ] annotations = methodDeclaration . annotations ; if ( annotations != null ) { attributesNumber += generateRuntimeAnnotations ( annotations ) ; } if ( ( methodBinding . tagBits & TagBits . HasParameterAnnotations ) != <NUM_LIT:0> ) { Argument [ ] arguments = methodDeclaration . arguments ; if ( arguments != null ) { attributesNumber += generateRuntimeAnnotationsForParameters ( arguments ) ; } } } } if ( ( methodBinding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . missingTypes = methodBinding . collectMissingTypes ( this . missingTypes ) ; } return attributesNumber ; } public int generateMethodInfoAttributes ( MethodBinding methodBinding , AnnotationMethodDeclaration declaration ) { int attributesNumber = generateMethodInfoAttributes ( methodBinding ) ; int attributeOffset = this . contentsOffset ; if ( ( declaration . modifiers & ClassFileConstants . AccAnnotationDefault ) != <NUM_LIT:0> ) { attributesNumber += generateAnnotationDefaultAttribute ( declaration , attributeOffset ) ; } return attributesNumber ; } public void generateMethodInfoHeader ( MethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding , methodBinding . modifiers ) ; } public void generateMethodInfoHeader ( MethodBinding methodBinding , int accessFlags ) { this . methodCount ++ ; if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { accessFlags &= ~ ( ClassFileConstants . AccSynthetic | ClassFileConstants . AccVarargs ) ; } if ( ( methodBinding . tagBits & TagBits . ClearPrivateModifier ) != <NUM_LIT:0> ) { accessFlags &= ~ ClassFileConstants . AccPrivate ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; int nameIndex = this . constantPool . literalIndex ( methodBinding . selector ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; int descriptorIndex = this . constantPool . literalIndex ( methodBinding . signature ( this ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) descriptorIndex ; } public void generateMethodInfoHeaderForClinit ( ) { this . methodCount ++ ; if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( ( ClassFileConstants . AccDefault | ClassFileConstants . AccStatic ) > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( ClassFileConstants . AccDefault | ClassFileConstants . AccStatic ) ; int nameIndex = this . constantPool . literalIndex ( ConstantPool . Clinit ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; int descriptorIndex = this . constantPool . literalIndex ( ConstantPool . ClinitSignature ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:1> ; } public void generateMissingAbstractMethods ( MethodDeclaration [ ] methodDeclarations , CompilationResult compilationResult ) { if ( methodDeclarations != null ) { TypeDeclaration currentDeclaration = this . referenceBinding . scope . referenceContext ; int typeDeclarationSourceStart = currentDeclaration . sourceStart ( ) ; int typeDeclarationSourceEnd = currentDeclaration . sourceEnd ( ) ; for ( int i = <NUM_LIT:0> , max = methodDeclarations . length ; i < max ; i ++ ) { MethodDeclaration methodDeclaration = methodDeclarations [ i ] ; MethodBinding methodBinding = methodDeclaration . binding ; String readableName = new String ( methodBinding . readableName ( ) ) ; CategorizedProblem [ ] problems = compilationResult . problems ; int problemsCount = compilationResult . problemCount ; for ( int j = <NUM_LIT:0> ; j < problemsCount ; j ++ ) { CategorizedProblem problem = problems [ j ] ; if ( problem != null && problem . getID ( ) == IProblem . AbstractMethodMustBeImplemented && problem . getMessage ( ) . indexOf ( readableName ) != - <NUM_LIT:1> && problem . getSourceStart ( ) >= typeDeclarationSourceStart && problem . getSourceEnd ( ) <= typeDeclarationSourceEnd ) { addMissingAbstractProblemMethod ( methodDeclaration , methodBinding , problem , compilationResult ) ; } } } } } private void generateMissingTypesAttribute ( ) { int initialSize = this . missingTypes . size ( ) ; int [ ] missingTypesIndexes = new int [ initialSize ] ; int numberOfMissingTypes = <NUM_LIT:0> ; if ( initialSize > <NUM_LIT:1> ) { Collections . sort ( this . missingTypes , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { TypeBinding typeBinding1 = ( TypeBinding ) o1 ; TypeBinding typeBinding2 = ( TypeBinding ) o2 ; return CharOperation . compareTo ( typeBinding1 . constantPoolName ( ) , typeBinding2 . constantPoolName ( ) ) ; } } ) ; } int previousIndex = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < initialSize ; i ++ ) { int missingTypeIndex = this . constantPool . literalIndexForType ( ( TypeBinding ) this . missingTypes . get ( i ) ) ; if ( previousIndex == missingTypeIndex ) { continue next ; } previousIndex = missingTypeIndex ; missingTypesIndexes [ numberOfMissingTypes ++ ] = missingTypeIndex ; } int attributeLength = numberOfMissingTypes * <NUM_LIT:2> + <NUM_LIT:2> ; if ( this . contentsOffset + attributeLength + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( attributeLength + <NUM_LIT:6> ) ; } int missingTypesNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . MissingTypesName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( missingTypesNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) missingTypesNameIndex ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeLength ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( numberOfMissingTypes > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) numberOfMissingTypes ; for ( int i = <NUM_LIT:0> ; i < numberOfMissingTypes ; i ++ ) { int missingTypeIndex = missingTypesIndexes [ i ] ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( missingTypeIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) missingTypeIndex ; } } private int generateRuntimeAnnotations ( final Annotation [ ] annotations ) { int attributesNumber = <NUM_LIT:0> ; final int length = annotations . length ; int visibleAnnotationsCounter = <NUM_LIT:0> ; int invisibleAnnotationsCounter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Annotation annotation = annotations [ i ] ; if ( annotation . isRuntimeInvisible ( ) ) { invisibleAnnotationsCounter ++ ; } else if ( annotation . isRuntimeVisible ( ) ) { visibleAnnotationsCounter ++ ; } } int annotationAttributeOffset = this . contentsOffset ; int constantPOffset = this . constantPool . currentOffset ; int constantPoolIndex = this . constantPool . currentIndex ; if ( invisibleAnnotationsCounter != <NUM_LIT:0> ) { if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } int runtimeInvisibleAnnotationsAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( runtimeInvisibleAnnotationsAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) runtimeInvisibleAnnotationsAttributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; int annotationsLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; loop : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( invisibleAnnotationsCounter == <NUM_LIT:0> ) break loop ; Annotation annotation = annotations [ i ] ; if ( annotation . isRuntimeInvisible ( ) ) { int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; invisibleAnnotationsCounter -- ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; } } } if ( counter != <NUM_LIT:0> ) { this . contents [ annotationsLengthOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ annotationsLengthOffset ++ ] = ( byte ) counter ; int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; this . constantPool . resetForAttributeName ( AttributeNamesConstants . RuntimeInvisibleAnnotationsName , constantPoolIndex , constantPOffset ) ; } } annotationAttributeOffset = this . contentsOffset ; constantPOffset = this . constantPool . currentOffset ; constantPoolIndex = this . constantPool . currentIndex ; if ( visibleAnnotationsCounter != <NUM_LIT:0> ) { if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } int runtimeVisibleAnnotationsAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( runtimeVisibleAnnotationsAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) runtimeVisibleAnnotationsAttributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; int annotationsLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; loop : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( visibleAnnotationsCounter == <NUM_LIT:0> ) break loop ; Annotation annotation = annotations [ i ] ; if ( annotation . isRuntimeVisible ( ) ) { visibleAnnotationsCounter -- ; int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; } } } if ( counter != <NUM_LIT:0> ) { this . contents [ annotationsLengthOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ annotationsLengthOffset ++ ] = ( byte ) counter ; int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; this . constantPool . resetForAttributeName ( AttributeNamesConstants . RuntimeVisibleAnnotationsName , constantPoolIndex , constantPOffset ) ; } } return attributesNumber ; } private int generateRuntimeAnnotationsForParameters ( Argument [ ] arguments ) { final int argumentsLength = arguments . length ; final int VISIBLE_INDEX = <NUM_LIT:0> ; final int INVISIBLE_INDEX = <NUM_LIT:1> ; int invisibleParametersAnnotationsCounter = <NUM_LIT:0> ; int visibleParametersAnnotationsCounter = <NUM_LIT:0> ; int [ ] [ ] annotationsCounters = new int [ argumentsLength ] [ <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { Argument argument = arguments [ i ] ; Annotation [ ] annotations = argument . annotations ; if ( annotations != null ) { for ( int j = <NUM_LIT:0> , max2 = annotations . length ; j < max2 ; j ++ ) { Annotation annotation = annotations [ j ] ; if ( annotation . isRuntimeInvisible ( ) ) { annotationsCounters [ i ] [ INVISIBLE_INDEX ] ++ ; invisibleParametersAnnotationsCounter ++ ; } else if ( annotation . isRuntimeVisible ( ) ) { annotationsCounters [ i ] [ VISIBLE_INDEX ] ++ ; visibleParametersAnnotationsCounter ++ ; } } } } int attributesNumber = <NUM_LIT:0> ; int annotationAttributeOffset = this . contentsOffset ; if ( invisibleParametersAnnotationsCounter != <NUM_LIT:0> ) { int globalCounter = <NUM_LIT:0> ; if ( this . contentsOffset + <NUM_LIT:7> >= this . contents . length ) { resizeContents ( <NUM_LIT:7> ) ; } int attributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeInvisibleParameterAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; this . contents [ this . contentsOffset ++ ] = ( byte ) argumentsLength ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( invisibleParametersAnnotationsCounter == <NUM_LIT:0> ) { this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; } else { final int numberOfInvisibleAnnotations = annotationsCounters [ i ] [ INVISIBLE_INDEX ] ; int invisibleAnnotationsOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; if ( numberOfInvisibleAnnotations != <NUM_LIT:0> ) { Argument argument = arguments [ i ] ; Annotation [ ] annotations = argument . annotations ; for ( int j = <NUM_LIT:0> , max = annotations . length ; j < max ; j ++ ) { Annotation annotation = annotations [ j ] ; if ( annotation . isRuntimeInvisible ( ) ) { int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; globalCounter ++ ; } invisibleParametersAnnotationsCounter -- ; } } } this . contents [ invisibleAnnotationsOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ invisibleAnnotationsOffset ] = ( byte ) counter ; } } if ( globalCounter != <NUM_LIT:0> ) { int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; } } if ( visibleParametersAnnotationsCounter != <NUM_LIT:0> ) { int globalCounter = <NUM_LIT:0> ; if ( this . contentsOffset + <NUM_LIT:7> >= this . contents . length ) { resizeContents ( <NUM_LIT:7> ) ; } int attributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeVisibleParameterAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; this . contents [ this . contentsOffset ++ ] = ( byte ) argumentsLength ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( visibleParametersAnnotationsCounter == <NUM_LIT:0> ) { this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; } else { final int numberOfVisibleAnnotations = annotationsCounters [ i ] [ VISIBLE_INDEX ] ; int visibleAnnotationsOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; if ( numberOfVisibleAnnotations != <NUM_LIT:0> ) { Argument argument = arguments [ i ] ; Annotation [ ] annotations = argument . annotations ; for ( int j = <NUM_LIT:0> , max = annotations . length ; j < max ; j ++ ) { Annotation annotation = annotations [ j ] ; if ( annotation . isRuntimeVisible ( ) ) { int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; globalCounter ++ ; } visibleParametersAnnotationsCounter -- ; } } } this . contents [ visibleAnnotationsOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ visibleAnnotationsOffset ] = ( byte ) counter ; } } if ( globalCounter != <NUM_LIT:0> ) { int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; } } return attributesNumber ; } private int generateSignatureAttribute ( char [ ] genericSignature ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int signatureAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SignatureName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( signatureAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) signatureAttributeNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:2> ; int signatureIndex = this . constantPool . literalIndex ( genericSignature ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( signatureIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) signatureIndex ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateSourceAttribute ( String fullFileName ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int sourceAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SourceName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( sourceAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) sourceAttributeNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:2> ; int fileNameIndex = this . constantPool . literalIndex ( fullFileName . toCharArray ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( fileNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) fileNameIndex ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateStackMapAttribute ( MethodBinding methodBinding , int code_length , int codeAttributeOffset , int max_locals , boolean isClinit ) { int attributesNumber = <NUM_LIT:0> ; int localContentsOffset = this . contentsOffset ; StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( isClinit ? null : methodBinding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , isClinit ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } this . contentsOffset = localContentsOffset ; return attributesNumber ; } private int generateStackMapTableAttribute ( MethodBinding methodBinding , int code_length , int codeAttributeOffset , int max_locals , boolean isClinit ) { int attributesNumber = <NUM_LIT:0> ; int localContentsOffset = this . contentsOffset ; StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( isClinit ? null : methodBinding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , isClinit ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } this . contentsOffset = localContentsOffset ; return attributesNumber ; } private int generateSyntheticAttribute ( ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int syntheticAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SyntheticName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( syntheticAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) syntheticAttributeNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } private int generateVarargsAttribute ( ) { int localContentsOffset = this . contentsOffset ; if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int varargsAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . VarargsName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( varargsAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) varargsAttributeNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contentsOffset = localContentsOffset ; return <NUM_LIT:1> ; } public byte [ ] getBytes ( ) { if ( this . bytes == null ) { this . bytes = new byte [ this . headerOffset + this . contentsOffset ] ; System . arraycopy ( this . header , <NUM_LIT:0> , this . bytes , <NUM_LIT:0> , this . headerOffset ) ; System . arraycopy ( this . contents , <NUM_LIT:0> , this . bytes , this . headerOffset , this . contentsOffset ) ; } return this . bytes ; } public char [ ] [ ] getCompoundName ( ) { return CharOperation . splitOn ( '<CHAR_LIT:/>' , fileName ( ) ) ; } private int getParametersCount ( char [ ] methodSignature ) { int i = CharOperation . indexOf ( '<CHAR_LIT:(>' , methodSignature ) ; i ++ ; char currentCharacter = methodSignature [ i ] ; if ( currentCharacter == '<CHAR_LIT:)>' ) { return <NUM_LIT:0> ; } int result = <NUM_LIT:0> ; while ( true ) { currentCharacter = methodSignature [ i ] ; if ( currentCharacter == '<CHAR_LIT:)>' ) { return result ; } switch ( currentCharacter ) { case '<CHAR_LIT:[>' : int scanType = scanType ( methodSignature , i + <NUM_LIT:1> ) ; result ++ ; i = scanType + <NUM_LIT:1> ; break ; case '<CHAR_LIT>' : scanType = CharOperation . indexOf ( '<CHAR_LIT:;>' , methodSignature , i + <NUM_LIT:1> ) ; result ++ ; i = scanType + <NUM_LIT:1> ; break ; case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : result ++ ; i ++ ; break ; default : throw new IllegalArgumentException ( "<STR_LIT>" + currentCharacter ) ; } } } private char [ ] getReturnType ( char [ ] methodSignature ) { int paren = CharOperation . lastIndexOf ( '<CHAR_LIT:)>' , methodSignature ) ; return CharOperation . subarray ( methodSignature , paren + <NUM_LIT:1> , methodSignature . length ) ; } private final int i4At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } protected void initByteArrays ( ) { int members = this . referenceBinding . methods ( ) . length + this . referenceBinding . fields ( ) . length ; this . header = new byte [ INITIAL_HEADER_SIZE ] ; this . contents = new byte [ members < <NUM_LIT:15> ? INITIAL_CONTENTS_SIZE : INITIAL_HEADER_SIZE ] ; } public void initialize ( SourceTypeBinding aType , ClassFile parentClassFile , boolean createProblemType ) { this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:24> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:16> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:8> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:0> ) ; long targetVersion = this . targetJDK ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:8> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:0> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:24> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:16> ) ; this . constantPoolOffset = this . headerOffset ; this . headerOffset += <NUM_LIT:2> ; this . constantPool . initialize ( this ) ; int accessFlags = aType . getAccessFlags ( ) ; if ( aType . isPrivate ( ) ) { accessFlags &= ~ ClassFileConstants . AccPublic ; } if ( aType . isProtected ( ) ) { accessFlags |= ClassFileConstants . AccPublic ; } accessFlags &= ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccSynchronized | ClassFileConstants . AccNative ) ; if ( ! aType . isInterface ( ) ) { accessFlags |= ClassFileConstants . AccSuper ; } if ( aType . isAnonymousType ( ) ) { accessFlags &= ~ ClassFileConstants . AccFinal ; } int finalAbstract = ClassFileConstants . AccFinal | ClassFileConstants . AccAbstract ; if ( ( accessFlags & finalAbstract ) == finalAbstract ) { accessFlags &= ~ finalAbstract ; } this . enclosingClassFile = parentClassFile ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; int classNameIndex = this . constantPool . literalIndexForType ( aType ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( classNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) classNameIndex ; int superclassNameIndex ; if ( aType . isInterface ( ) ) { superclassNameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangObjectConstantPoolName ) ; } else { if ( aType . superclass != null ) { if ( ( aType . superclass . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { superclassNameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangObjectConstantPoolName ) ; } else { superclassNameIndex = this . constantPool . literalIndexForType ( aType . superclass ) ; } } else { superclassNameIndex = <NUM_LIT:0> ; } } this . contents [ this . contentsOffset ++ ] = ( byte ) ( superclassNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) superclassNameIndex ; ReferenceBinding [ ] superInterfacesBinding = aType . superInterfaces ( ) ; int interfacesCount = superInterfacesBinding . length ; int interfacesCountPosition = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int interfaceCounter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < interfacesCount ; i ++ ) { ReferenceBinding binding = superInterfacesBinding [ i ] ; if ( ( binding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { continue ; } interfaceCounter ++ ; int interfaceIndex = this . constantPool . literalIndexForType ( binding ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( interfaceIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) interfaceIndex ; } this . contents [ interfacesCountPosition ++ ] = ( byte ) ( interfaceCounter > > <NUM_LIT:8> ) ; this . contents [ interfacesCountPosition ] = ( byte ) interfaceCounter ; this . creatingProblemType = createProblemType ; this . codeStream . maxFieldCount = aType . scope . outerMostClassScope ( ) . referenceType ( ) . maxFieldCount ; } private void initializeDefaultLocals ( StackMapFrame frame , MethodBinding methodBinding , int maxLocals , int codeLength ) { if ( maxLocals != <NUM_LIT:0> ) { int resolvedPosition = <NUM_LIT:0> ; final boolean isConstructor = methodBinding . isConstructor ( ) ; if ( isConstructor || ! methodBinding . isStatic ( ) ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( ConstantPool . This , methodBinding . declaringClass , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = <NUM_LIT:0> ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( isConstructor ? VerificationTypeInfo . ITEM_UNINITIALIZED_THIS : VerificationTypeInfo . ITEM_OBJECT , methodBinding . declaringClass ) ) ; resolvedPosition ++ ; } if ( isConstructor ) { if ( methodBinding . declaringClass . isEnum ( ) ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , this . referenceBinding . scope . getJavaLangString ( ) , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( TypeIds . T_JavaLangString , ConstantPool . JavaLangStringConstantPoolName ) ) ; resolvedPosition ++ ; localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , TypeBinding . INT , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( TypeBinding . INT ) ) ; resolvedPosition ++ ; } if ( methodBinding . declaringClass . isNestedType ( ) ) { ReferenceBinding enclosingInstanceTypes [ ] ; if ( ( enclosingInstanceTypes = methodBinding . declaringClass . syntheticEnclosingInstanceTypes ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = enclosingInstanceTypes . length ; i < max ; i ++ ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( ( "<STR_LIT>" + i ) . toCharArray ( ) , enclosingInstanceTypes [ i ] , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( enclosingInstanceTypes [ i ] ) ) ; resolvedPosition ++ ; } } TypeBinding [ ] arguments ; if ( ( arguments = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = arguments [ i ] ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } SyntheticArgumentBinding syntheticArguments [ ] ; if ( ( syntheticArguments = methodBinding . declaringClass . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = syntheticArguments [ i ] . type ; LocalVariableBinding localVariableBinding = new LocalVariableBinding ( ( "<STR_LIT>" + i ) . toCharArray ( ) , typeBinding , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } } else { TypeBinding [ ] arguments ; if ( ( arguments = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = arguments [ i ] ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } } } else { TypeBinding [ ] arguments ; if ( ( arguments = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = arguments [ i ] ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } } } } private void initializeLocals ( boolean isStatic , int currentPC , StackMapFrame currentFrame ) { VerificationTypeInfo [ ] locals = currentFrame . locals ; int localsLength = locals . length ; int i = <NUM_LIT:0> ; if ( ! isStatic ) { i = <NUM_LIT:1> ; } for ( ; i < localsLength ; i ++ ) { locals [ i ] = null ; } i = <NUM_LIT:0> ; locals : for ( int max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable == null ) continue ; int resolvedPosition = localVariable . resolvedPosition ; final TypeBinding localVariableTypeBinding = localVariable . type ; inits : for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( currentPC < startPC ) { continue inits ; } else if ( currentPC < endPC ) { if ( currentFrame . locals [ resolvedPosition ] == null ) { currentFrame . locals [ resolvedPosition ] = new VerificationTypeInfo ( localVariableTypeBinding ) ; } continue locals ; } } } } public ClassFile outerMostEnclosingClassFile ( ) { ClassFile current = this ; while ( current . enclosingClassFile != null ) current = current . enclosingClassFile ; return current ; } public void recordInnerClasses ( TypeBinding binding ) { if ( this . innerClassesBindings == null ) { this . innerClassesBindings = new HashSet ( INNER_CLASSES_SIZE ) ; } ReferenceBinding innerClass = ( ReferenceBinding ) binding ; this . innerClassesBindings . add ( innerClass . erasure ( ) ) ; ReferenceBinding enclosingType = innerClass . enclosingType ( ) ; while ( enclosingType != null && enclosingType . isNestedType ( ) ) { this . innerClassesBindings . add ( enclosingType . erasure ( ) ) ; enclosingType = enclosingType . enclosingType ( ) ; } } public void reset ( SourceTypeBinding typeBinding ) { final CompilerOptions options = typeBinding . scope . compilerOptions ( ) ; this . referenceBinding = typeBinding ; this . isNestedType = typeBinding . isNestedType ( ) ; this . targetJDK = options . targetJDK ; this . produceAttributes = options . produceDebugAttributes ; if ( this . targetJDK >= ClassFileConstants . JDK1_6 ) { this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP_TABLE ; } else if ( this . targetJDK == ClassFileConstants . CLDC_1_1 ) { this . targetJDK = ClassFileConstants . JDK1_1 ; this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP ; } this . bytes = null ; this . constantPool . reset ( ) ; this . codeStream . reset ( this ) ; this . constantPoolOffset = <NUM_LIT:0> ; this . contentsOffset = <NUM_LIT:0> ; this . creatingProblemType = false ; this . enclosingClassFile = null ; this . headerOffset = <NUM_LIT:0> ; this . methodCount = <NUM_LIT:0> ; this . methodCountOffset = <NUM_LIT:0> ; if ( this . innerClassesBindings != null ) { this . innerClassesBindings . clear ( ) ; } this . missingTypes = null ; this . visitedTypes = null ; } private final void resizeContents ( int minimalSize ) { int length = this . contents . length ; int toAdd = length ; if ( toAdd < minimalSize ) toAdd = minimalSize ; System . arraycopy ( this . contents , <NUM_LIT:0> , this . contents = new byte [ length + toAdd ] , <NUM_LIT:0> , length ) ; } private VerificationTypeInfo retrieveLocal ( int currentPC , int resolvedPosition ) { for ( int i = <NUM_LIT:0> , max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable == null ) continue ; if ( resolvedPosition == localVariable . resolvedPosition ) { inits : for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( currentPC < startPC ) { continue inits ; } else if ( currentPC < endPC ) { return new VerificationTypeInfo ( localVariable . type ) ; } } } } return null ; } private int scanType ( char [ ] methodSignature , int index ) { switch ( methodSignature [ index ] ) { case '<CHAR_LIT:[>' : return scanType ( methodSignature , index + <NUM_LIT:1> ) ; case '<CHAR_LIT>' : return CharOperation . indexOf ( '<CHAR_LIT:;>' , methodSignature , index + <NUM_LIT:1> ) ; case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : return index ; default : throw new IllegalArgumentException ( ) ; } } public void setForMethodInfos ( ) { this . methodCountOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; } public void traverse ( MethodBinding methodBinding , int maxLocals , byte [ ] bytecodes , int codeOffset , int codeLength , ArrayList frames , boolean isClinit ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; int [ ] framePositions = stackMapFrameCodeStream . getFramePositions ( ) ; int pc = codeOffset ; int index ; int [ ] constantPoolOffsets = this . constantPool . offsets ; byte [ ] poolContents = this . constantPool . poolContent ; int indexInFramePositions = <NUM_LIT:0> ; int framePositionsLength = framePositions . length ; int currentFramePosition = framePositions [ <NUM_LIT:0> ] ; int indexInStackDepthMarkers = <NUM_LIT:0> ; StackDepthMarker [ ] stackDepthMarkers = stackMapFrameCodeStream . getStackDepthMarkers ( ) ; int stackDepthMarkersLength = stackDepthMarkers == null ? <NUM_LIT:0> : stackDepthMarkers . length ; boolean hasStackDepthMarkers = stackDepthMarkersLength != <NUM_LIT:0> ; StackDepthMarker stackDepthMarker = null ; if ( hasStackDepthMarkers ) { stackDepthMarker = stackDepthMarkers [ <NUM_LIT:0> ] ; } int indexInStackMarkers = <NUM_LIT:0> ; StackMarker [ ] stackMarkers = stackMapFrameCodeStream . getStackMarkers ( ) ; int stackMarkersLength = stackMarkers == null ? <NUM_LIT:0> : stackMarkers . length ; boolean hasStackMarkers = stackMarkersLength != <NUM_LIT:0> ; StackMarker stackMarker = null ; if ( hasStackMarkers ) { stackMarker = stackMarkers [ <NUM_LIT:0> ] ; } int indexInExceptionMarkers = <NUM_LIT:0> ; ExceptionMarker [ ] exceptionMarkers = stackMapFrameCodeStream . getExceptionMarkers ( ) ; int exceptionsMarkersLength = exceptionMarkers == null ? <NUM_LIT:0> : exceptionMarkers . length ; boolean hasExceptionMarkers = exceptionsMarkersLength != <NUM_LIT:0> ; ExceptionMarker exceptionMarker = null ; if ( hasExceptionMarkers ) { exceptionMarker = exceptionMarkers [ <NUM_LIT:0> ] ; } StackMapFrame frame = new StackMapFrame ( maxLocals ) ; if ( ! isClinit ) { initializeDefaultLocals ( frame , methodBinding , maxLocals , codeLength ) ; } frame . pc = - <NUM_LIT:1> ; frames . add ( frame . duplicate ( ) ) ; while ( true ) { int currentPC = pc - codeOffset ; if ( hasStackMarkers && stackMarker . pc == currentPC ) { VerificationTypeInfo [ ] infos = frame . stackItems ; VerificationTypeInfo [ ] tempInfos = new VerificationTypeInfo [ frame . numberOfStackItems ] ; System . arraycopy ( infos , <NUM_LIT:0> , tempInfos , <NUM_LIT:0> , frame . numberOfStackItems ) ; stackMarker . setInfos ( tempInfos ) ; } else if ( hasStackMarkers && stackMarker . destinationPC == currentPC ) { VerificationTypeInfo [ ] infos = stackMarker . infos ; frame . stackItems = infos ; frame . numberOfStackItems = infos . length ; indexInStackMarkers ++ ; if ( indexInStackMarkers < stackMarkersLength ) { stackMarker = stackMarkers [ indexInStackMarkers ] ; } else { hasStackMarkers = false ; } } if ( hasStackDepthMarkers && stackDepthMarker . pc == currentPC ) { TypeBinding typeBinding = stackDepthMarker . typeBinding ; if ( typeBinding != null ) { if ( stackDepthMarker . delta > <NUM_LIT:0> ) { frame . addStackItem ( new VerificationTypeInfo ( typeBinding ) ) ; } else { frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( typeBinding ) ; } } else { frame . numberOfStackItems -- ; } indexInStackDepthMarkers ++ ; if ( indexInStackDepthMarkers < stackDepthMarkersLength ) { stackDepthMarker = stackDepthMarkers [ indexInStackDepthMarkers ] ; } else { hasStackDepthMarkers = false ; } } if ( hasExceptionMarkers && exceptionMarker . pc == currentPC ) { frame . numberOfStackItems = <NUM_LIT:0> ; frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , VerificationTypeInfo . ITEM_OBJECT , exceptionMarker . constantPoolName ) ) ; indexInExceptionMarkers ++ ; if ( indexInExceptionMarkers < exceptionsMarkersLength ) { exceptionMarker = exceptionMarkers [ indexInExceptionMarkers ] ; } else { hasExceptionMarkers = false ; } } if ( currentFramePosition < currentPC ) { do { indexInFramePositions ++ ; if ( indexInFramePositions < framePositionsLength ) { currentFramePosition = framePositions [ indexInFramePositions ] ; } else { return ; } } while ( currentFramePosition < currentPC ) ; } if ( currentFramePosition == currentPC ) { StackMapFrame currentFrame = frame . duplicate ( ) ; currentFrame . pc = currentPC ; initializeLocals ( isClinit ? true : methodBinding . isStatic ( ) , currentPC , currentFrame ) ; frames . add ( currentFrame ) ; indexInFramePositions ++ ; if ( indexInFramePositions < framePositionsLength ) { currentFramePosition = framePositions [ indexInFramePositions ] ; } else { return ; } } byte opcode = ( byte ) u1At ( bytecodes , <NUM_LIT:0> , pc ) ; switch ( opcode ) { case Opcodes . OPC_nop : pc ++ ; break ; case Opcodes . OPC_aconst_null : frame . addStackItem ( TypeBinding . NULL ) ; pc ++ ; break ; case Opcodes . OPC_iconst_m1 : case Opcodes . OPC_iconst_0 : case Opcodes . OPC_iconst_1 : case Opcodes . OPC_iconst_2 : case Opcodes . OPC_iconst_3 : case Opcodes . OPC_iconst_4 : case Opcodes . OPC_iconst_5 : frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_lconst_0 : case Opcodes . OPC_lconst_1 : frame . addStackItem ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_fconst_0 : case Opcodes . OPC_fconst_1 : case Opcodes . OPC_fconst_2 : frame . addStackItem ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_dconst_0 : case Opcodes . OPC_dconst_1 : frame . addStackItem ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_bipush : frame . addStackItem ( TypeBinding . BYTE ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_sipush : frame . addStackItem ( TypeBinding . SHORT ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_ldc : index = u1At ( bytecodes , <NUM_LIT:1> , pc ) ; switch ( u1At ( poolContents , <NUM_LIT:0> , constantPoolOffsets [ index ] ) ) { case ClassFileConstants . StringTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangString , ConstantPool . JavaLangStringConstantPoolName ) ) ; break ; case ClassFileConstants . IntegerTag : frame . addStackItem ( TypeBinding . INT ) ; break ; case ClassFileConstants . FloatTag : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case ClassFileConstants . ClassTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangClass , ConstantPool . JavaLangClassConstantPoolName ) ) ; } pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_ldc_w : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; switch ( u1At ( poolContents , <NUM_LIT:0> , constantPoolOffsets [ index ] ) ) { case ClassFileConstants . StringTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangString , ConstantPool . JavaLangStringConstantPoolName ) ) ; break ; case ClassFileConstants . IntegerTag : frame . addStackItem ( TypeBinding . INT ) ; break ; case ClassFileConstants . FloatTag : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case ClassFileConstants . ClassTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangClass , ConstantPool . JavaLangClassConstantPoolName ) ) ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_ldc2_w : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; switch ( u1At ( poolContents , <NUM_LIT:0> , constantPoolOffsets [ index ] ) ) { case ClassFileConstants . DoubleTag : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case ClassFileConstants . LongTag : frame . addStackItem ( TypeBinding . LONG ) ; break ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_iload : frame . addStackItem ( TypeBinding . INT ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_lload : frame . addStackItem ( TypeBinding . LONG ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_fload : frame . addStackItem ( TypeBinding . FLOAT ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_dload : frame . addStackItem ( TypeBinding . DOUBLE ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_aload : index = u1At ( bytecodes , <NUM_LIT:1> , pc ) ; VerificationTypeInfo localsN = retrieveLocal ( currentPC , index ) ; frame . addStackItem ( localsN ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_iload_0 : case Opcodes . OPC_iload_1 : case Opcodes . OPC_iload_2 : case Opcodes . OPC_iload_3 : frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_lload_0 : case Opcodes . OPC_lload_1 : case Opcodes . OPC_lload_2 : case Opcodes . OPC_lload_3 : frame . addStackItem ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_fload_0 : case Opcodes . OPC_fload_1 : case Opcodes . OPC_fload_2 : case Opcodes . OPC_fload_3 : frame . addStackItem ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_dload_0 : case Opcodes . OPC_dload_1 : case Opcodes . OPC_dload_2 : case Opcodes . OPC_dload_3 : frame . addStackItem ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_aload_0 : VerificationTypeInfo locals0 = frame . locals [ <NUM_LIT:0> ] ; if ( locals0 == null || locals0 . tag != VerificationTypeInfo . ITEM_UNINITIALIZED_THIS ) { locals0 = retrieveLocal ( currentPC , <NUM_LIT:0> ) ; } frame . addStackItem ( locals0 ) ; pc ++ ; break ; case Opcodes . OPC_aload_1 : VerificationTypeInfo locals1 = retrieveLocal ( currentPC , <NUM_LIT:1> ) ; frame . addStackItem ( locals1 ) ; pc ++ ; break ; case Opcodes . OPC_aload_2 : VerificationTypeInfo locals2 = retrieveLocal ( currentPC , <NUM_LIT:2> ) ; frame . addStackItem ( locals2 ) ; pc ++ ; break ; case Opcodes . OPC_aload_3 : VerificationTypeInfo locals3 = retrieveLocal ( currentPC , <NUM_LIT:3> ) ; frame . addStackItem ( locals3 ) ; pc ++ ; break ; case Opcodes . OPC_iaload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_laload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_faload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_daload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_aaload : frame . numberOfStackItems -- ; frame . replaceWithElementType ( ) ; pc ++ ; break ; case Opcodes . OPC_baload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . BYTE ) ; pc ++ ; break ; case Opcodes . OPC_caload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . CHAR ) ; pc ++ ; break ; case Opcodes . OPC_saload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . SHORT ) ; pc ++ ; break ; case Opcodes . OPC_istore : case Opcodes . OPC_lstore : case Opcodes . OPC_fstore : case Opcodes . OPC_dstore : frame . numberOfStackItems -- ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_astore : index = u1At ( bytecodes , <NUM_LIT:1> , pc ) ; frame . numberOfStackItems -- ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_astore_0 : frame . locals [ <NUM_LIT:0> ] = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_astore_1 : case Opcodes . OPC_astore_2 : case Opcodes . OPC_astore_3 : case Opcodes . OPC_istore_0 : case Opcodes . OPC_istore_1 : case Opcodes . OPC_istore_2 : case Opcodes . OPC_istore_3 : case Opcodes . OPC_lstore_0 : case Opcodes . OPC_lstore_1 : case Opcodes . OPC_lstore_2 : case Opcodes . OPC_lstore_3 : case Opcodes . OPC_fstore_0 : case Opcodes . OPC_fstore_1 : case Opcodes . OPC_fstore_2 : case Opcodes . OPC_fstore_3 : case Opcodes . OPC_dstore_0 : case Opcodes . OPC_dstore_1 : case Opcodes . OPC_dstore_2 : case Opcodes . OPC_dstore_3 : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_iastore : case Opcodes . OPC_lastore : case Opcodes . OPC_fastore : case Opcodes . OPC_dastore : case Opcodes . OPC_aastore : case Opcodes . OPC_bastore : case Opcodes . OPC_castore : case Opcodes . OPC_sastore : frame . numberOfStackItems -= <NUM_LIT:3> ; pc ++ ; break ; case Opcodes . OPC_pop : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_pop2 : int numberOfStackItems = frame . numberOfStackItems ; switch ( frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . numberOfStackItems -- ; break ; default : frame . numberOfStackItems -= <NUM_LIT:2> ; } pc ++ ; break ; case Opcodes . OPC_dup : frame . addStackItem ( frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ) ; pc ++ ; break ; case Opcodes . OPC_dup_x1 : VerificationTypeInfo info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; VerificationTypeInfo info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; pc ++ ; break ; case Opcodes . OPC_dup_x2 : info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info2 . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info3 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } pc ++ ; break ; case Opcodes . OPC_dup2 : info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : frame . addStackItem ( info ) ; frame . addStackItem ( info ) ; break ; default : info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } pc ++ ; break ; case Opcodes . OPC_dup2_x1 : info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : VerificationTypeInfo info3 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } pc ++ ; break ; case Opcodes . OPC_dup2_x2 : numberOfStackItems = frame . numberOfStackItems ; info = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : switch ( info2 . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info3 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info3 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info3 . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info4 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info4 ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } } pc ++ ; break ; case Opcodes . OPC_swap : numberOfStackItems = frame . numberOfStackItems ; info = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; info2 = frame . stackItems [ numberOfStackItems - <NUM_LIT:2> ] ; frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] = info2 ; frame . stackItems [ numberOfStackItems - <NUM_LIT:2> ] = info ; pc ++ ; break ; case Opcodes . OPC_iadd : case Opcodes . OPC_ladd : case Opcodes . OPC_fadd : case Opcodes . OPC_dadd : case Opcodes . OPC_isub : case Opcodes . OPC_lsub : case Opcodes . OPC_fsub : case Opcodes . OPC_dsub : case Opcodes . OPC_imul : case Opcodes . OPC_lmul : case Opcodes . OPC_fmul : case Opcodes . OPC_dmul : case Opcodes . OPC_idiv : case Opcodes . OPC_ldiv : case Opcodes . OPC_fdiv : case Opcodes . OPC_ddiv : case Opcodes . OPC_irem : case Opcodes . OPC_lrem : case Opcodes . OPC_frem : case Opcodes . OPC_drem : case Opcodes . OPC_ishl : case Opcodes . OPC_lshl : case Opcodes . OPC_ishr : case Opcodes . OPC_lshr : case Opcodes . OPC_iushr : case Opcodes . OPC_lushr : case Opcodes . OPC_iand : case Opcodes . OPC_land : case Opcodes . OPC_ior : case Opcodes . OPC_lor : case Opcodes . OPC_ixor : case Opcodes . OPC_lxor : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_ineg : case Opcodes . OPC_lneg : case Opcodes . OPC_fneg : case Opcodes . OPC_dneg : pc ++ ; break ; case Opcodes . OPC_iinc : pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_i2l : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_i2f : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_i2d : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_l2i : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_l2f : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_l2d : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_f2i : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_f2l : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_f2d : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_d2i : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_d2l : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_d2f : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_i2b : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . BYTE ) ; pc ++ ; break ; case Opcodes . OPC_i2c : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . CHAR ) ; pc ++ ; break ; case Opcodes . OPC_i2s : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . SHORT ) ; pc ++ ; break ; case Opcodes . OPC_lcmp : case Opcodes . OPC_fcmpl : case Opcodes . OPC_fcmpg : case Opcodes . OPC_dcmpl : case Opcodes . OPC_dcmpg : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_ifeq : case Opcodes . OPC_ifne : case Opcodes . OPC_iflt : case Opcodes . OPC_ifge : case Opcodes . OPC_ifgt : case Opcodes . OPC_ifle : frame . numberOfStackItems -- ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_if_icmpeq : case Opcodes . OPC_if_icmpne : case Opcodes . OPC_if_icmplt : case Opcodes . OPC_if_icmpge : case Opcodes . OPC_if_icmpgt : case Opcodes . OPC_if_icmple : case Opcodes . OPC_if_acmpeq : case Opcodes . OPC_if_acmpne : frame . numberOfStackItems -= <NUM_LIT:2> ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_goto : pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_tableswitch : pc ++ ; while ( ( ( pc - codeOffset ) & <NUM_LIT> ) != <NUM_LIT:0> ) { pc ++ ; } pc += <NUM_LIT:4> ; int low = i4At ( bytecodes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int high = i4At ( bytecodes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int length = high - low + <NUM_LIT:1> ; pc += ( length * <NUM_LIT:4> ) ; frame . numberOfStackItems -- ; break ; case Opcodes . OPC_lookupswitch : pc ++ ; while ( ( ( pc - codeOffset ) & <NUM_LIT> ) != <NUM_LIT:0> ) { pc ++ ; } pc += <NUM_LIT:4> ; int npairs = ( int ) u4At ( bytecodes , <NUM_LIT:0> , pc ) ; pc += ( <NUM_LIT:4> + npairs * <NUM_LIT:8> ) ; frame . numberOfStackItems -- ; break ; case Opcodes . OPC_ireturn : case Opcodes . OPC_lreturn : case Opcodes . OPC_freturn : case Opcodes . OPC_dreturn : case Opcodes . OPC_areturn : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_return : pc ++ ; break ; case Opcodes . OPC_getstatic : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; int nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; int utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; char [ ] descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; if ( descriptor . length == <NUM_LIT:1> ) { switch ( descriptor [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else if ( descriptor [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , descriptor ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( descriptor , <NUM_LIT:1> , descriptor . length - <NUM_LIT:1> ) ) ) ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_putstatic : frame . numberOfStackItems -- ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_getfield : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -- ; if ( descriptor . length == <NUM_LIT:1> ) { switch ( descriptor [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else if ( descriptor [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , descriptor ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( descriptor , <NUM_LIT:1> , descriptor . length - <NUM_LIT:1> ) ) ) ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_putfield : frame . numberOfStackItems -= <NUM_LIT:2> ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokevirtual : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; char [ ] name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= ( getParametersCount ( descriptor ) + <NUM_LIT:1> ) ; char [ ] returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokespecial : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= getParametersCount ( descriptor ) ; if ( CharOperation . equals ( ConstantPool . Init , name ) ) { frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] . tag = VerificationTypeInfo . ITEM_OBJECT ; } frame . numberOfStackItems -- ; returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokestatic : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= getParametersCount ( descriptor ) ; returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokeinterface : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= ( getParametersCount ( descriptor ) + <NUM_LIT:1> ) ; returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:5> ; break ; case Opcodes . OPC_new : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; char [ ] className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo ( <NUM_LIT:0> , VerificationTypeInfo . ITEM_UNINITIALIZED , className ) ; verificationTypeInfo . offset = currentPC ; frame . addStackItem ( verificationTypeInfo ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_newarray : char [ ] constantPoolName = null ; switch ( u1At ( bytecodes , <NUM_LIT:1> , pc ) ) { case ClassFileConstants . INT_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . BYTE_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . BOOLEAN_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT:Z>' } ; break ; case ClassFileConstants . SHORT_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . CHAR_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . LONG_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . FLOAT_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . DOUBLE_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; } frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeIds . T_JavaLangObject , constantPoolName ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_anewarray : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; int classNameLength = className . length ; if ( className [ <NUM_LIT:0> ] != '<CHAR_LIT:[>' ) { System . arraycopy ( className , <NUM_LIT:0> , ( constantPoolName = new char [ classNameLength + <NUM_LIT:3> ] ) , <NUM_LIT:2> , classNameLength ) ; constantPoolName [ <NUM_LIT:0> ] = '<CHAR_LIT:[>' ; constantPoolName [ <NUM_LIT:1> ] = '<CHAR_LIT>' ; constantPoolName [ classNameLength + <NUM_LIT:2> ] = '<CHAR_LIT:;>' ; } else { System . arraycopy ( className , <NUM_LIT:0> , ( constantPoolName = new char [ classNameLength + <NUM_LIT:1> ] ) , <NUM_LIT:1> , classNameLength ) ; constantPoolName [ <NUM_LIT:0> ] = '<CHAR_LIT:[>' ; } frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( <NUM_LIT:0> , constantPoolName ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_arraylength : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_athrow : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_checkcast : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( <NUM_LIT:0> , className ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_instanceof : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_monitorenter : case Opcodes . OPC_monitorexit : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_wide : opcode = ( byte ) u1At ( bytecodes , <NUM_LIT:1> , pc ) ; if ( opcode == Opcodes . OPC_iinc ) { pc += <NUM_LIT:6> ; } else { index = u2At ( bytecodes , <NUM_LIT:2> , pc ) ; switch ( opcode ) { case Opcodes . OPC_iload : frame . addStackItem ( TypeBinding . INT ) ; break ; case Opcodes . OPC_fload : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case Opcodes . OPC_aload : localsN = frame . locals [ index ] ; if ( localsN == null ) { localsN = retrieveLocal ( currentPC , index ) ; } frame . addStackItem ( localsN ) ; break ; case Opcodes . OPC_lload : frame . addStackItem ( TypeBinding . LONG ) ; break ; case Opcodes . OPC_dload : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case Opcodes . OPC_istore : frame . numberOfStackItems -- ; break ; case Opcodes . OPC_fstore : frame . numberOfStackItems -- ; break ; case Opcodes . OPC_astore : frame . locals [ index ] = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; break ; case Opcodes . OPC_lstore : frame . numberOfStackItems -- ; break ; case Opcodes . OPC_dstore : frame . numberOfStackItems -- ; break ; } pc += <NUM_LIT:4> ; } break ; case Opcodes . OPC_multianewarray : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; int dimensions = u1At ( bytecodes , <NUM_LIT:3> , pc ) ; frame . numberOfStackItems -= dimensions ; classNameLength = className . length ; constantPoolName = new char [ classNameLength + dimensions ] ; for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { constantPoolName [ i ] = '<CHAR_LIT:[>' ; } System . arraycopy ( className , <NUM_LIT:0> , constantPoolName , dimensions , classNameLength ) ; frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , constantPoolName ) ) ; pc += <NUM_LIT:4> ; break ; case Opcodes . OPC_ifnull : case Opcodes . OPC_ifnonnull : frame . numberOfStackItems -- ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_goto_w : pc += <NUM_LIT:5> ; break ; default : this . codeStream . methodDeclaration . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidOpcode , new Object [ ] { new Byte ( opcode ) , new Integer ( pc ) , new String ( methodBinding . shortReadableName ( ) ) , } ) , this . codeStream . methodDeclaration ) ; break ; } if ( pc >= ( codeLength + codeOffset ) ) { break ; } } } private final int u1At ( byte [ ] reference , int relativeOffset , int structOffset ) { return ( reference [ relativeOffset + structOffset ] & <NUM_LIT> ) ; } private final int u2At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } private final long u4At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ) ; } public char [ ] utf8At ( byte [ ] reference , int absoluteOffset , int bytesAvailable ) { int length = bytesAvailable ; char outputBuf [ ] = new char [ bytesAvailable ] ; int outputPos = <NUM_LIT:0> ; int readOffset = absoluteOffset ; while ( length != <NUM_LIT:0> ) { int x = reference [ readOffset ++ ] & <NUM_LIT> ; length -- ; if ( ( <NUM_LIT> & x ) != <NUM_LIT:0> ) { if ( ( x & <NUM_LIT> ) != <NUM_LIT:0> ) { length -= <NUM_LIT:2> ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:12> ) | ( ( reference [ readOffset ++ ] & <NUM_LIT> ) << <NUM_LIT:6> ) | ( reference [ readOffset ++ ] & <NUM_LIT> ) ; } else { length -- ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:6> ) | ( reference [ readOffset ++ ] & <NUM_LIT> ) ; } } outputBuf [ outputPos ++ ] = ( char ) x ; } if ( outputPos != bytesAvailable ) { System . arraycopy ( outputBuf , <NUM_LIT:0> , ( outputBuf = new char [ outputPos ] ) , <NUM_LIT:0> , outputPos ) ; } return outputBuf ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public final class MemberTypeBinding extends NestedTypeBinding { public MemberTypeBinding ( char [ ] [ ] compoundName , ClassScope scope , SourceTypeBinding enclosingType ) { super ( compoundName , scope , enclosingType ) ; this . tagBits |= TagBits . MemberTypeMask ; } void checkSyntheticArgsAndFields ( ) { if ( isStatic ( ) ) return ; if ( isInterface ( ) ) return ; this . addSyntheticArgumentAndField ( this . enclosingType ) ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName != null ) return this . constantPoolName ; return this . constantPoolName = CharOperation . concat ( enclosingType ( ) . constantPoolName ( ) , this . sourceName , '<CHAR_LIT>' ) ; } public void initializeDeprecatedAnnotationTagBits ( ) { if ( ( this . tagBits & TagBits . DeprecatedAnnotationResolved ) == <NUM_LIT:0> ) { super . initializeDeprecatedAnnotationTagBits ( ) ; if ( ( this . tagBits & TagBits . AnnotationDeprecated ) == <NUM_LIT:0> ) { ReferenceBinding enclosing ; if ( ( ( enclosing = enclosingType ( ) ) . tagBits & TagBits . DeprecatedAnnotationResolved ) == <NUM_LIT:0> ) { enclosing . initializeDeprecatedAnnotationTagBits ( ) ; } if ( enclosing . isViewedAsDeprecated ( ) ) { this . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } } } public String toString ( ) { return "<STR_LIT>" + new String ( sourceName ( ) ) + "<STR_LIT:U+0020>" + super . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface InvocationSite { TypeBinding [ ] genericTypeArguments ( ) ; boolean isSuperAccess ( ) ; boolean isTypeAccess ( ) ; void setActualReceiverType ( ReferenceBinding receiverType ) ; void setDepth ( int depth ) ; void setFieldIndex ( int depth ) ; int sourceEnd ( ) ; int sourceStart ( ) ; TypeBinding expectedType ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemPackageBinding extends PackageBinding { private int problemId ; ProblemPackageBinding ( char [ ] [ ] compoundName , int problemId ) { this . compoundName = compoundName ; this . problemId = problemId ; } ProblemPackageBinding ( char [ ] name , int problemId ) { this ( new char [ ] [ ] { name } , problemId ) ; } public final int problemId ( ) { return this . problemId ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; class MethodVerifier15 extends MethodVerifier { MethodVerifier15 ( LookupEnvironment environment ) { super ( environment ) ; } boolean areMethodsCompatible ( MethodBinding one , MethodBinding two ) { one = one . original ( ) ; two = one . findOriginalInheritedMethod ( two ) ; if ( two == null ) return false ; return isParameterSubsignature ( one , two ) ; } boolean areParametersEqual ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneArgs = one . parameters ; TypeBinding [ ] twoArgs = two . parameters ; if ( oneArgs == twoArgs ) return true ; int length = oneArgs . length ; if ( length != twoArgs . length ) return false ; int i ; foundRAW : for ( i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! areTypesEqual ( oneArgs [ i ] , twoArgs [ i ] ) ) { if ( oneArgs [ i ] . leafComponentType ( ) . isRawType ( ) ) { if ( oneArgs [ i ] . dimensions ( ) == twoArgs [ i ] . dimensions ( ) && oneArgs [ i ] . leafComponentType ( ) . isEquivalentTo ( twoArgs [ i ] . leafComponentType ( ) ) ) { if ( one . typeVariables != Binding . NO_TYPE_VARIABLES ) return false ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) if ( oneArgs [ j ] . leafComponentType ( ) . isParameterizedTypeWithActualArguments ( ) ) return false ; break foundRAW ; } } return false ; } } for ( i ++ ; i < length ; i ++ ) { if ( ! areTypesEqual ( oneArgs [ i ] , twoArgs [ i ] ) ) { if ( oneArgs [ i ] . leafComponentType ( ) . isRawType ( ) ) if ( oneArgs [ i ] . dimensions ( ) == twoArgs [ i ] . dimensions ( ) && oneArgs [ i ] . leafComponentType ( ) . isEquivalentTo ( twoArgs [ i ] . leafComponentType ( ) ) ) continue ; return false ; } else if ( oneArgs [ i ] . leafComponentType ( ) . isParameterizedTypeWithActualArguments ( ) ) { return false ; } } return true ; } boolean areReturnTypesCompatible ( MethodBinding one , MethodBinding two ) { if ( one . returnType == two . returnType ) return true ; if ( this . type . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { return areReturnTypesCompatible0 ( one , two ) ; } else { return areTypesEqual ( one . returnType . erasure ( ) , two . returnType . erasure ( ) ) ; } } boolean areTypesEqual ( TypeBinding one , TypeBinding two ) { if ( one == two ) return true ; switch ( one . kind ( ) ) { case Binding . TYPE : switch ( two . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : if ( one == two . erasure ( ) ) return true ; } break ; case Binding . RAW_TYPE : case Binding . PARAMETERIZED_TYPE : switch ( two . kind ( ) ) { case Binding . TYPE : if ( one . erasure ( ) == two ) return true ; } } if ( one . isParameterizedType ( ) && two . isParameterizedType ( ) ) return one . isEquivalentTo ( two ) && two . isEquivalentTo ( one ) ; return false ; } protected boolean canOverridingMethodDifferInErasure ( MethodBinding overridingMethod , MethodBinding inheritedMethod ) { if ( overridingMethod . areParameterErasuresEqual ( inheritedMethod ) ) return false ; if ( overridingMethod . declaringClass . isRawType ( ) ) return false ; return true ; } boolean canSkipInheritedMethods ( ) { if ( this . type . superclass ( ) != null ) if ( this . type . superclass ( ) . isAbstract ( ) || this . type . superclass ( ) . isParameterizedType ( ) ) return false ; return this . type . superInterfaces ( ) == Binding . NO_SUPERINTERFACES ; } boolean canSkipInheritedMethods ( MethodBinding one , MethodBinding two ) { return two == null || ( one . declaringClass == two . declaringClass && ! one . declaringClass . isParameterizedType ( ) ) ; } void checkConcreteInheritedMethod ( MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { super . checkConcreteInheritedMethod ( concreteMethod , abstractMethods ) ; boolean analyseNullAnnotations = this . environment . globalOptions . isAnnotationBasedNullAnalysisEnabled ; for ( int i = <NUM_LIT:0> , l = abstractMethods . length ; i < l ; i ++ ) { MethodBinding abstractMethod = abstractMethods [ i ] ; if ( concreteMethod . isVarargs ( ) != abstractMethod . isVarargs ( ) ) problemReporter ( ) . varargsConflict ( concreteMethod , abstractMethod , this . type ) ; MethodBinding originalInherited = abstractMethod . original ( ) ; if ( originalInherited . returnType != concreteMethod . returnType ) if ( ! isAcceptableReturnTypeOverride ( concreteMethod , abstractMethod ) ) problemReporter ( ) . unsafeReturnTypeOverride ( concreteMethod , originalInherited , this . type ) ; if ( originalInherited . declaringClass . isInterface ( ) ) { if ( ( concreteMethod . declaringClass == this . type . superclass && this . type . superclass . isParameterizedType ( ) && ! areMethodsCompatible ( concreteMethod , originalInherited ) ) || this . type . superclass . erasure ( ) . findSuperTypeOriginatingFrom ( originalInherited . declaringClass ) == null ) this . type . addSyntheticBridgeMethod ( originalInherited , concreteMethod . original ( ) ) ; } if ( analyseNullAnnotations && ! concreteMethod . isStatic ( ) && ! abstractMethod . isStatic ( ) ) checkNullSpecInheritance ( concreteMethod , abstractMethod ) ; } } void checkForBridgeMethod ( MethodBinding currentMethod , MethodBinding inheritedMethod , MethodBinding [ ] allInheritedMethods ) { if ( currentMethod . isVarargs ( ) != inheritedMethod . isVarargs ( ) ) problemReporter ( currentMethod ) . varargsConflict ( currentMethod , inheritedMethod , this . type ) ; MethodBinding originalInherited = inheritedMethod . original ( ) ; if ( originalInherited . returnType != currentMethod . returnType ) if ( ! isAcceptableReturnTypeOverride ( currentMethod , inheritedMethod ) ) problemReporter ( currentMethod ) . unsafeReturnTypeOverride ( currentMethod , originalInherited , this . type ) ; MethodBinding bridge = this . type . addSyntheticBridgeMethod ( originalInherited , currentMethod . original ( ) ) ; if ( bridge != null ) { for ( int i = <NUM_LIT:0> , l = allInheritedMethods == null ? <NUM_LIT:0> : allInheritedMethods . length ; i < l ; i ++ ) { if ( allInheritedMethods [ i ] != null && detectInheritedNameClash ( originalInherited , allInheritedMethods [ i ] . original ( ) ) ) return ; } MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( bridge . selector ) ; for ( int i = current . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; -- i ) { final MethodBinding thisMethod = current [ i ] ; if ( thisMethod . areParameterErasuresEqual ( bridge ) && thisMethod . returnType . erasure ( ) == bridge . returnType . erasure ( ) ) { problemReporter ( thisMethod ) . methodNameClash ( thisMethod , inheritedMethod . declaringClass . isRawType ( ) ? inheritedMethod : inheritedMethod . original ( ) , ProblemSeverities . Error ) ; return ; } } } } void checkForNameClash ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { if ( inheritedMethod . isStatic ( ) || currentMethod . isStatic ( ) ) { MethodBinding original = inheritedMethod . original ( ) ; if ( this . type . scope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_7 && currentMethod . areParameterErasuresEqual ( original ) ) { problemReporter ( currentMethod ) . methodNameClashHidden ( currentMethod , inheritedMethod . declaringClass . isRawType ( ) ? inheritedMethod : original ) ; } return ; } if ( ! detectNameClash ( currentMethod , inheritedMethod , false ) ) { TypeBinding [ ] currentParams = currentMethod . parameters ; TypeBinding [ ] inheritedParams = inheritedMethod . parameters ; int length = currentParams . length ; if ( length != inheritedParams . length ) return ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( currentParams [ i ] != inheritedParams [ i ] ) if ( currentParams [ i ] . isBaseType ( ) != inheritedParams [ i ] . isBaseType ( ) || ! inheritedParams [ i ] . isCompatibleWith ( currentParams [ i ] ) ) return ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding superType = inheritedMethod . declaringClass ; ReferenceBinding [ ] itsInterfaces = superType . superInterfaces ( ) ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { nextPosition = itsInterfaces . length ; interfacesToVisit = itsInterfaces ; } superType = superType . superclass ( ) ; while ( superType != null && superType . isValidBinding ( ) ) { MethodBinding [ ] methods = superType . getMethods ( currentMethod . selector ) ; for ( int m = <NUM_LIT:0> , n = methods . length ; m < n ; m ++ ) { MethodBinding substitute = computeSubstituteMethod ( methods [ m ] , currentMethod ) ; if ( substitute != null && ! isSubstituteParameterSubsignature ( currentMethod , substitute ) && detectNameClash ( currentMethod , substitute , true ) ) return ; } if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } superType = superType . superclass ( ) ; } for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { MethodBinding [ ] methods = superType . getMethods ( currentMethod . selector ) ; for ( int m = <NUM_LIT:0> , n = methods . length ; m < n ; m ++ ) { MethodBinding substitute = computeSubstituteMethod ( methods [ m ] , currentMethod ) ; if ( substitute != null && ! isSubstituteParameterSubsignature ( currentMethod , substitute ) && detectNameClash ( currentMethod , substitute , true ) ) return ; } if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } } } void checkInheritedMethods ( MethodBinding inheritedMethod , MethodBinding otherInheritedMethod ) { if ( inheritedMethod . isStatic ( ) ) return ; if ( this . environment . globalOptions . complianceLevel < ClassFileConstants . JDK1_7 && inheritedMethod . declaringClass . isInterface ( ) ) return ; detectInheritedNameClash ( inheritedMethod . original ( ) , otherInheritedMethod . original ( ) ) ; } void checkInheritedMethods ( MethodBinding [ ] methods , int length ) { boolean continueInvestigation = true ; MethodBinding concreteMethod = null ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! methods [ i ] . isAbstract ( ) ) { if ( concreteMethod != null ) { problemReporter ( ) . duplicateInheritedMethods ( this . type , concreteMethod , methods [ i ] ) ; continueInvestigation = false ; } concreteMethod = methods [ i ] ; } } if ( continueInvestigation ) { super . checkInheritedMethods ( methods , length ) ; } } boolean checkInheritedReturnTypes ( MethodBinding method , MethodBinding otherMethod ) { if ( areReturnTypesCompatible ( method , otherMethod ) ) return true ; if ( isUnsafeReturnTypeOverride ( method , otherMethod ) ) { if ( ! method . declaringClass . implementsInterface ( otherMethod . declaringClass , false ) ) problemReporter ( method ) . unsafeReturnTypeOverride ( method , otherMethod , this . type ) ; return true ; } return false ; } void checkAgainstInheritedMethods ( MethodBinding currentMethod , MethodBinding [ ] methods , int length , MethodBinding [ ] allInheritedMethods ) { super . checkAgainstInheritedMethods ( currentMethod , methods , length , allInheritedMethods ) ; if ( this . environment . globalOptions . isAnnotationBasedNullAnalysisEnabled ) { for ( int i = length ; -- i >= <NUM_LIT:0> ; ) if ( ! currentMethod . isStatic ( ) && ! methods [ i ] . isStatic ( ) ) checkNullSpecInheritance ( currentMethod , methods [ i ] ) ; } } void checkNullSpecInheritance ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { long inheritedBits = inheritedMethod . tagBits ; long currentBits = currentMethod . tagBits ; AbstractMethodDeclaration srcMethod = null ; if ( this . type . equals ( currentMethod . declaringClass ) ) srcMethod = currentMethod . sourceMethod ( ) ; if ( ( inheritedBits & TagBits . AnnotationNonNull ) != <NUM_LIT:0> ) { long currentNullBits = currentBits & ( TagBits . AnnotationNonNull | TagBits . AnnotationNullable ) ; if ( currentNullBits != TagBits . AnnotationNonNull ) { if ( srcMethod != null ) { this . type . scope . problemReporter ( ) . illegalReturnRedefinition ( srcMethod , inheritedMethod , this . environment . getNonNullAnnotationName ( ) ) ; } else { this . type . scope . problemReporter ( ) . cannotImplementIncompatibleNullness ( currentMethod , inheritedMethod ) ; return ; } } } Argument [ ] currentArguments = srcMethod == null ? null : srcMethod . arguments ; if ( inheritedMethod . parameterNonNullness != null ) { int length = inheritedMethod . parameterNonNullness . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Argument currentArgument = currentArguments == null ? null : currentArguments [ i ] ; Boolean inheritedNonNullNess = inheritedMethod . parameterNonNullness [ i ] ; Boolean currentNonNullNess = ( currentMethod . parameterNonNullness == null ) ? null : currentMethod . parameterNonNullness [ i ] ; if ( inheritedNonNullNess != null ) { if ( currentNonNullNess == null ) { boolean needNonNull = false ; char [ ] [ ] annotationName ; if ( inheritedNonNullNess == Boolean . TRUE ) { needNonNull = true ; annotationName = this . environment . getNonNullAnnotationName ( ) ; } else { annotationName = this . environment . getNullableAnnotationName ( ) ; } if ( currentArgument != null ) { this . type . scope . problemReporter ( ) . parameterLackingNullAnnotation ( currentArgument , inheritedMethod . declaringClass , needNonNull , annotationName ) ; continue ; } else { this . type . scope . problemReporter ( ) . cannotImplementIncompatibleNullness ( currentMethod , inheritedMethod ) ; break ; } } } if ( inheritedNonNullNess != Boolean . TRUE ) { if ( currentNonNullNess == Boolean . TRUE ) { if ( currentArgument != null ) this . type . scope . problemReporter ( ) . illegalRedefinitionToNonNullParameter ( currentArgument , inheritedMethod . declaringClass , inheritedNonNullNess == null ? null : this . environment . getNullableAnnotationName ( ) ) ; else this . type . scope . problemReporter ( ) . cannotImplementIncompatibleNullness ( currentMethod , inheritedMethod ) ; } } } } else if ( currentMethod . parameterNonNullness != null ) { for ( int i = <NUM_LIT:0> ; i < currentMethod . parameterNonNullness . length ; i ++ ) { if ( currentMethod . parameterNonNullness [ i ] == Boolean . TRUE ) { if ( currentArguments != null ) { this . type . scope . problemReporter ( ) . illegalRedefinitionToNonNullParameter ( currentArguments [ i ] , inheritedMethod . declaringClass , null ) ; } else { this . type . scope . problemReporter ( ) . cannotImplementIncompatibleNullness ( currentMethod , inheritedMethod ) ; break ; } } } } } void reportRawReferences ( ) { CompilerOptions compilerOptions = this . type . scope . compilerOptions ( ) ; if ( compilerOptions . sourceLevel < ClassFileConstants . JDK1_5 || compilerOptions . reportUnavoidableGenericTypeProblems ) { return ; } Object [ ] methodArray = this . currentMethods . valueTable ; for ( int s = methodArray . length ; -- s >= <NUM_LIT:0> ; ) { if ( methodArray [ s ] == null ) continue ; MethodBinding [ ] current = ( MethodBinding [ ] ) methodArray [ s ] ; for ( int i = <NUM_LIT:0> , length = current . length ; i < length ; i ++ ) { MethodBinding currentMethod = current [ i ] ; if ( ( currentMethod . modifiers & ( ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ) ) == <NUM_LIT:0> ) { AbstractMethodDeclaration methodDecl = currentMethod . sourceMethod ( ) ; if ( methodDecl == null ) return ; TypeBinding [ ] parameterTypes = currentMethod . parameters ; Argument [ ] arguments = methodDecl . arguments ; for ( int j = <NUM_LIT:0> , size = currentMethod . parameters . length ; j < size ; j ++ ) { TypeBinding parameterType = parameterTypes [ j ] ; Argument arg = arguments [ j ] ; if ( parameterType . leafComponentType ( ) . isRawType ( ) && compilerOptions . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore && ( arg . type . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ) { methodDecl . scope . problemReporter ( ) . rawTypeReference ( arg . type , parameterType ) ; } } if ( ! methodDecl . isConstructor ( ) && methodDecl instanceof MethodDeclaration ) { TypeReference returnType = ( ( MethodDeclaration ) methodDecl ) . returnType ; TypeBinding methodType = currentMethod . returnType ; if ( returnType != null ) { if ( methodType . leafComponentType ( ) . isRawType ( ) && compilerOptions . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore && ( returnType . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ) { methodDecl . scope . problemReporter ( ) . rawTypeReference ( returnType , methodType ) ; } } } } } } } public void reportRawReferences ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { CompilerOptions compilerOptions = this . type . scope . compilerOptions ( ) ; if ( compilerOptions . sourceLevel < ClassFileConstants . JDK1_5 || compilerOptions . reportUnavoidableGenericTypeProblems ) { return ; } AbstractMethodDeclaration methodDecl = currentMethod . sourceMethod ( ) ; if ( methodDecl == null ) return ; TypeBinding [ ] parameterTypes = currentMethod . parameters ; TypeBinding [ ] inheritedParameterTypes = inheritedMethod . parameters ; Argument [ ] arguments = methodDecl . arguments ; for ( int j = <NUM_LIT:0> , size = currentMethod . parameters . length ; j < size ; j ++ ) { TypeBinding parameterType = parameterTypes [ j ] ; TypeBinding inheritedParameterType = inheritedParameterTypes [ j ] ; Argument arg = arguments [ j ] ; if ( parameterType . leafComponentType ( ) . isRawType ( ) ) { if ( inheritedParameterType . leafComponentType ( ) . isRawType ( ) ) { arg . binding . tagBits |= TagBits . ForcedToBeRawType ; } else { if ( compilerOptions . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore && ( arg . type . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ) { methodDecl . scope . problemReporter ( ) . rawTypeReference ( arg . type , parameterType ) ; } } } } TypeReference returnType = null ; if ( ! methodDecl . isConstructor ( ) && methodDecl instanceof MethodDeclaration && ( returnType = ( ( MethodDeclaration ) methodDecl ) . returnType ) != null ) { final TypeBinding inheritedMethodType = inheritedMethod . returnType ; final TypeBinding methodType = currentMethod . returnType ; if ( methodType . leafComponentType ( ) . isRawType ( ) ) { if ( inheritedMethodType . leafComponentType ( ) . isRawType ( ) ) { } else { if ( ( returnType . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> && compilerOptions . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore ) { methodDecl . scope . problemReporter ( ) . rawTypeReference ( returnType , methodType ) ; } } } } } void checkMethods ( ) { boolean mustImplementAbstractMethods = mustImplementAbstractMethods ( ) ; boolean skipInheritedMethods = mustImplementAbstractMethods && canSkipInheritedMethods ( ) ; boolean isOrEnclosedByPrivateType = this . type . isOrEnclosedByPrivateType ( ) ; char [ ] [ ] methodSelectors = this . inheritedMethods . keyTable ; nextSelector : for ( int s = methodSelectors . length ; -- s >= <NUM_LIT:0> ; ) { if ( methodSelectors [ s ] == null ) continue nextSelector ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( methodSelectors [ s ] ) ; MethodBinding [ ] inherited = ( MethodBinding [ ] ) this . inheritedMethods . valueTable [ s ] ; if ( current == null && ! isOrEnclosedByPrivateType ) { int length = inherited . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { inherited [ i ] . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } if ( current == null && this . type . isPublic ( ) ) { int length = inherited . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { MethodBinding inheritedMethod = inherited [ i ] ; if ( inheritedMethod . isPublic ( ) && ! inheritedMethod . declaringClass . isPublic ( ) ) this . type . addSyntheticBridgeMethod ( inheritedMethod . original ( ) ) ; } } if ( current == null && skipInheritedMethods ) continue nextSelector ; if ( inherited . length == <NUM_LIT:1> && current == null ) { if ( mustImplementAbstractMethods && inherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( inherited [ <NUM_LIT:0> ] ) ; continue nextSelector ; } int index = - <NUM_LIT:1> ; int inheritedLength = inherited . length ; MethodBinding [ ] matchingInherited = new MethodBinding [ inheritedLength ] ; MethodBinding [ ] foundMatch = new MethodBinding [ inheritedLength ] ; if ( current != null ) { for ( int i = <NUM_LIT:0> , length1 = current . length ; i < length1 ; i ++ ) { MethodBinding currentMethod = current [ i ] ; MethodBinding [ ] nonMatchingInherited = null ; for ( int j = <NUM_LIT:0> ; j < inheritedLength ; j ++ ) { MethodBinding inheritedMethod = computeSubstituteMethod ( inherited [ j ] , currentMethod ) ; if ( inheritedMethod != null ) { if ( foundMatch [ j ] == null && isSubstituteParameterSubsignature ( currentMethod , inheritedMethod ) ) { matchingInherited [ ++ index ] = inheritedMethod ; foundMatch [ j ] = currentMethod ; } else { checkForNameClash ( currentMethod , inheritedMethod ) ; if ( inheritedLength > <NUM_LIT:1> ) { if ( nonMatchingInherited == null ) nonMatchingInherited = new MethodBinding [ inheritedLength ] ; nonMatchingInherited [ j ] = inheritedMethod ; } } } } if ( index >= <NUM_LIT:0> ) { checkAgainstInheritedMethods ( currentMethod , matchingInherited , index + <NUM_LIT:1> , nonMatchingInherited ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } boolean [ ] skip = new boolean [ inheritedLength ] ; for ( int i = <NUM_LIT:0> ; i < inheritedLength ; i ++ ) { MethodBinding matchMethod = foundMatch [ i ] ; if ( matchMethod == null && current != null && this . type . isPublic ( ) ) { MethodBinding inheritedMethod = inherited [ i ] ; if ( inheritedMethod . isPublic ( ) && ! inheritedMethod . declaringClass . isPublic ( ) ) { this . type . addSyntheticBridgeMethod ( inheritedMethod . original ( ) ) ; } } if ( ! isOrEnclosedByPrivateType && matchMethod == null && current != null ) { inherited [ i ] . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( skip [ i ] ) continue ; MethodBinding inheritedMethod = inherited [ i ] ; if ( matchMethod == null ) matchingInherited [ ++ index ] = inheritedMethod ; for ( int j = i + <NUM_LIT:1> ; j < inheritedLength ; j ++ ) { MethodBinding otherInheritedMethod = inherited [ j ] ; if ( matchMethod == foundMatch [ j ] && matchMethod != null ) continue ; if ( canSkipInheritedMethods ( inheritedMethod , otherInheritedMethod ) ) continue ; if ( inheritedMethod . declaringClass != otherInheritedMethod . declaringClass ) { if ( otherInheritedMethod . declaringClass . isInterface ( ) ) { if ( isInterfaceMethodImplemented ( otherInheritedMethod , inheritedMethod , otherInheritedMethod . declaringClass ) ) { skip [ j ] = true ; continue ; } } else if ( areMethodsCompatible ( inheritedMethod , otherInheritedMethod ) ) { skip [ j ] = true ; continue ; } } otherInheritedMethod = computeSubstituteMethod ( otherInheritedMethod , inheritedMethod ) ; if ( otherInheritedMethod != null ) { if ( isSubstituteParameterSubsignature ( inheritedMethod , otherInheritedMethod ) ) { if ( index == - <NUM_LIT:1> ) matchingInherited [ ++ index ] = inheritedMethod ; if ( foundMatch [ j ] == null ) matchingInherited [ ++ index ] = otherInheritedMethod ; skip [ j ] = true ; } else if ( matchMethod == null && foundMatch [ j ] == null ) { checkInheritedMethods ( inheritedMethod , otherInheritedMethod ) ; } } } if ( index == - <NUM_LIT:1> ) continue ; if ( index > <NUM_LIT:0> ) checkInheritedMethods ( matchingInherited , index + <NUM_LIT:1> ) ; else if ( mustImplementAbstractMethods && matchingInherited [ <NUM_LIT:0> ] . isAbstract ( ) && matchMethod == null ) checkAbstractMethod ( matchingInherited [ <NUM_LIT:0> ] ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } void checkTypeVariableMethods ( TypeParameter typeParameter ) { char [ ] [ ] methodSelectors = this . inheritedMethods . keyTable ; nextSelector : for ( int s = methodSelectors . length ; -- s >= <NUM_LIT:0> ; ) { if ( methodSelectors [ s ] == null ) continue nextSelector ; MethodBinding [ ] inherited = ( MethodBinding [ ] ) this . inheritedMethods . valueTable [ s ] ; if ( inherited . length == <NUM_LIT:1> ) continue nextSelector ; int index = - <NUM_LIT:1> ; MethodBinding [ ] matchingInherited = new MethodBinding [ inherited . length ] ; for ( int i = <NUM_LIT:0> , length = inherited . length ; i < length ; i ++ ) { while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; MethodBinding inheritedMethod = inherited [ i ] ; if ( inheritedMethod != null ) { matchingInherited [ ++ index ] = inheritedMethod ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { MethodBinding otherInheritedMethod = inherited [ j ] ; if ( canSkipInheritedMethods ( inheritedMethod , otherInheritedMethod ) ) continue ; otherInheritedMethod = computeSubstituteMethod ( otherInheritedMethod , inheritedMethod ) ; if ( otherInheritedMethod != null && isSubstituteParameterSubsignature ( inheritedMethod , otherInheritedMethod ) ) { matchingInherited [ ++ index ] = otherInheritedMethod ; inherited [ j ] = null ; } } } if ( index > <NUM_LIT:0> ) { MethodBinding first = matchingInherited [ <NUM_LIT:0> ] ; int count = index + <NUM_LIT:1> ; while ( -- count > <NUM_LIT:0> ) { MethodBinding match = matchingInherited [ count ] ; MethodBinding interfaceMethod = null , implementation = null ; if ( first . declaringClass . isInterface ( ) ) { interfaceMethod = first ; } else if ( first . declaringClass . isClass ( ) ) { implementation = first ; } if ( match . declaringClass . isInterface ( ) ) { interfaceMethod = match ; } else if ( match . declaringClass . isClass ( ) ) { implementation = match ; } if ( interfaceMethod != null && implementation != null && ! isAsVisible ( implementation , interfaceMethod ) ) problemReporter ( ) . inheritedMethodReducesVisibility ( typeParameter , implementation , new MethodBinding [ ] { interfaceMethod } ) ; if ( areReturnTypesCompatible ( first , match ) ) continue ; if ( first . declaringClass . isInterface ( ) && match . declaringClass . isInterface ( ) && areReturnTypesCompatible ( match , first ) ) continue ; break ; } if ( count > <NUM_LIT:0> ) { problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( typeParameter , matchingInherited , index + <NUM_LIT:1> ) ; continue nextSelector ; } } } } } MethodBinding computeSubstituteMethod ( MethodBinding inheritedMethod , MethodBinding currentMethod ) { if ( inheritedMethod == null ) return null ; if ( currentMethod . parameters . length != inheritedMethod . parameters . length ) return null ; if ( currentMethod . declaringClass instanceof BinaryTypeBinding ) ( ( BinaryTypeBinding ) currentMethod . declaringClass ) . resolveTypesFor ( currentMethod ) ; if ( inheritedMethod . declaringClass instanceof BinaryTypeBinding ) ( ( BinaryTypeBinding ) inheritedMethod . declaringClass ) . resolveTypesFor ( inheritedMethod ) ; TypeVariableBinding [ ] inheritedTypeVariables = inheritedMethod . typeVariables ; int inheritedLength = inheritedTypeVariables . length ; if ( inheritedLength == <NUM_LIT:0> ) return inheritedMethod ; TypeVariableBinding [ ] typeVariables = currentMethod . typeVariables ; int length = typeVariables . length ; if ( length == <NUM_LIT:0> ) return inheritedMethod . asRawMethod ( this . environment ) ; if ( length != inheritedLength ) return inheritedMethod ; TypeBinding [ ] arguments = new TypeBinding [ length ] ; System . arraycopy ( typeVariables , <NUM_LIT:0> , arguments , <NUM_LIT:0> , length ) ; ParameterizedGenericMethodBinding substitute = this . environment . createParameterizedGenericMethod ( inheritedMethod , arguments ) ; for ( int i = <NUM_LIT:0> ; i < inheritedLength ; i ++ ) { TypeVariableBinding inheritedTypeVariable = inheritedTypeVariables [ i ] ; TypeBinding argument = arguments [ i ] ; if ( argument instanceof TypeVariableBinding ) { TypeVariableBinding typeVariable = ( TypeVariableBinding ) argument ; if ( typeVariable . firstBound == inheritedTypeVariable . firstBound ) { if ( typeVariable . firstBound == null ) continue ; } else if ( typeVariable . firstBound != null && inheritedTypeVariable . firstBound != null ) { if ( typeVariable . firstBound . isClass ( ) != inheritedTypeVariable . firstBound . isClass ( ) ) return inheritedMethod ; } if ( Scope . substitute ( substitute , inheritedTypeVariable . superclass ) != typeVariable . superclass ) return inheritedMethod ; int interfaceLength = inheritedTypeVariable . superInterfaces . length ; ReferenceBinding [ ] interfaces = typeVariable . superInterfaces ; if ( interfaceLength != interfaces . length ) return inheritedMethod ; next : for ( int j = <NUM_LIT:0> ; j < interfaceLength ; j ++ ) { TypeBinding superType = Scope . substitute ( substitute , inheritedTypeVariable . superInterfaces [ j ] ) ; for ( int k = <NUM_LIT:0> ; k < interfaceLength ; k ++ ) if ( superType == interfaces [ k ] ) continue next ; return inheritedMethod ; } } else if ( inheritedTypeVariable . boundCheck ( substitute , argument ) != TypeConstants . OK ) { return inheritedMethod ; } } return substitute ; } boolean detectInheritedNameClash ( MethodBinding inherited , MethodBinding otherInherited ) { if ( ! inherited . areParameterErasuresEqual ( otherInherited ) ) return false ; if ( inherited . returnType . erasure ( ) != otherInherited . returnType . erasure ( ) ) return false ; if ( inherited . declaringClass . erasure ( ) != otherInherited . declaringClass . erasure ( ) ) { if ( inherited . declaringClass . findSuperTypeOriginatingFrom ( otherInherited . declaringClass ) != null ) return false ; if ( otherInherited . declaringClass . findSuperTypeOriginatingFrom ( inherited . declaringClass ) != null ) return false ; } problemReporter ( ) . inheritedMethodsHaveNameClash ( this . type , inherited , otherInherited ) ; return true ; } boolean detectNameClash ( MethodBinding current , MethodBinding inherited , boolean treatAsSynthetic ) { MethodBinding methodToCheck = inherited ; MethodBinding original = methodToCheck . original ( ) ; if ( ! current . areParameterErasuresEqual ( original ) ) return false ; int severity = ProblemSeverities . Error ; if ( this . environment . globalOptions . complianceLevel == ClassFileConstants . JDK1_6 ) { if ( current . returnType . erasure ( ) != original . returnType . erasure ( ) ) severity = ProblemSeverities . Warning ; } if ( ! treatAsSynthetic ) { MethodBinding [ ] currentNamesakes = ( MethodBinding [ ] ) this . currentMethods . get ( inherited . selector ) ; if ( currentNamesakes . length > <NUM_LIT:1> ) { for ( int i = <NUM_LIT:0> , length = currentNamesakes . length ; i < length ; i ++ ) { MethodBinding currentMethod = currentNamesakes [ i ] ; if ( currentMethod != current && doesMethodOverride ( currentMethod , inherited ) ) { methodToCheck = currentMethod ; break ; } } } } original = methodToCheck . original ( ) ; if ( ! current . areParameterErasuresEqual ( original ) ) return false ; original = inherited . original ( ) ; problemReporter ( current ) . methodNameClash ( current , inherited . declaringClass . isRawType ( ) ? inherited : original , severity ) ; if ( severity == ProblemSeverities . Warning ) return false ; return true ; } public boolean doesMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { return couldMethodOverride ( method , inheritedMethod ) && areMethodsCompatible ( method , inheritedMethod ) ; } boolean doTypeVariablesClash ( MethodBinding one , MethodBinding substituteTwo ) { return one . typeVariables != Binding . NO_TYPE_VARIABLES && ! ( substituteTwo instanceof ParameterizedGenericMethodBinding ) ; } SimpleSet findSuperinterfaceCollisions ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding [ ] itsInterfaces = superInterfaces ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { nextPosition = itsInterfaces . length ; interfacesToVisit = itsInterfaces ; } boolean isInconsistent = this . type . isHierarchyInconsistent ( ) ; ReferenceBinding superType = superclass ; while ( superType != null && superType . isValidBinding ( ) ) { isInconsistent |= superType . isHierarchyInconsistent ( ) ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } superType = superType . superclass ( ) ; } for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { isInconsistent |= superType . isHierarchyInconsistent ( ) ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ! isInconsistent ) return null ; SimpleSet copy = null ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding current = interfacesToVisit [ i ] ; if ( current . isValidBinding ( ) ) { TypeBinding erasure = current . erasure ( ) ; for ( int j = i + <NUM_LIT:1> ; j < nextPosition ; j ++ ) { ReferenceBinding next = interfacesToVisit [ j ] ; if ( next . isValidBinding ( ) && next . erasure ( ) == erasure ) { if ( copy == null ) copy = new SimpleSet ( nextPosition ) ; copy . add ( interfacesToVisit [ i ] ) ; copy . add ( interfacesToVisit [ j ] ) ; } } } } return copy ; } boolean hasGenericParameter ( MethodBinding method ) { if ( method . genericSignature ( ) == null ) return false ; TypeBinding [ ] params = method . parameters ; for ( int i = <NUM_LIT:0> , l = params . length ; i < l ; i ++ ) { TypeBinding param = params [ i ] . leafComponentType ( ) ; if ( param instanceof ReferenceBinding ) { int modifiers = ( ( ReferenceBinding ) param ) . modifiers ; if ( ( modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) return true ; } } return false ; } boolean isAcceptableReturnTypeOverride ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { if ( inheritedMethod . declaringClass . isRawType ( ) ) return true ; MethodBinding originalInherited = inheritedMethod . original ( ) ; TypeBinding originalInheritedReturnType = originalInherited . returnType . leafComponentType ( ) ; if ( originalInheritedReturnType . isParameterizedTypeWithActualArguments ( ) ) return ! currentMethod . returnType . leafComponentType ( ) . isRawType ( ) ; TypeBinding currentReturnType = currentMethod . returnType . leafComponentType ( ) ; switch ( currentReturnType . kind ( ) ) { case Binding . TYPE_PARAMETER : if ( currentReturnType == inheritedMethod . returnType . leafComponentType ( ) ) return true ; default : if ( originalInheritedReturnType . isTypeVariable ( ) ) if ( ( ( TypeVariableBinding ) originalInheritedReturnType ) . declaringElement == originalInherited ) return false ; return true ; } } boolean isInterfaceMethodImplemented ( MethodBinding inheritedMethod , MethodBinding existingMethod , ReferenceBinding superType ) { if ( inheritedMethod . original ( ) != inheritedMethod && existingMethod . declaringClass . isInterface ( ) ) return false ; inheritedMethod = computeSubstituteMethod ( inheritedMethod , existingMethod ) ; return inheritedMethod != null && inheritedMethod . returnType == existingMethod . returnType && doesMethodOverride ( existingMethod , inheritedMethod ) ; } public boolean isMethodSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) ) return false ; if ( method . declaringClass . isParameterizedType ( ) ) method = method . original ( ) ; MethodBinding inheritedOriginal = method . findOriginalInheritedMethod ( inheritedMethod ) ; return isParameterSubsignature ( method , inheritedOriginal == null ? inheritedMethod : inheritedOriginal ) ; } boolean isParameterSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { MethodBinding substitute = computeSubstituteMethod ( inheritedMethod , method ) ; return substitute != null && isSubstituteParameterSubsignature ( method , substitute ) ; } boolean isSubstituteParameterSubsignature ( MethodBinding method , MethodBinding substituteMethod ) { if ( ! areParametersEqual ( method , substituteMethod ) ) { if ( substituteMethod . hasSubstitutedParameters ( ) && method . areParameterErasuresEqual ( substituteMethod ) ) return method . typeVariables == Binding . NO_TYPE_VARIABLES && ! hasGenericParameter ( method ) ; if ( method . declaringClass . isRawType ( ) && substituteMethod . declaringClass . isRawType ( ) ) if ( method . hasSubstitutedParameters ( ) && substituteMethod . hasSubstitutedParameters ( ) ) return areMethodsCompatible ( method , substituteMethod ) ; return false ; } if ( substituteMethod instanceof ParameterizedGenericMethodBinding ) { if ( method . typeVariables != Binding . NO_TYPE_VARIABLES ) return ! ( ( ParameterizedGenericMethodBinding ) substituteMethod ) . isRaw ; return ! hasGenericParameter ( method ) ; } return method . typeVariables == Binding . NO_TYPE_VARIABLES ; } boolean isUnsafeReturnTypeOverride ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { if ( currentMethod . returnType == inheritedMethod . returnType . erasure ( ) ) { TypeBinding [ ] currentParams = currentMethod . parameters ; TypeBinding [ ] inheritedParams = inheritedMethod . parameters ; for ( int i = <NUM_LIT:0> , l = currentParams . length ; i < l ; i ++ ) if ( ! areTypesEqual ( currentParams [ i ] , inheritedParams [ i ] ) ) return true ; } if ( currentMethod . typeVariables == Binding . NO_TYPE_VARIABLES && inheritedMethod . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES && currentMethod . returnType . erasure ( ) . findSuperTypeOriginatingFrom ( inheritedMethod . returnType . erasure ( ) ) != null ) { return true ; } return false ; } boolean reportIncompatibleReturnTypeError ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { if ( isUnsafeReturnTypeOverride ( currentMethod , inheritedMethod ) ) { problemReporter ( currentMethod ) . unsafeReturnTypeOverride ( currentMethod , inheritedMethod , this . type ) ; return false ; } return super . reportIncompatibleReturnTypeError ( currentMethod , inheritedMethod ) ; } void verify ( ) { if ( this . type . isAnnotationType ( ) ) this . type . detectAnnotationCycle ( ) ; super . verify ( ) ; reportRawReferences ( ) ; for ( int i = this . type . typeVariables . length ; -- i >= <NUM_LIT:0> ; ) { TypeVariableBinding var = this . type . typeVariables [ i ] ; if ( var . superInterfaces == Binding . NO_SUPERINTERFACES ) continue ; if ( var . superInterfaces . length == <NUM_LIT:1> && var . superclass . id == TypeIds . T_JavaLangObject ) continue ; this . currentMethods = new HashtableOfObject ( <NUM_LIT:0> ) ; ReferenceBinding superclass = var . superclass ( ) ; if ( superclass . kind ( ) == Binding . TYPE_PARAMETER ) superclass = ( ReferenceBinding ) superclass . erasure ( ) ; ReferenceBinding [ ] itsInterfaces = var . superInterfaces ( ) ; ReferenceBinding [ ] superInterfaces = new ReferenceBinding [ itsInterfaces . length ] ; for ( int j = itsInterfaces . length ; -- j >= <NUM_LIT:0> ; ) { superInterfaces [ j ] = itsInterfaces [ j ] . kind ( ) == Binding . TYPE_PARAMETER ? ( ReferenceBinding ) itsInterfaces [ j ] . erasure ( ) : itsInterfaces [ j ] ; } computeInheritedMethods ( superclass , superInterfaces ) ; checkTypeVariableMethods ( this . type . scope . referenceContext . typeParameters [ i ] ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . Arrays ; import java . util . Comparator ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; abstract public class ReferenceBinding extends TypeBinding { public char [ ] [ ] compoundName ; public char [ ] sourceName ; public int modifiers ; public PackageBinding fPackage ; char [ ] fileName ; char [ ] constantPoolName ; char [ ] signature ; private SimpleLookupTable compatibleCache ; int typeBits ; public static final ReferenceBinding LUB_GENERIC = new ReferenceBinding ( ) { public boolean hasTypeBit ( int bit ) { return false ; } } ; private static final Comparator FIELD_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { char [ ] n1 = ( ( FieldBinding ) o1 ) . name ; char [ ] n2 = ( ( FieldBinding ) o2 ) . name ; return ReferenceBinding . compare ( n1 , n2 , n1 . length , n2 . length ) ; } } ; private static final Comparator METHOD_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { MethodBinding m1 = ( MethodBinding ) o1 ; MethodBinding m2 = ( MethodBinding ) o2 ; char [ ] s1 = m1 . selector ; char [ ] s2 = m2 . selector ; int c = ReferenceBinding . compare ( s1 , s2 , s1 . length , s2 . length ) ; return c == <NUM_LIT:0> ? m1 . parameters . length - m2 . parameters . length : c ; } } ; public static FieldBinding binarySearch ( char [ ] name , FieldBinding [ ] sortedFields ) { if ( sortedFields == null ) return null ; int max = sortedFields . length ; if ( max == <NUM_LIT:0> ) return null ; int left = <NUM_LIT:0> , right = max - <NUM_LIT:1> , nameLength = name . length ; int mid = <NUM_LIT:0> ; char [ ] midName ; while ( left <= right ) { mid = left + ( right - left ) / <NUM_LIT:2> ; int compare = compare ( name , midName = sortedFields [ mid ] . name , nameLength , midName . length ) ; if ( compare < <NUM_LIT:0> ) { right = mid - <NUM_LIT:1> ; } else if ( compare > <NUM_LIT:0> ) { left = mid + <NUM_LIT:1> ; } else { return sortedFields [ mid ] ; } } return null ; } public static long binarySearch ( char [ ] selector , MethodBinding [ ] sortedMethods ) { if ( sortedMethods == null ) return - <NUM_LIT:1> ; int max = sortedMethods . length ; if ( max == <NUM_LIT:0> ) return - <NUM_LIT:1> ; int left = <NUM_LIT:0> , right = max - <NUM_LIT:1> , selectorLength = selector . length ; int mid = <NUM_LIT:0> ; char [ ] midSelector ; while ( left <= right ) { mid = left + ( right - left ) / <NUM_LIT:2> ; int compare = compare ( selector , midSelector = sortedMethods [ mid ] . selector , selectorLength , midSelector . length ) ; if ( compare < <NUM_LIT:0> ) { right = mid - <NUM_LIT:1> ; } else if ( compare > <NUM_LIT:0> ) { left = mid + <NUM_LIT:1> ; } else { int start = mid , end = mid ; while ( start > left && CharOperation . equals ( sortedMethods [ start - <NUM_LIT:1> ] . selector , selector ) ) { start -- ; } while ( end < right && CharOperation . equals ( sortedMethods [ end + <NUM_LIT:1> ] . selector , selector ) ) { end ++ ; } return start + ( ( long ) end << <NUM_LIT:32> ) ; } } return - <NUM_LIT:1> ; } static int compare ( char [ ] str1 , char [ ] str2 , int len1 , int len2 ) { int n = Math . min ( len1 , len2 ) ; int i = <NUM_LIT:0> ; while ( n -- != <NUM_LIT:0> ) { char c1 = str1 [ i ] ; char c2 = str2 [ i ++ ] ; if ( c1 != c2 ) { return c1 - c2 ; } } return len1 - len2 ; } public static void sortFields ( FieldBinding [ ] sortedFields , int left , int right ) { Arrays . sort ( sortedFields , left , right , FIELD_COMPARATOR ) ; } public static void sortMethods ( MethodBinding [ ] sortedMethods , int left , int right ) { Arrays . sort ( sortedMethods , left , right , METHOD_COMPARATOR ) ; } public FieldBinding [ ] availableFields ( ) { return fields ( ) ; } public MethodBinding [ ] availableMethods ( ) { return methods ( ) ; } public boolean canBeInstantiated ( ) { return ( this . modifiers & ( ClassFileConstants . AccAbstract | ClassFileConstants . AccInterface | ClassFileConstants . AccEnum | ClassFileConstants . AccAnnotation ) ) == <NUM_LIT:0> ; } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { if ( isPublic ( ) ) return true ; if ( isPrivate ( ) ) return false ; return invocationPackage == this . fPackage ; } public final boolean canBeSeenBy ( ReferenceBinding receiverType , ReferenceBinding invocationType ) { if ( isPublic ( ) ) return true ; if ( invocationType == this && invocationType == receiverType ) return true ; if ( isProtected ( ) ) { if ( invocationType == this ) return true ; if ( invocationType . fPackage == this . fPackage ) return true ; TypeBinding currentType = invocationType . erasure ( ) ; TypeBinding declaringClass = enclosingType ( ) . erasure ( ) ; if ( declaringClass == invocationType ) return true ; if ( declaringClass == null ) return false ; do { if ( currentType . findSuperTypeOriginatingFrom ( declaringClass ) != null ) return true ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { receiverCheck : { if ( ! ( receiverType == this || receiverType == enclosingType ( ) ) ) { if ( receiverType . isTypeVariable ( ) ) { TypeVariableBinding typeVariable = ( TypeVariableBinding ) receiverType ; if ( typeVariable . environment . globalOptions . complianceLevel <= ClassFileConstants . JDK1_6 && ( typeVariable . isErasureBoundTo ( erasure ( ) ) || typeVariable . isErasureBoundTo ( enclosingType ( ) . erasure ( ) ) ) ) break receiverCheck ; } return false ; } } if ( invocationType != this ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } if ( invocationType . fPackage != this . fPackage ) return false ; ReferenceBinding currentType = receiverType ; TypeBinding originalDeclaringClass = ( enclosingType ( ) == null ? this : enclosingType ( ) ) . original ( ) ; do { if ( currentType . isCapture ( ) ) { if ( originalDeclaringClass == currentType . erasure ( ) . original ( ) ) return true ; } else { if ( originalDeclaringClass == currentType . original ( ) ) return true ; } PackageBinding currentPackage = currentType . fPackage ; if ( currentPackage != null && currentPackage != this . fPackage ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public final boolean canBeSeenBy ( Scope scope ) { if ( scope . compilationUnitScope ( ) != null && scope . compilationUnitScope ( ) . canSeeEverything ( ) ) { return true ; } if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( invocationType == this ) return true ; if ( invocationType == null ) return ! isPrivate ( ) && scope . getCurrentPackage ( ) == this . fPackage ; if ( isProtected ( ) ) { if ( invocationType . fPackage == this . fPackage ) return true ; TypeBinding declaringClass = enclosingType ( ) ; if ( declaringClass == null ) return false ; declaringClass = declaringClass . erasure ( ) ; TypeBinding currentType = invocationType . erasure ( ) ; do { if ( declaringClass == invocationType ) return true ; if ( currentType . findSuperTypeOriginatingFrom ( declaringClass ) != null ) return true ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } return outerInvocationType == outerDeclaringClass ; } return invocationType . fPackage == this . fPackage ; } public char [ ] computeGenericTypeSignature ( TypeVariableBinding [ ] typeVariables ) { boolean isMemberOfGeneric = isMemberType ( ) && ( enclosingType ( ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ; if ( typeVariables == Binding . NO_TYPE_VARIABLES && ! isMemberOfGeneric ) { return signature ( ) ; } StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberOfGeneric ) { char [ ] typeSig = enclosingType ( ) . genericTypeSignature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT:.>' ) ; sig . append ( this . sourceName ) ; } else { char [ ] typeSig = signature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } if ( typeVariables == Binding . NO_TYPE_VARIABLES ) { sig . append ( '<CHAR_LIT:;>' ) ; } else { sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVariables . length ; i < length ; i ++ ) { sig . append ( typeVariables [ i ] . genericTypeSignature ( ) ) ; } sig . append ( "<STR_LIT>" ) ; } int sigLength = sig . length ( ) ; char [ ] result = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , result , <NUM_LIT:0> ) ; return result ; } public void computeId ( ) { switch ( this . compoundName . length ) { case <NUM_LIT:3> : if ( ! CharOperation . equals ( TypeConstants . JAVA , this . compoundName [ <NUM_LIT:0> ] ) ) return ; char [ ] packageName = this . compoundName [ <NUM_LIT:1> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; char [ ] typeName = this . compoundName [ <NUM_LIT:2> ] ; if ( typeName . length == <NUM_LIT:0> ) return ; if ( ! CharOperation . equals ( TypeConstants . LANG , this . compoundName [ <NUM_LIT:1> ] ) ) { switch ( packageName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( packageName , TypeConstants . IO ) ) { switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_IO_CLOSEABLE [ <NUM_LIT:2> ] ) ) this . typeBits |= TypeIds . BitCloseable ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_IO_EXTERNALIZABLE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaIoExternalizable ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_IO_IOEXCEPTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaIoException ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_IO_OBJECTSTREAMEXCEPTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaIoObjectStreamException ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_IO_PRINTSTREAM [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaIoPrintStream ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_IO_SERIALIZABLE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaIoSerializable ; return ; } } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( packageName , TypeConstants . UTIL ) ) { switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_UTIL_COLLECTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaUtilCollection ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_UTIL_ITERATOR [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaUtilIterator ; return ; } } return ; } return ; } switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:A>' : switch ( typeName . length ) { case <NUM_LIT> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_AUTOCLOSEABLE [ <NUM_LIT:2> ] ) ) { this . id = TypeIds . T_JavaLangAutoCloseable ; this . typeBits |= TypeIds . BitAutoCloseable ; } return ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ASSERTIONERROR [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangAssertionError ; return ; } return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:4> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_BYTE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangByte ; return ; case <NUM_LIT:7> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_BOOLEAN [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangBoolean ; return ; } return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:5> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_CLASS [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangClass ; return ; case <NUM_LIT:9> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_CHARACTER [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangCharacter ; else if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_CLONEABLE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangCloneable ; return ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_CLASSNOTFOUNDEXCEPTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangClassNotFoundException ; return ; } return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:6> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_DOUBLE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangDouble ; return ; case <NUM_LIT:10> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_DEPRECATED [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangDeprecated ; return ; } return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:4> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ENUM [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangEnum ; return ; case <NUM_LIT:5> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ERROR [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangError ; return ; case <NUM_LIT:9> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_EXCEPTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangException ; return ; } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_FLOAT [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangFloat ; return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:7> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_INTEGER [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangInteger ; return ; case <NUM_LIT:8> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ITERABLE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangIterable ; return ; case <NUM_LIT:24> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ILLEGALARGUMENTEXCEPTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangIllegalArgumentException ; return ; } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_LONG [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangLong ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_NOCLASSDEFERROR [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangNoClassDefError ; return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:6> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_OBJECT [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangObject ; return ; case <NUM_LIT:8> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_OVERRIDE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangOverride ; return ; } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_RUNTIMEEXCEPTION [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangRuntimeException ; break ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:5> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_SHORT [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangShort ; return ; case <NUM_LIT:6> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_STRING [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangString ; else if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_SYSTEM [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangSystem ; return ; case <NUM_LIT:11> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_SAFEVARARGS [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangSafeVarargs ; return ; case <NUM_LIT:12> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_STRINGBUFFER [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangStringBuffer ; return ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_STRINGBUILDER [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangStringBuilder ; return ; case <NUM_LIT:16> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_SUPPRESSWARNINGS [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangSuppressWarnings ; return ; } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_THROWABLE [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangThrowable ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_VOID [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangVoid ; return ; } break ; case <NUM_LIT:4> : if ( ! CharOperation . equals ( TypeConstants . JAVA , this . compoundName [ <NUM_LIT:0> ] ) ) return ; packageName = this . compoundName [ <NUM_LIT:1> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; packageName = this . compoundName [ <NUM_LIT:2> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; typeName = this . compoundName [ <NUM_LIT:3> ] ; if ( typeName . length == <NUM_LIT:0> ) return ; switch ( packageName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:a>' : if ( CharOperation . equals ( packageName , TypeConstants . ANNOTATION ) ) { switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:A>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationAnnotation ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_DOCUMENTED [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationDocumented ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_ELEMENTTYPE [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationElementType ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_INHERITED [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationInherited ; return ; case '<CHAR_LIT>' : switch ( typeName . length ) { case <NUM_LIT:9> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_RETENTION [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationRetention ; return ; case <NUM_LIT:15> : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_RETENTIONPOLICY [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationRetentionPolicy ; return ; } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_ANNOTATION_TARGET [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangAnnotationTarget ; return ; } } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( packageName , TypeConstants . INVOKE ) ) { if ( typeName . length == <NUM_LIT:0> ) return ; switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE [ <NUM_LIT:3> ] ) ) this . id = TypeIds . T_JavaLangInvokeMethodHandlePolymorphicSignature ; return ; } } return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( packageName , TypeConstants . REFLECT ) ) { switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_REFLECT_CONSTRUCTOR [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangReflectConstructor ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_REFLECT_FIELD [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangReflectField ; return ; case '<CHAR_LIT>' : if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_REFLECT_METHOD [ <NUM_LIT:2> ] ) ) this . id = TypeIds . T_JavaLangReflectMethod ; return ; } } return ; } break ; case <NUM_LIT:5> : packageName = this . compoundName [ <NUM_LIT:0> ] ; switch ( packageName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( ! CharOperation . equals ( TypeConstants . JAVA , this . compoundName [ <NUM_LIT:0> ] ) ) return ; packageName = this . compoundName [ <NUM_LIT:1> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; if ( CharOperation . equals ( TypeConstants . LANG , packageName ) ) { packageName = this . compoundName [ <NUM_LIT:2> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; switch ( packageName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( packageName , TypeConstants . INVOKE ) ) { typeName = this . compoundName [ <NUM_LIT:3> ] ; if ( typeName . length == <NUM_LIT:0> ) return ; switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : char [ ] memberTypeName = this . compoundName [ <NUM_LIT:4> ] ; if ( memberTypeName . length == <NUM_LIT:0> ) return ; if ( CharOperation . equals ( typeName , TypeConstants . JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE [ <NUM_LIT:3> ] ) && CharOperation . equals ( memberTypeName , TypeConstants . JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE [ <NUM_LIT:4> ] ) ) this . id = TypeIds . T_JavaLangInvokeMethodHandlePolymorphicSignature ; return ; } } return ; } return ; } return ; case '<CHAR_LIT>' : if ( ! CharOperation . equals ( TypeConstants . ORG , this . compoundName [ <NUM_LIT:0> ] ) ) return ; packageName = this . compoundName [ <NUM_LIT:1> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; if ( CharOperation . equals ( TypeConstants . ECLIPSE , packageName ) ) { packageName = this . compoundName [ <NUM_LIT:2> ] ; if ( packageName . length == <NUM_LIT:0> ) return ; switch ( packageName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:c>' : if ( CharOperation . equals ( packageName , TypeConstants . CORE ) ) { typeName = this . compoundName [ <NUM_LIT:3> ] ; if ( typeName . length == <NUM_LIT:0> ) return ; switch ( typeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : char [ ] memberTypeName = this . compoundName [ <NUM_LIT:4> ] ; if ( memberTypeName . length == <NUM_LIT:0> ) return ; if ( CharOperation . equals ( typeName , TypeConstants . ORG_ECLIPSE_CORE_RUNTIME_ASSERT [ <NUM_LIT:3> ] ) && CharOperation . equals ( memberTypeName , TypeConstants . ORG_ECLIPSE_CORE_RUNTIME_ASSERT [ <NUM_LIT:4> ] ) ) this . id = TypeIds . T_OrgEclipseCoreRuntimeAssert ; return ; } } return ; } return ; } return ; } break ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { if ( ! isLeaf ) return signature ( ) ; return genericTypeSignature ( ) ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName != null ) return this . constantPoolName ; return this . constantPoolName = CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:/>' ) ; } public String debugName ( ) { return ( this . compoundName != null ) ? new String ( readableName ( ) ) : "<STR_LIT>" ; } public final int depth ( ) { int depth = <NUM_LIT:0> ; ReferenceBinding current = this ; while ( ( current = current . enclosingType ( ) ) != null ) depth ++ ; return depth ; } public boolean detectAnnotationCycle ( ) { if ( ( this . tagBits & TagBits . EndAnnotationCheck ) != <NUM_LIT:0> ) return false ; if ( ( this . tagBits & TagBits . BeginAnnotationCheck ) != <NUM_LIT:0> ) return true ; this . tagBits |= TagBits . BeginAnnotationCheck ; MethodBinding [ ] currentMethods = methods ( ) ; boolean inCycle = false ; for ( int i = <NUM_LIT:0> , l = currentMethods . length ; i < l ; i ++ ) { TypeBinding returnType = currentMethods [ i ] . returnType . leafComponentType ( ) . erasure ( ) ; if ( this == returnType ) { if ( this instanceof SourceTypeBinding ) { MethodDeclaration decl = ( MethodDeclaration ) currentMethods [ i ] . sourceMethod ( ) ; ( ( SourceTypeBinding ) this ) . scope . problemReporter ( ) . annotationCircularity ( this , this , decl != null ? decl . returnType : null ) ; } } else if ( returnType . isAnnotationType ( ) && ( ( ReferenceBinding ) returnType ) . detectAnnotationCycle ( ) ) { if ( this instanceof SourceTypeBinding ) { MethodDeclaration decl = ( MethodDeclaration ) currentMethods [ i ] . sourceMethod ( ) ; ( ( SourceTypeBinding ) this ) . scope . problemReporter ( ) . annotationCircularity ( this , returnType , decl != null ? decl . returnType : null ) ; } inCycle = true ; } } if ( inCycle ) return true ; this . tagBits |= TagBits . EndAnnotationCheck ; return false ; } public final ReferenceBinding enclosingTypeAt ( int relativeDepth ) { ReferenceBinding current = this ; while ( relativeDepth -- > <NUM_LIT:0> && current != null ) current = current . enclosingType ( ) ; return current ; } public int enumConstantCount ( ) { int count = <NUM_LIT:0> ; FieldBinding [ ] fields = fields ( ) ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { if ( ( fields [ i ] . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) count ++ ; } return count ; } public int fieldCount ( ) { return fields ( ) . length ; } public FieldBinding [ ] fields ( ) { return Binding . NO_FIELDS ; } public final int getAccessFlags ( ) { return this . modifiers & ExtraCompilerModifiers . AccJustFlag ; } public AnnotationBinding [ ] getAnnotations ( ) { return retrieveAnnotations ( this ) ; } public long getAnnotationTagBits ( ) { return this . tagBits ; } public int getEnclosingInstancesSlotSize ( ) { if ( isStatic ( ) ) return <NUM_LIT:0> ; return enclosingType ( ) == null ? <NUM_LIT:0> : <NUM_LIT:1> ; } public MethodBinding getExactConstructor ( TypeBinding [ ] argumentTypes ) { return null ; } public MethodBinding getExactMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , CompilationUnitScope refScope ) { return null ; } public FieldBinding getField ( char [ ] fieldName , boolean needResolve ) { return null ; } public char [ ] getFileName ( ) { return this . fileName ; } public ReferenceBinding getMemberType ( char [ ] typeName ) { ReferenceBinding [ ] memberTypes = memberTypes ( ) ; for ( int i = memberTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( memberTypes [ i ] . sourceName , typeName ) ) return memberTypes [ i ] ; return null ; } public MethodBinding [ ] getMethods ( char [ ] selector ) { return Binding . NO_METHODS ; } public MethodBinding [ ] getMethods ( char [ ] selector , int suggestedParameterLength ) { return getMethods ( selector ) ; } public int getOuterLocalVariablesSlotSize ( ) { return <NUM_LIT:0> ; } public PackageBinding getPackage ( ) { return this . fPackage ; } public TypeVariableBinding getTypeVariable ( char [ ] variableName ) { TypeVariableBinding [ ] typeVariables = typeVariables ( ) ; for ( int i = typeVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( typeVariables [ i ] . sourceName , variableName ) ) return typeVariables [ i ] ; return null ; } public int hashCode ( ) { return ( this . compoundName == null || this . compoundName . length == <NUM_LIT:0> ) ? super . hashCode ( ) : CharOperation . hashCode ( this . compoundName [ this . compoundName . length - <NUM_LIT:1> ] ) ; } public boolean hasIncompatibleSuperType ( ReferenceBinding otherType ) { if ( this == otherType ) return false ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding currentType = this ; TypeBinding match ; do { match = otherType . findSuperTypeOriginatingFrom ( currentType ) ; if ( match != null && match . isProvablyDistinct ( currentType ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType == otherType ) return false ; match = otherType . findSuperTypeOriginatingFrom ( currentType ) ; if ( match != null && match . isProvablyDistinct ( currentType ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return false ; } public boolean hasMemberTypes ( ) { return false ; } public final boolean hasRestrictedAccess ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccRestrictedAccess ) != <NUM_LIT:0> ; } abstract public boolean hasTypeBit ( int bit ) ; public boolean implementsInterface ( ReferenceBinding anInterface , boolean searchHierarchy ) { if ( this == anInterface ) return true ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding currentType = this ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( searchHierarchy && ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . isEquivalentTo ( anInterface ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return false ; } boolean implementsMethod ( MethodBinding method ) { char [ ] selector = method . selector ; ReferenceBinding type = this ; while ( type != null ) { MethodBinding [ ] methods = type . methods ( ) ; long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; for ( int i = start ; i <= end ; i ++ ) { if ( methods [ i ] . areParametersEqual ( method ) ) return true ; } } type = type . superclass ( ) ; } return false ; } public final boolean isAbstract ( ) { return ( this . modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ; } public boolean isAnnotationType ( ) { return ( this . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; } public final boolean isBinaryBinding ( ) { return ( this . tagBits & TagBits . IsBinaryBinding ) != <NUM_LIT:0> ; } public boolean isClass ( ) { return ( this . modifiers & ( ClassFileConstants . AccInterface | ClassFileConstants . AccAnnotation | ClassFileConstants . AccEnum ) ) == <NUM_LIT:0> ; } public boolean isCompatibleWith ( TypeBinding otherType ) { if ( otherType == this ) return true ; if ( otherType . id == TypeIds . T_JavaLangObject ) return true ; Object result ; if ( this . compatibleCache == null ) { this . compatibleCache = new SimpleLookupTable ( <NUM_LIT:3> ) ; result = null ; } else { result = this . compatibleCache . get ( otherType ) ; if ( result != null ) { return result == Boolean . TRUE ; } } this . compatibleCache . put ( otherType , Boolean . FALSE ) ; if ( isCompatibleWith0 ( otherType ) ) { this . compatibleCache . put ( otherType , Boolean . TRUE ) ; return true ; } return false ; } private boolean isCompatibleWith0 ( TypeBinding otherType ) { if ( otherType == this ) return true ; if ( otherType . id == TypeIds . T_JavaLangObject ) return true ; if ( isEquivalentTo ( otherType ) ) return true ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return false ; case Binding . TYPE_PARAMETER : if ( otherType . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherType ; TypeBinding otherLowerBound ; if ( ( otherLowerBound = otherCapture . lowerBound ) != null ) { if ( otherLowerBound . isArrayType ( ) ) return false ; return isCompatibleWith ( otherLowerBound ) ; } } case Binding . GENERIC_TYPE : case Binding . TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : switch ( kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : if ( erasure ( ) == otherType . erasure ( ) ) return false ; } ReferenceBinding otherReferenceType = ( ReferenceBinding ) otherType ; if ( otherReferenceType . isInterface ( ) ) return implementsInterface ( otherReferenceType , true ) ; if ( isInterface ( ) ) return false ; return otherReferenceType . isSuperclassOf ( this ) ; default : return false ; } } public final boolean isDefault ( ) { return ( this . modifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ) == <NUM_LIT:0> ; } public final boolean isDeprecated ( ) { return ( this . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ; } public boolean isEnum ( ) { return ( this . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ; } public final boolean isFinal ( ) { return ( this . modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ; } public boolean isHierarchyBeingConnected ( ) { return ( this . tagBits & TagBits . EndHierarchyCheck ) == <NUM_LIT:0> && ( this . tagBits & TagBits . BeginHierarchyCheck ) != <NUM_LIT:0> ; } public boolean isHierarchyBeingActivelyConnected ( ) { return ( this . tagBits & TagBits . EndHierarchyCheck ) == <NUM_LIT:0> && ( this . tagBits & TagBits . BeginHierarchyCheck ) != <NUM_LIT:0> && ( this . tagBits & TagBits . PauseHierarchyCheck ) == <NUM_LIT:0> ; } public boolean isHierarchyConnected ( ) { return true ; } public boolean isInterface ( ) { return ( this . modifiers & ClassFileConstants . AccInterface ) != <NUM_LIT:0> ; } public final boolean isPrivate ( ) { return ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ; } public final boolean isOrEnclosedByPrivateType ( ) { if ( isLocalType ( ) ) return true ; ReferenceBinding type = this ; while ( type != null ) { if ( ( type . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) return true ; type = type . enclosingType ( ) ; } return false ; } public final boolean isProtected ( ) { return ( this . modifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ; } public final boolean isPublic ( ) { return ( this . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ; } public final boolean isStatic ( ) { return ( this . modifiers & ( ClassFileConstants . AccStatic | ClassFileConstants . AccInterface ) ) != <NUM_LIT:0> || ( this . tagBits & TagBits . IsNestedType ) == <NUM_LIT:0> ; } public final boolean isStrictfp ( ) { return ( this . modifiers & ClassFileConstants . AccStrictfp ) != <NUM_LIT:0> ; } public boolean isSuperclassOf ( ReferenceBinding otherType ) { while ( ( otherType = otherType . superclass ( ) ) != null ) { if ( otherType . isEquivalentTo ( this ) ) return true ; } return false ; } public boolean isThrowable ( ) { ReferenceBinding current = this ; do { switch ( current . id ) { case TypeIds . T_JavaLangThrowable : case TypeIds . T_JavaLangError : case TypeIds . T_JavaLangRuntimeException : case TypeIds . T_JavaLangException : return true ; } } while ( ( current = current . superclass ( ) ) != null ) ; return false ; } public boolean isUncheckedException ( boolean includeSupertype ) { switch ( this . id ) { case TypeIds . T_JavaLangError : case TypeIds . T_JavaLangRuntimeException : return true ; case TypeIds . T_JavaLangThrowable : case TypeIds . T_JavaLangException : return includeSupertype ; } ReferenceBinding current = this ; while ( ( current = current . superclass ( ) ) != null ) { switch ( current . id ) { case TypeIds . T_JavaLangError : case TypeIds . T_JavaLangRuntimeException : return true ; case TypeIds . T_JavaLangThrowable : case TypeIds . T_JavaLangException : return false ; } } return false ; } public final boolean isUsed ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) != <NUM_LIT:0> ; } public final boolean isViewedAsDeprecated ( ) { return ( this . modifiers & ( ClassFileConstants . AccDeprecated | ExtraCompilerModifiers . AccDeprecatedImplicitly ) ) != <NUM_LIT:0> || getPackage ( ) . isViewedAsDeprecated ( ) ; } public ReferenceBinding [ ] memberTypes ( ) { return Binding . NO_MEMBER_TYPES ; } public MethodBinding [ ] methods ( ) { return Binding . NO_METHODS ; } public final ReferenceBinding outermostEnclosingType ( ) { ReferenceBinding current = this ; while ( true ) { ReferenceBinding last = current ; if ( ( current = current . enclosingType ( ) ) == null ) return last ; } } public char [ ] qualifiedSourceName ( ) { if ( isMemberType ( ) ) return CharOperation . concat ( enclosingType ( ) . qualifiedSourceName ( ) , sourceName ( ) , '<CHAR_LIT:.>' ) ; return sourceName ( ) ; } public char [ ] readableName ( ) { char [ ] readableName ; if ( isMemberType ( ) ) { readableName = CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { readableName = CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } TypeVariableBinding [ ] typeVars ; if ( ( typeVars = typeVariables ( ) ) != Binding . NO_TYPE_VARIABLES ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( readableName ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( typeVars [ i ] . readableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = nameBuffer . length ( ) ; readableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , readableName , <NUM_LIT:0> ) ; } return readableName ; } public AnnotationHolder retrieveAnnotationHolder ( Binding binding , boolean forceInitialization ) { SimpleLookupTable store = storedAnnotations ( forceInitialization ) ; return store == null ? null : ( AnnotationHolder ) store . get ( binding ) ; } AnnotationBinding [ ] retrieveAnnotations ( Binding binding ) { AnnotationHolder holder = retrieveAnnotationHolder ( binding , true ) ; return holder == null ? Binding . NO_ANNOTATIONS : holder . getAnnotations ( ) ; } public void setAnnotations ( AnnotationBinding [ ] annotations ) { storeAnnotations ( this , annotations ) ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { shortReadableName = this . sourceName ; } TypeVariableBinding [ ] typeVars ; if ( ( typeVars = typeVariables ( ) ) != Binding . NO_TYPE_VARIABLES ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( shortReadableName ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( typeVars [ i ] . shortReadableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = nameBuffer . length ( ) ; shortReadableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , shortReadableName , <NUM_LIT:0> ) ; } return shortReadableName ; } public char [ ] signature ( ) { if ( this . signature != null ) return this . signature ; return this . signature = CharOperation . concat ( '<CHAR_LIT>' , constantPoolName ( ) , '<CHAR_LIT:;>' ) ; } public char [ ] sourceName ( ) { return this . sourceName ; } void storeAnnotationHolder ( Binding binding , AnnotationHolder holder ) { if ( holder == null ) { SimpleLookupTable store = storedAnnotations ( false ) ; if ( store != null ) store . removeKey ( binding ) ; } else { SimpleLookupTable store = storedAnnotations ( true ) ; if ( store != null ) store . put ( binding , holder ) ; } } void storeAnnotations ( Binding binding , AnnotationBinding [ ] annotations ) { AnnotationHolder holder = null ; if ( annotations == null || annotations . length == <NUM_LIT:0> ) { SimpleLookupTable store = storedAnnotations ( false ) ; if ( store != null ) holder = ( AnnotationHolder ) store . get ( binding ) ; if ( holder == null ) return ; } else { SimpleLookupTable store = storedAnnotations ( true ) ; if ( store == null ) return ; holder = ( AnnotationHolder ) store . get ( binding ) ; if ( holder == null ) holder = new AnnotationHolder ( ) ; } storeAnnotationHolder ( binding , holder . setAnnotations ( annotations ) ) ; } SimpleLookupTable storedAnnotations ( boolean forceInitialize ) { return null ; } public ReferenceBinding superclass ( ) { return null ; } public ReferenceBinding [ ] superInterfaces ( ) { return Binding . NO_SUPERINTERFACES ; } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { if ( isStatic ( ) ) return null ; ReferenceBinding enclosingType = enclosingType ( ) ; if ( enclosingType == null ) return null ; return new ReferenceBinding [ ] { enclosingType } ; } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { return null ; } MethodBinding [ ] unResolvedMethods ( ) { return methods ( ) ; } public FieldBinding [ ] unResolvedFields ( ) { return Binding . NO_FIELDS ; } protected int applyCloseableWhitelists ( ) { switch ( this . compoundName . length ) { case <NUM_LIT:3> : if ( CharOperation . equals ( TypeConstants . JAVA , this . compoundName [ <NUM_LIT:0> ] ) ) { if ( CharOperation . equals ( TypeConstants . IO , this . compoundName [ <NUM_LIT:1> ] ) ) { char [ ] simpleName = this . compoundName [ <NUM_LIT:2> ] ; int l = TypeConstants . JAVA_IO_WRAPPER_CLOSEABLES . length ; for ( int i = <NUM_LIT:0> ; i < l ; i ++ ) { if ( CharOperation . equals ( simpleName , TypeConstants . JAVA_IO_WRAPPER_CLOSEABLES [ i ] ) ) return TypeIds . BitWrapperCloseable ; } l = TypeConstants . JAVA_IO_RESOURCE_FREE_CLOSEABLES . length ; for ( int i = <NUM_LIT:0> ; i < l ; i ++ ) { if ( CharOperation . equals ( simpleName , TypeConstants . JAVA_IO_RESOURCE_FREE_CLOSEABLES [ i ] ) ) return TypeIds . BitResourceFreeCloseable ; } } } break ; case <NUM_LIT:4> : if ( CharOperation . equals ( TypeConstants . JAVA , this . compoundName [ <NUM_LIT:0> ] ) ) { if ( CharOperation . equals ( TypeConstants . UTIL , this . compoundName [ <NUM_LIT:1> ] ) ) { if ( CharOperation . equals ( TypeConstants . ZIP , this . compoundName [ <NUM_LIT:2> ] ) ) { char [ ] simpleName = this . compoundName [ <NUM_LIT:3> ] ; int l = TypeConstants . JAVA_UTIL_ZIP_WRAPPER_CLOSEABLES . length ; for ( int i = <NUM_LIT:0> ; i < l ; i ++ ) { if ( CharOperation . equals ( simpleName , TypeConstants . JAVA_UTIL_ZIP_WRAPPER_CLOSEABLES [ i ] ) ) return TypeIds . BitWrapperCloseable ; } } } } break ; } int l = TypeConstants . OTHER_WRAPPER_CLOSEABLES . length ; for ( int i = <NUM_LIT:0> ; i < l ; i ++ ) { if ( CharOperation . equals ( this . compoundName , TypeConstants . OTHER_WRAPPER_CLOSEABLES [ i ] ) ) return TypeIds . BitWrapperCloseable ; } return <NUM_LIT:0> ; } public MethodBinding [ ] getAnyExtraMethods ( char [ ] selector ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . flow . UnconditionalFlowInfo ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; public class MethodScope extends BlockScope { public ReferenceContext referenceContext ; public boolean isStatic ; public boolean isConstructorCall = false ; public FieldBinding initializedField ; public int lastVisibleFieldID = - <NUM_LIT:1> ; public int analysisIndex ; public boolean isPropagatingInnerClassEmulation ; public int lastIndex = <NUM_LIT:0> ; public long [ ] definiteInits = new long [ <NUM_LIT:4> ] ; public long [ ] [ ] extraDefiniteInits = new long [ <NUM_LIT:4> ] [ ] ; public boolean insideTypeAnnotation = false ; public SyntheticArgumentBinding [ ] extraSyntheticArguments ; public boolean hasMissingSwitchDefault ; public MethodScope ( ClassScope parent , ReferenceContext context , boolean isStatic ) { super ( METHOD_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ <NUM_LIT:5> ] ; this . referenceContext = context ; this . isStatic = isStatic ; this . startIndex = <NUM_LIT:0> ; } String basicToString ( int tab ) { String newLine = "<STR_LIT:n>" ; for ( int i = tab ; -- i >= <NUM_LIT:0> ; ) newLine += "<STR_LIT:t>" ; String s = newLine + "<STR_LIT>" ; newLine += "<STR_LIT:t>" ; s += newLine + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) s += newLine + "<STR_LIT:t>" + this . locals [ i ] . toString ( ) ; s += newLine + "<STR_LIT>" + this . startIndex ; s += newLine + "<STR_LIT>" + this . isConstructorCall ; s += newLine + "<STR_LIT>" + this . initializedField ; s += newLine + "<STR_LIT>" + this . lastVisibleFieldID ; s += newLine + "<STR_LIT>" + this . referenceContext ; return s ; } private void checkAndSetModifiersForConstructor ( MethodBinding methodBinding ) { int modifiers = methodBinding . modifiers ; final ReferenceBinding declaringClass = methodBinding . declaringClass ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> ) problemReporter ( ) . duplicateModifierForMethod ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; if ( ( ( ( ConstructorDeclaration ) this . referenceContext ) . bits & ASTNode . IsDefaultConstructor ) != <NUM_LIT:0> ) { final int DECLARING_FLAGS = ClassFileConstants . AccEnum | ClassFileConstants . AccPublic | ClassFileConstants . AccProtected ; final int VISIBILITY_FLAGS = ClassFileConstants . AccPrivate | ClassFileConstants . AccPublic | ClassFileConstants . AccProtected ; int flags ; if ( ( flags = declaringClass . modifiers & DECLARING_FLAGS ) != <NUM_LIT:0> ) { if ( ( flags & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { modifiers &= ~ VISIBILITY_FLAGS ; modifiers |= ClassFileConstants . AccPrivate ; } else { modifiers &= ~ VISIBILITY_FLAGS ; modifiers |= flags ; } } } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStrictfp ) ; if ( declaringClass . isEnum ( ) && ( ( ( ConstructorDeclaration ) this . referenceContext ) . bits & ASTNode . IsDefaultConstructor ) == <NUM_LIT:0> ) { final int UNEXPECTED_ENUM_CONSTR_MODIFIERS = ~ ( ClassFileConstants . AccPrivate | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_ENUM_CONSTR_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForEnumConstructor ( ( AbstractMethodDeclaration ) this . referenceContext ) ; modifiers &= ~ ExtraCompilerModifiers . AccJustFlag | ~ UNEXPECTED_ENUM_CONSTR_MODIFIERS ; } else if ( ( ( ( AbstractMethodDeclaration ) this . referenceContext ) . modifiers & ClassFileConstants . AccStrictfp ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForMethod ( ( AbstractMethodDeclaration ) this . referenceContext ) ; } modifiers |= ClassFileConstants . AccPrivate ; } else if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForMethod ( ( AbstractMethodDeclaration ) this . referenceContext ) ; modifiers &= ~ ExtraCompilerModifiers . AccJustFlag | ~ UNEXPECTED_MODIFIERS ; } else if ( ( ( ( AbstractMethodDeclaration ) this . referenceContext ) . modifiers & ClassFileConstants . AccStrictfp ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForMethod ( ( AbstractMethodDeclaration ) this . referenceContext ) ; } int accessorBits = realModifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ; if ( ( accessorBits & ( accessorBits - <NUM_LIT:1> ) ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalVisibilityModifierCombinationForMethod ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; if ( ( accessorBits & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } else if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> && ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) { modifiers &= ~ ClassFileConstants . AccPrivate ; } } methodBinding . modifiers = modifiers ; } private void checkAndSetModifiersForMethod ( MethodBinding methodBinding ) { int modifiers = methodBinding . modifiers ; final ReferenceBinding declaringClass = methodBinding . declaringClass ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> ) problemReporter ( ) . duplicateModifierForMethod ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; if ( declaringClass . isInterface ( ) ) { if ( ( realModifiers & ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract ) ) != <NUM_LIT:0> ) { if ( ( declaringClass . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationMember ( ( AbstractMethodDeclaration ) this . referenceContext ) ; else problemReporter ( ) . illegalModifierForInterfaceMethod ( ( AbstractMethodDeclaration ) this . referenceContext ) ; } return ; } final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccAbstract | ClassFileConstants . AccStatic | ClassFileConstants . AccFinal | ClassFileConstants . AccSynchronized | ClassFileConstants . AccNative | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForMethod ( ( AbstractMethodDeclaration ) this . referenceContext ) ; modifiers &= ~ ExtraCompilerModifiers . AccJustFlag | ~ UNEXPECTED_MODIFIERS ; } int accessorBits = realModifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ; if ( ( accessorBits & ( accessorBits - <NUM_LIT:1> ) ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalVisibilityModifierCombinationForMethod ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; if ( ( accessorBits & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } else if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> && ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) { modifiers &= ~ ClassFileConstants . AccPrivate ; } } if ( ( modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ) { int incompatibleWithAbstract = ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccFinal | ClassFileConstants . AccSynchronized | ClassFileConstants . AccNative | ClassFileConstants . AccStrictfp ; if ( ( modifiers & incompatibleWithAbstract ) != <NUM_LIT:0> ) problemReporter ( ) . illegalAbstractModifierCombinationForMethod ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; if ( ! methodBinding . declaringClass . isAbstract ( ) ) problemReporter ( ) . abstractMethodInAbstractClass ( ( SourceTypeBinding ) declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; } if ( ( modifiers & ClassFileConstants . AccNative ) != <NUM_LIT:0> && ( modifiers & ClassFileConstants . AccStrictfp ) != <NUM_LIT:0> ) problemReporter ( ) . nativeMethodsCannotBeStrictfp ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; if ( ( ( realModifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ) && declaringClass . isNestedType ( ) && ! declaringClass . isStatic ( ) ) problemReporter ( ) . unexpectedStaticModifierForMethod ( declaringClass , ( AbstractMethodDeclaration ) this . referenceContext ) ; methodBinding . modifiers = modifiers ; } public void checkUnusedParameters ( MethodBinding method ) { if ( method . isAbstract ( ) || ( method . isImplementing ( ) && ! compilerOptions ( ) . reportUnusedParameterWhenImplementingAbstract ) || ( method . isOverriding ( ) && ! method . isImplementing ( ) && ! compilerOptions ( ) . reportUnusedParameterWhenOverridingConcrete ) || method . isMain ( ) ) { return ; } for ( int i = <NUM_LIT:0> , maxLocals = this . localIndex ; i < maxLocals ; i ++ ) { LocalVariableBinding local = this . locals [ i ] ; if ( local == null || ( ( local . tagBits & TagBits . IsArgument ) == <NUM_LIT:0> ) ) { break ; } if ( local . useFlag == LocalVariableBinding . UNUSED && ( ( local . declaration . bits & ASTNode . IsLocalDeclarationReachable ) != <NUM_LIT:0> ) ) { problemReporter ( ) . unusedArgument ( local . declaration ) ; } } } public void computeLocalVariablePositions ( int initOffset , CodeStream codeStream ) { this . offset = initOffset ; this . maxOffset = initOffset ; int ilocal = <NUM_LIT:0> , maxLocals = this . localIndex ; while ( ilocal < maxLocals ) { LocalVariableBinding local = this . locals [ ilocal ] ; if ( local == null || ( ( local . tagBits & TagBits . IsArgument ) == <NUM_LIT:0> ) ) break ; codeStream . record ( local ) ; local . resolvedPosition = this . offset ; if ( ( local . type == TypeBinding . LONG ) || ( local . type == TypeBinding . DOUBLE ) ) { this . offset += <NUM_LIT:2> ; } else { this . offset ++ ; } if ( this . offset > <NUM_LIT> ) { problemReporter ( ) . noMoreAvailableSpaceForArgument ( local , local . declaration ) ; } ilocal ++ ; } if ( this . extraSyntheticArguments != null ) { for ( int iarg = <NUM_LIT:0> , maxArguments = this . extraSyntheticArguments . length ; iarg < maxArguments ; iarg ++ ) { SyntheticArgumentBinding argument = this . extraSyntheticArguments [ iarg ] ; argument . resolvedPosition = this . offset ; if ( ( argument . type == TypeBinding . LONG ) || ( argument . type == TypeBinding . DOUBLE ) ) { this . offset += <NUM_LIT:2> ; } else { this . offset ++ ; } if ( this . offset > <NUM_LIT> ) { problemReporter ( ) . noMoreAvailableSpaceForArgument ( argument , ( ASTNode ) this . referenceContext ) ; } } } this . computeLocalVariablePositions ( ilocal , this . offset , codeStream ) ; } MethodBinding createMethod ( AbstractMethodDeclaration method ) { this . referenceContext = method ; method . scope = this ; SourceTypeBinding declaringClass = referenceType ( ) . binding ; int modifiers = method . modifiers | ExtraCompilerModifiers . AccUnresolved ; if ( method . isConstructor ( ) ) { if ( method . isDefaultConstructor ( ) ) modifiers |= ExtraCompilerModifiers . AccIsDefaultConstructor ; method . binding = new MethodBinding ( modifiers , null , null , declaringClass ) ; checkAndSetModifiersForConstructor ( method . binding ) ; } else { if ( declaringClass . isInterface ( ) ) modifiers |= ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract ; method . binding = new MethodBinding ( modifiers , method . selector , null , null , null , declaringClass ) ; checkAndSetModifiersForMethod ( method . binding ) ; } this . isStatic = method . binding . isStatic ( ) ; Argument [ ] argTypes = method . arguments ; int argLength = argTypes == null ? <NUM_LIT:0> : argTypes . length ; if ( argLength > <NUM_LIT:0> && compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( argTypes [ -- argLength ] . isVarArgs ( ) ) method . binding . modifiers |= ClassFileConstants . AccVarargs ; while ( -- argLength >= <NUM_LIT:0> ) { if ( argTypes [ argLength ] . isVarArgs ( ) ) problemReporter ( ) . illegalVararg ( argTypes [ argLength ] , method ) ; } } TypeParameter [ ] typeParameters = method . typeParameters ( ) ; if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) { method . binding . typeVariables = Binding . NO_TYPE_VARIABLES ; } else { method . binding . typeVariables = createTypeVariables ( typeParameters , method . binding ) ; method . binding . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } return method . binding ; } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve ) { FieldBinding field = super . findField ( receiverType , fieldName , invocationSite , needResolve ) ; if ( field == null ) return null ; if ( ! field . isValidBinding ( ) ) return field ; if ( field . isStatic ( ) ) return field ; if ( ! this . isConstructorCall || receiverType != enclosingSourceType ( ) ) return field ; if ( invocationSite instanceof SingleNameReference ) return new ProblemFieldBinding ( field , field . declaringClass , fieldName , ProblemReasons . NonStaticReferenceInConstructorInvocation ) ; if ( invocationSite instanceof QualifiedNameReference ) { QualifiedNameReference name = ( QualifiedNameReference ) invocationSite ; if ( name . binding == null ) return new ProblemFieldBinding ( field , field . declaringClass , fieldName , ProblemReasons . NonStaticReferenceInConstructorInvocation ) ; } return field ; } public boolean isInsideConstructor ( ) { return ( this . referenceContext instanceof ConstructorDeclaration ) ; } public boolean isInsideInitializer ( ) { return ( this . referenceContext instanceof TypeDeclaration ) ; } public boolean isInsideInitializerOrConstructor ( ) { return ( this . referenceContext instanceof TypeDeclaration ) || ( this . referenceContext instanceof ConstructorDeclaration ) ; } public ProblemReporter problemReporter ( ) { ProblemReporter problemReporter = referenceCompilationUnit ( ) . problemReporter ; problemReporter . referenceContext = this . referenceContext ; return problemReporter ; } public final int recordInitializationStates ( FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return - <NUM_LIT:1> ; UnconditionalFlowInfo unconditionalFlowInfo = flowInfo . unconditionalInitsWithoutSideEffect ( ) ; long [ ] extraInits = unconditionalFlowInfo . extra == null ? null : unconditionalFlowInfo . extra [ <NUM_LIT:0> ] ; long inits = unconditionalFlowInfo . definiteInits ; checkNextEntry : for ( int i = this . lastIndex ; -- i >= <NUM_LIT:0> ; ) { if ( this . definiteInits [ i ] == inits ) { long [ ] otherInits = this . extraDefiniteInits [ i ] ; if ( ( extraInits != null ) && ( otherInits != null ) ) { if ( extraInits . length == otherInits . length ) { int j , max ; for ( j = <NUM_LIT:0> , max = extraInits . length ; j < max ; j ++ ) { if ( extraInits [ j ] != otherInits [ j ] ) { continue checkNextEntry ; } } return i ; } } else { if ( ( extraInits == null ) && ( otherInits == null ) ) { return i ; } } } } if ( this . definiteInits . length == this . lastIndex ) { System . arraycopy ( this . definiteInits , <NUM_LIT:0> , ( this . definiteInits = new long [ this . lastIndex + <NUM_LIT:20> ] ) , <NUM_LIT:0> , this . lastIndex ) ; System . arraycopy ( this . extraDefiniteInits , <NUM_LIT:0> , ( this . extraDefiniteInits = new long [ this . lastIndex + <NUM_LIT:20> ] [ ] ) , <NUM_LIT:0> , this . lastIndex ) ; } this . definiteInits [ this . lastIndex ] = inits ; if ( extraInits != null ) { this . extraDefiniteInits [ this . lastIndex ] = new long [ extraInits . length ] ; System . arraycopy ( extraInits , <NUM_LIT:0> , this . extraDefiniteInits [ this . lastIndex ] , <NUM_LIT:0> , extraInits . length ) ; } return this . lastIndex ++ ; } public AbstractMethodDeclaration referenceMethod ( ) { if ( this . referenceContext instanceof AbstractMethodDeclaration ) return ( AbstractMethodDeclaration ) this . referenceContext ; return null ; } public TypeDeclaration referenceType ( ) { return ( ( ClassScope ) this . parent ) . referenceContext ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class ParameterizedMethodBinding extends MethodBinding { protected MethodBinding originalMethod ; public ParameterizedMethodBinding ( final ParameterizedTypeBinding parameterizedDeclaringClass , MethodBinding originalMethod ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , originalMethod . thrownExceptions , parameterizedDeclaringClass ) ; this . originalMethod = originalMethod ; this . tagBits = originalMethod . tagBits & ~ TagBits . HasMissingType ; this . parameterNonNullness = originalMethod . parameterNonNullness ; final TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; Substitution substitution = null ; final int length = originalVariables . length ; final boolean isStatic = originalMethod . isStatic ( ) ; if ( length == <NUM_LIT:0> ) { this . typeVariables = Binding . NO_TYPE_VARIABLES ; if ( ! isStatic ) substitution = parameterizedDeclaringClass ; } else { final TypeVariableBinding [ ] substitutedVariables = new TypeVariableBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; substitutedVariables [ i ] = new TypeVariableBinding ( originalVariable . sourceName , this , originalVariable . rank , parameterizedDeclaringClass . environment ) ; } this . typeVariables = substitutedVariables ; substitution = new Substitution ( ) { public LookupEnvironment environment ( ) { return parameterizedDeclaringClass . environment ; } public boolean isRawSubstitution ( ) { return ! isStatic && parameterizedDeclaringClass . isRawSubstitution ( ) ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { if ( typeVariable . rank < length && originalVariables [ typeVariable . rank ] == typeVariable ) { return substitutedVariables [ typeVariable . rank ] ; } if ( ! isStatic ) return parameterizedDeclaringClass . substitute ( typeVariable ) ; return typeVariable ; } } ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeVariableBinding substitutedVariable = substitutedVariables [ i ] ; TypeBinding substitutedSuperclass = Scope . substitute ( substitution , originalVariable . superclass ) ; ReferenceBinding [ ] substitutedInterfaces = Scope . substitute ( substitution , originalVariable . superInterfaces ) ; if ( originalVariable . firstBound != null ) { substitutedVariable . firstBound = originalVariable . firstBound == originalVariable . superclass ? substitutedSuperclass : substitutedInterfaces [ <NUM_LIT:0> ] ; } switch ( substitutedSuperclass . kind ( ) ) { case Binding . ARRAY_TYPE : substitutedVariable . superclass = parameterizedDeclaringClass . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; substitutedVariable . superInterfaces = substitutedInterfaces ; break ; default : if ( substitutedSuperclass . isInterface ( ) ) { substitutedVariable . superclass = parameterizedDeclaringClass . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; int interfaceCount = substitutedInterfaces . length ; System . arraycopy ( substitutedInterfaces , <NUM_LIT:0> , substitutedInterfaces = new ReferenceBinding [ interfaceCount + <NUM_LIT:1> ] , <NUM_LIT:1> , interfaceCount ) ; substitutedInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } else { substitutedVariable . superclass = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } } } } if ( substitution != null ) { this . returnType = Scope . substitute ( substitution , this . returnType ) ; this . parameters = Scope . substitute ( substitution , this . parameters ) ; this . thrownExceptions = Scope . substitute ( substitution , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; } checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } } public ParameterizedMethodBinding ( final ReferenceBinding declaringClass , MethodBinding originalMethod , char [ ] [ ] alternateParamaterNames , final LookupEnvironment environment ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , originalMethod . thrownExceptions , declaringClass ) ; this . originalMethod = originalMethod ; this . tagBits = originalMethod . tagBits & ~ TagBits . HasMissingType ; this . parameterNonNullness = originalMethod . parameterNonNullness ; final TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; Substitution substitution = null ; final int length = originalVariables . length ; if ( length == <NUM_LIT:0> ) { this . typeVariables = Binding . NO_TYPE_VARIABLES ; } else { final TypeVariableBinding [ ] substitutedVariables = new TypeVariableBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; substitutedVariables [ i ] = new TypeVariableBinding ( alternateParamaterNames == null ? originalVariable . sourceName : alternateParamaterNames [ i ] , this , originalVariable . rank , environment ) ; } this . typeVariables = substitutedVariables ; substitution = new Substitution ( ) { public LookupEnvironment environment ( ) { return environment ; } public boolean isRawSubstitution ( ) { return false ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { if ( typeVariable . rank < length && originalVariables [ typeVariable . rank ] == typeVariable ) { return substitutedVariables [ typeVariable . rank ] ; } return typeVariable ; } } ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeVariableBinding substitutedVariable = substitutedVariables [ i ] ; TypeBinding substitutedSuperclass = Scope . substitute ( substitution , originalVariable . superclass ) ; ReferenceBinding [ ] substitutedInterfaces = Scope . substitute ( substitution , originalVariable . superInterfaces ) ; if ( originalVariable . firstBound != null ) { substitutedVariable . firstBound = originalVariable . firstBound == originalVariable . superclass ? substitutedSuperclass : substitutedInterfaces [ <NUM_LIT:0> ] ; } switch ( substitutedSuperclass . kind ( ) ) { case Binding . ARRAY_TYPE : substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; substitutedVariable . superInterfaces = substitutedInterfaces ; break ; default : if ( substitutedSuperclass . isInterface ( ) ) { substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; int interfaceCount = substitutedInterfaces . length ; System . arraycopy ( substitutedInterfaces , <NUM_LIT:0> , substitutedInterfaces = new ReferenceBinding [ interfaceCount + <NUM_LIT:1> ] , <NUM_LIT:1> , interfaceCount ) ; substitutedInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } else { substitutedVariable . superclass = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } } } } if ( substitution != null ) { this . returnType = Scope . substitute ( substitution , this . returnType ) ; this . parameters = Scope . substitute ( substitution , this . parameters ) ; this . thrownExceptions = Scope . substitute ( substitution , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; } checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } } public ParameterizedMethodBinding ( ) { } public static ParameterizedMethodBinding instantiateGetClass ( TypeBinding receiverType , MethodBinding originalMethod , Scope scope ) { ParameterizedMethodBinding method = new ParameterizedMethodBinding ( ) ; method . modifiers = originalMethod . modifiers ; method . selector = originalMethod . selector ; method . declaringClass = originalMethod . declaringClass ; method . typeVariables = Binding . NO_TYPE_VARIABLES ; method . originalMethod = originalMethod ; method . parameters = originalMethod . parameters ; method . thrownExceptions = originalMethod . thrownExceptions ; method . tagBits = originalMethod . tagBits ; ReferenceBinding genericClassType = scope . getJavaLangClass ( ) ; LookupEnvironment environment = scope . environment ( ) ; TypeBinding rawType = environment . convertToRawType ( receiverType . erasure ( ) , false ) ; method . returnType = environment . createParameterizedType ( genericClassType , new TypeBinding [ ] { environment . createWildcard ( genericClassType , <NUM_LIT:0> , rawType , null , Wildcard . EXTENDS ) } , null ) ; if ( ( method . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } return method ; } public boolean hasSubstitutedParameters ( ) { return this . parameters != this . originalMethod . parameters ; } public boolean hasSubstitutedReturnType ( ) { return this . returnType != this . originalMethod . returnType ; } public MethodBinding original ( ) { return this . originalMethod . original ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class TypeVariableBinding extends ReferenceBinding { public Binding declaringElement ; public int rank ; public TypeBinding firstBound ; public ReferenceBinding superclass ; public ReferenceBinding [ ] superInterfaces ; public char [ ] genericTypeSignature ; LookupEnvironment environment ; public TypeVariableBinding ( char [ ] sourceName , Binding declaringElement , int rank , LookupEnvironment environment ) { this . sourceName = sourceName ; this . declaringElement = declaringElement ; this . rank = rank ; this . modifiers = ClassFileConstants . AccPublic | ExtraCompilerModifiers . AccGenericSignature ; this . tagBits |= TagBits . HasTypeVariable ; this . environment = environment ; this . typeBits = TypeIds . BitUninitialized ; } public int boundCheck ( Substitution substitution , TypeBinding argumentType ) { if ( argumentType == TypeBinding . NULL || argumentType == this ) { return TypeConstants . OK ; } boolean hasSubstitution = substitution != null ; if ( ! ( argumentType instanceof ReferenceBinding || argumentType . isArrayType ( ) ) ) return TypeConstants . MISMATCH ; if ( this . superclass == null ) return TypeConstants . OK ; if ( argumentType . kind ( ) == Binding . WILDCARD_TYPE ) { WildcardBinding wildcard = ( WildcardBinding ) argumentType ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : TypeBinding wildcardBound = wildcard . bound ; if ( wildcardBound == this ) return TypeConstants . OK ; boolean isArrayBound = wildcardBound . isArrayType ( ) ; if ( ! wildcardBound . isInterface ( ) ) { TypeBinding substitutedSuperType = hasSubstitution ? Scope . substitute ( substitution , this . superclass ) : this . superclass ; if ( substitutedSuperType . id != TypeIds . T_JavaLangObject ) { if ( isArrayBound ) { if ( ! wildcardBound . isCompatibleWith ( substitutedSuperType ) ) return TypeConstants . MISMATCH ; } else { TypeBinding match = wildcardBound . findSuperTypeOriginatingFrom ( substitutedSuperType ) ; if ( match != null ) { if ( substitutedSuperType . isProvablyDistinct ( match ) ) { return TypeConstants . MISMATCH ; } } else { match = substitutedSuperType . findSuperTypeOriginatingFrom ( wildcardBound ) ; if ( match != null ) { if ( match . isProvablyDistinct ( wildcardBound ) ) { return TypeConstants . MISMATCH ; } } else { if ( ! wildcardBound . isTypeVariable ( ) && ! substitutedSuperType . isTypeVariable ( ) ) { return TypeConstants . MISMATCH ; } } } } } } boolean mustImplement = isArrayBound || ( ( ReferenceBinding ) wildcardBound ) . isFinal ( ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { TypeBinding substitutedSuperType = hasSubstitution ? Scope . substitute ( substitution , this . superInterfaces [ i ] ) : this . superInterfaces [ i ] ; if ( isArrayBound ) { if ( ! wildcardBound . isCompatibleWith ( substitutedSuperType ) ) return TypeConstants . MISMATCH ; } else { TypeBinding match = wildcardBound . findSuperTypeOriginatingFrom ( substitutedSuperType ) ; if ( match != null ) { if ( substitutedSuperType . isProvablyDistinct ( match ) ) { return TypeConstants . MISMATCH ; } } else if ( mustImplement ) { return TypeConstants . MISMATCH ; } } } break ; case Wildcard . SUPER : if ( wildcard . bound . isTypeVariable ( ) && ( ( TypeVariableBinding ) wildcard . bound ) . superclass . id == TypeIds . T_JavaLangObject ) break ; return boundCheck ( substitution , wildcard . bound ) ; case Wildcard . UNBOUND : break ; } return TypeConstants . OK ; } boolean unchecked = false ; if ( this . superclass . id != TypeIds . T_JavaLangObject ) { TypeBinding substitutedSuperType = hasSubstitution ? Scope . substitute ( substitution , this . superclass ) : this . superclass ; if ( substitutedSuperType != argumentType ) { if ( ! argumentType . isCompatibleWith ( substitutedSuperType ) ) { return TypeConstants . MISMATCH ; } TypeBinding match = argumentType . findSuperTypeOriginatingFrom ( substitutedSuperType ) ; if ( match != null ) { if ( match . isRawType ( ) && substitutedSuperType . isBoundParameterizedType ( ) ) unchecked = true ; } } } for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { TypeBinding substitutedSuperType = hasSubstitution ? Scope . substitute ( substitution , this . superInterfaces [ i ] ) : this . superInterfaces [ i ] ; if ( substitutedSuperType != argumentType ) { if ( ! argumentType . isCompatibleWith ( substitutedSuperType ) ) { return TypeConstants . MISMATCH ; } TypeBinding match = argumentType . findSuperTypeOriginatingFrom ( substitutedSuperType ) ; if ( match != null ) { if ( match . isRawType ( ) && substitutedSuperType . isBoundParameterizedType ( ) ) unchecked = true ; } } } return unchecked ? TypeConstants . UNCHECKED : TypeConstants . OK ; } public int boundsCount ( ) { if ( this . firstBound == null ) { return <NUM_LIT:0> ; } else if ( this . firstBound == this . superclass ) { return this . superInterfaces . length + <NUM_LIT:1> ; } else { return this . superInterfaces . length ; } } public boolean canBeInstantiated ( ) { return false ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( this . declaringElement != inferenceContext . genericMethod ) return ; switch ( actualType . kind ( ) ) { case Binding . BASE_TYPE : if ( actualType == TypeBinding . NULL ) return ; TypeBinding boxedType = scope . environment ( ) . computeBoxingType ( actualType ) ; if ( boxedType == actualType ) return ; actualType = boxedType ; break ; case Binding . WILDCARD_TYPE : return ; } int variableConstraint ; switch ( constraint ) { case TypeConstants . CONSTRAINT_EQUAL : variableConstraint = TypeConstants . CONSTRAINT_EQUAL ; break ; case TypeConstants . CONSTRAINT_EXTENDS : variableConstraint = TypeConstants . CONSTRAINT_SUPER ; break ; default : variableConstraint = TypeConstants . CONSTRAINT_EXTENDS ; break ; } inferenceContext . recordSubstitute ( this , actualType , variableConstraint ) ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; Binding declaring = this . declaringElement ; if ( ! isLeaf && declaring . kind ( ) == Binding . METHOD ) { MethodBinding methodBinding = ( MethodBinding ) declaring ; ReferenceBinding declaringClass = methodBinding . declaringClass ; buffer . append ( declaringClass . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT::>' ) ; MethodBinding [ ] methods = declaringClass . methods ( ) ; if ( methods != null ) for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { MethodBinding binding = methods [ i ] ; if ( binding == methodBinding ) { buffer . append ( i ) ; break ; } } } else { buffer . append ( declaring . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT::>' ) ; } buffer . append ( genericTypeSignature ( ) ) ; int length = buffer . length ( ) ; char [ ] uniqueKey = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public char [ ] constantPoolName ( ) { if ( this . firstBound != null ) { return this . firstBound . constantPoolName ( ) ; } return this . superclass . constantPoolName ( ) ; } public String debugName ( ) { return new String ( this . sourceName ) ; } public TypeBinding erasure ( ) { if ( this . firstBound != null ) { return this . firstBound . erasure ( ) ; } return this . superclass ; } public char [ ] genericSignature ( ) { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; sig . append ( this . sourceName ) . append ( '<CHAR_LIT::>' ) ; int interfaceLength = this . superInterfaces == null ? <NUM_LIT:0> : this . superInterfaces . length ; if ( interfaceLength == <NUM_LIT:0> || this . firstBound == this . superclass ) { if ( this . superclass != null ) sig . append ( this . superclass . genericTypeSignature ( ) ) ; } for ( int i = <NUM_LIT:0> ; i < interfaceLength ; i ++ ) { sig . append ( '<CHAR_LIT::>' ) . append ( this . superInterfaces [ i ] . genericTypeSignature ( ) ) ; } int sigLength = sig . length ( ) ; char [ ] genericSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , genericSignature , <NUM_LIT:0> ) ; return genericSignature ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature != null ) return this . genericTypeSignature ; return this . genericTypeSignature = CharOperation . concat ( '<CHAR_LIT>' , this . sourceName , '<CHAR_LIT:;>' ) ; } boolean hasOnlyRawBounds ( ) { if ( this . superclass != null && this . firstBound == this . superclass ) if ( ! this . superclass . isRawType ( ) ) return false ; if ( this . superInterfaces != null ) for ( int i = <NUM_LIT:0> , l = this . superInterfaces . length ; i < l ; i ++ ) if ( ! this . superInterfaces [ i ] . isRawType ( ) ) return false ; return true ; } public boolean hasTypeBit ( int bit ) { if ( this . typeBits == TypeIds . BitUninitialized ) { this . typeBits = <NUM_LIT:0> ; if ( this . superclass != null && this . superclass . hasTypeBit ( ~ TypeIds . BitUninitialized ) ) this . typeBits |= ( this . superclass . typeBits & TypeIds . InheritableBits ) ; if ( this . superInterfaces != null ) for ( int i = <NUM_LIT:0> , l = this . superInterfaces . length ; i < l ; i ++ ) if ( this . superInterfaces [ i ] . hasTypeBit ( ~ TypeIds . BitUninitialized ) ) this . typeBits |= ( this . superInterfaces [ i ] . typeBits & TypeIds . InheritableBits ) ; } return ( this . typeBits & bit ) != <NUM_LIT:0> ; } public boolean isErasureBoundTo ( TypeBinding type ) { if ( this . superclass . erasure ( ) == type ) return true ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( this . superInterfaces [ i ] . erasure ( ) == type ) return true ; } return false ; } public boolean isHierarchyConnected ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ; } public boolean isInterchangeableWith ( TypeVariableBinding otherVariable , Substitution substitute ) { if ( this == otherVariable ) return true ; int length = this . superInterfaces . length ; if ( length != otherVariable . superInterfaces . length ) return false ; if ( this . superclass != Scope . substitute ( substitute , otherVariable . superclass ) ) return false ; next : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding superType = Scope . substitute ( substitute , otherVariable . superInterfaces [ i ] ) ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) if ( superType == this . superInterfaces [ j ] ) continue next ; return false ; } return true ; } public boolean isTypeVariable ( ) { return true ; } public int kind ( ) { return Binding . TYPE_PARAMETER ; } public TypeBinding [ ] otherUpperBounds ( ) { if ( this . firstBound == null ) return Binding . NO_TYPES ; if ( this . firstBound == this . superclass ) return this . superInterfaces ; int otherLength = this . superInterfaces . length - <NUM_LIT:1> ; if ( otherLength > <NUM_LIT:0> ) { TypeBinding [ ] otherBounds ; System . arraycopy ( this . superInterfaces , <NUM_LIT:1> , otherBounds = new TypeBinding [ otherLength ] , <NUM_LIT:0> , otherLength ) ; return otherBounds ; } return Binding . NO_TYPES ; } public char [ ] readableName ( ) { return this . sourceName ; } ReferenceBinding resolve ( ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return this ; TypeBinding oldSuperclass = this . superclass , oldFirstInterface = null ; if ( this . superclass != null ) { ReferenceBinding resolveType = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( this . superclass , this . environment , true ) ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; this . superclass = resolveType ; } ReferenceBinding [ ] interfaces = this . superInterfaces ; int length ; if ( ( length = interfaces . length ) != <NUM_LIT:0> ) { oldFirstInterface = interfaces [ <NUM_LIT:0> ] ; for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding resolveType = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( interfaces [ i ] , this . environment , true ) ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; interfaces [ i ] = resolveType ; } } if ( this . firstBound != null ) { if ( this . firstBound == oldSuperclass ) { this . firstBound = this . superclass ; } else if ( this . firstBound == oldFirstInterface ) { this . firstBound = interfaces [ <NUM_LIT:0> ] ; } } this . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return this ; } public char [ ] shortReadableName ( ) { return readableName ( ) ; } public ReferenceBinding superclass ( ) { return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { return this . superInterfaces ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( '<CHAR_LIT>' ) . append ( this . sourceName ) ; if ( this . superclass != null && this . firstBound == this . superclass ) { buffer . append ( "<STR_LIT>" ) . append ( this . superclass . debugName ( ) ) ; } if ( this . superInterfaces != null && this . superInterfaces != Binding . NO_SUPERINTERFACES ) { if ( this . firstBound != this . superclass ) { buffer . append ( "<STR_LIT>" ) ; } for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> || this . firstBound == this . superclass ) { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( this . superInterfaces [ i ] . debugName ( ) ) ; } } buffer . append ( '<CHAR_LIT:>>' ) ; return buffer . toString ( ) ; } public TypeBinding upperBound ( ) { if ( this . firstBound != null ) { return this . firstBound ; } return this . superclass ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface TypeIds { final int T_undefined = <NUM_LIT:0> ; final int T_JavaLangObject = <NUM_LIT:1> ; final int T_char = <NUM_LIT:2> ; final int T_byte = <NUM_LIT:3> ; final int T_short = <NUM_LIT:4> ; final int T_boolean = <NUM_LIT:5> ; final int T_void = <NUM_LIT:6> ; final int T_long = <NUM_LIT:7> ; final int T_double = <NUM_LIT:8> ; final int T_float = <NUM_LIT:9> ; final int T_int = <NUM_LIT:10> ; final int T_JavaLangString = <NUM_LIT:11> ; final int T_null = <NUM_LIT:12> ; final int T_JavaLangClass = <NUM_LIT:16> ; final int T_JavaLangStringBuffer = <NUM_LIT> ; final int T_JavaLangSystem = <NUM_LIT> ; final int T_JavaLangError = <NUM_LIT> ; final int T_JavaLangReflectConstructor = <NUM_LIT:20> ; final int T_JavaLangThrowable = <NUM_LIT> ; final int T_JavaLangNoClassDefError = <NUM_LIT> ; final int T_JavaLangClassNotFoundException = <NUM_LIT> ; final int T_JavaLangRuntimeException = <NUM_LIT:24> ; final int T_JavaLangException = <NUM_LIT> ; final int T_JavaLangByte = <NUM_LIT> ; final int T_JavaLangShort = <NUM_LIT> ; final int T_JavaLangCharacter = <NUM_LIT> ; final int T_JavaLangInteger = <NUM_LIT> ; final int T_JavaLangLong = <NUM_LIT:30> ; final int T_JavaLangFloat = <NUM_LIT:31> ; final int T_JavaLangDouble = <NUM_LIT:32> ; final int T_JavaLangBoolean = <NUM_LIT> ; final int T_JavaLangVoid = <NUM_LIT> ; final int T_JavaLangAssertionError = <NUM_LIT> ; final int T_JavaLangCloneable = <NUM_LIT> ; final int T_JavaIoSerializable = <NUM_LIT> ; final int T_JavaLangIterable = <NUM_LIT> ; final int T_JavaUtilIterator = <NUM_LIT> ; final int T_JavaLangStringBuilder = <NUM_LIT> ; final int T_JavaLangEnum = <NUM_LIT> ; final int T_JavaLangIllegalArgumentException = <NUM_LIT> ; final int T_JavaLangAnnotationAnnotation = <NUM_LIT> ; final int T_JavaLangDeprecated = <NUM_LIT> ; final int T_JavaLangAnnotationDocumented = <NUM_LIT> ; final int T_JavaLangAnnotationInherited = <NUM_LIT> ; final int T_JavaLangOverride = <NUM_LIT> ; final int T_JavaLangAnnotationRetention = <NUM_LIT> ; final int T_JavaLangSuppressWarnings = <NUM_LIT> ; final int T_JavaLangAnnotationTarget = <NUM_LIT> ; final int T_JavaLangAnnotationRetentionPolicy = <NUM_LIT> ; final int T_JavaLangAnnotationElementType = <NUM_LIT> ; final int T_JavaIoPrintStream = <NUM_LIT> ; final int T_JavaLangReflectField = <NUM_LIT> ; final int T_JavaLangReflectMethod = <NUM_LIT> ; final int T_JavaIoExternalizable = <NUM_LIT> ; final int T_JavaIoObjectStreamException = <NUM_LIT> ; final int T_JavaIoException = <NUM_LIT> ; final int T_JavaUtilCollection = <NUM_LIT> ; final int T_JavaLangSafeVarargs = <NUM_LIT> ; final int T_JavaLangInvokeMethodHandlePolymorphicSignature = <NUM_LIT> ; final int T_JavaLangAutoCloseable = <NUM_LIT> ; final int T_ConfiguredAnnotationNullable = <NUM_LIT> ; final int T_ConfiguredAnnotationNonNull = <NUM_LIT> ; final int T_ConfiguredAnnotationNonNullByDefault = <NUM_LIT> ; final int T_OrgEclipseCoreRuntimeAssert = <NUM_LIT> ; final int NoId = Integer . MAX_VALUE ; public static final int IMPLICIT_CONVERSION_MASK = <NUM_LIT> ; public static final int COMPILE_TYPE_MASK = <NUM_LIT> ; final int Boolean2Int = T_boolean + ( T_int << <NUM_LIT:4> ) ; final int Boolean2String = T_boolean + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Boolean2Boolean = T_boolean + ( T_boolean << <NUM_LIT:4> ) ; final int Byte2Byte = T_byte + ( T_byte << <NUM_LIT:4> ) ; final int Byte2Short = T_byte + ( T_short << <NUM_LIT:4> ) ; final int Byte2Char = T_byte + ( T_char << <NUM_LIT:4> ) ; final int Byte2Int = T_byte + ( T_int << <NUM_LIT:4> ) ; final int Byte2Long = T_byte + ( T_long << <NUM_LIT:4> ) ; final int Byte2Float = T_byte + ( T_float << <NUM_LIT:4> ) ; final int Byte2Double = T_byte + ( T_double << <NUM_LIT:4> ) ; final int Byte2String = T_byte + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Short2Byte = T_short + ( T_byte << <NUM_LIT:4> ) ; final int Short2Short = T_short + ( T_short << <NUM_LIT:4> ) ; final int Short2Char = T_short + ( T_char << <NUM_LIT:4> ) ; final int Short2Int = T_short + ( T_int << <NUM_LIT:4> ) ; final int Short2Long = T_short + ( T_long << <NUM_LIT:4> ) ; final int Short2Float = T_short + ( T_float << <NUM_LIT:4> ) ; final int Short2Double = T_short + ( T_double << <NUM_LIT:4> ) ; final int Short2String = T_short + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Char2Byte = T_char + ( T_byte << <NUM_LIT:4> ) ; final int Char2Short = T_char + ( T_short << <NUM_LIT:4> ) ; final int Char2Char = T_char + ( T_char << <NUM_LIT:4> ) ; final int Char2Int = T_char + ( T_int << <NUM_LIT:4> ) ; final int Char2Long = T_char + ( T_long << <NUM_LIT:4> ) ; final int Char2Float = T_char + ( T_float << <NUM_LIT:4> ) ; final int Char2Double = T_char + ( T_double << <NUM_LIT:4> ) ; final int Char2String = T_char + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Int2Byte = T_int + ( T_byte << <NUM_LIT:4> ) ; final int Int2Short = T_int + ( T_short << <NUM_LIT:4> ) ; final int Int2Char = T_int + ( T_char << <NUM_LIT:4> ) ; final int Int2Int = T_int + ( T_int << <NUM_LIT:4> ) ; final int Int2Long = T_int + ( T_long << <NUM_LIT:4> ) ; final int Int2Float = T_int + ( T_float << <NUM_LIT:4> ) ; final int Int2Double = T_int + ( T_double << <NUM_LIT:4> ) ; final int Int2String = T_int + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Long2Byte = T_long + ( T_byte << <NUM_LIT:4> ) ; final int Long2Short = T_long + ( T_short << <NUM_LIT:4> ) ; final int Long2Char = T_long + ( T_char << <NUM_LIT:4> ) ; final int Long2Int = T_long + ( T_int << <NUM_LIT:4> ) ; final int Long2Long = T_long + ( T_long << <NUM_LIT:4> ) ; final int Long2Float = T_long + ( T_float << <NUM_LIT:4> ) ; final int Long2Double = T_long + ( T_double << <NUM_LIT:4> ) ; final int Long2String = T_long + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Float2Byte = T_float + ( T_byte << <NUM_LIT:4> ) ; final int Float2Short = T_float + ( T_short << <NUM_LIT:4> ) ; final int Float2Char = T_float + ( T_char << <NUM_LIT:4> ) ; final int Float2Int = T_float + ( T_int << <NUM_LIT:4> ) ; final int Float2Long = T_float + ( T_long << <NUM_LIT:4> ) ; final int Float2Float = T_float + ( T_float << <NUM_LIT:4> ) ; final int Float2Double = T_float + ( T_double << <NUM_LIT:4> ) ; final int Float2String = T_float + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Double2Byte = T_double + ( T_byte << <NUM_LIT:4> ) ; final int Double2Short = T_double + ( T_short << <NUM_LIT:4> ) ; final int Double2Char = T_double + ( T_char << <NUM_LIT:4> ) ; final int Double2Int = T_double + ( T_int << <NUM_LIT:4> ) ; final int Double2Long = T_double + ( T_long << <NUM_LIT:4> ) ; final int Double2Float = T_double + ( T_float << <NUM_LIT:4> ) ; final int Double2Double = T_double + ( T_double << <NUM_LIT:4> ) ; final int Double2String = T_double + ( T_JavaLangString << <NUM_LIT:4> ) ; final int String2String = T_JavaLangString + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Object2String = T_JavaLangObject + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Null2Null = T_null + ( T_null << <NUM_LIT:4> ) ; final int Null2String = T_null + ( T_JavaLangString << <NUM_LIT:4> ) ; final int Object2Object = T_JavaLangObject + ( T_JavaLangObject << <NUM_LIT:4> ) ; final int Object2byte = T_JavaLangObject + ( T_byte << <NUM_LIT:4> ) ; final int Object2short = T_JavaLangObject + ( T_short << <NUM_LIT:4> ) ; final int Object2char = T_JavaLangObject + ( T_char << <NUM_LIT:4> ) ; final int Object2int = T_JavaLangObject + ( T_int << <NUM_LIT:4> ) ; final int Object2long = T_JavaLangObject + ( T_long << <NUM_LIT:4> ) ; final int Object2float = T_JavaLangObject + ( T_float << <NUM_LIT:4> ) ; final int Object2double = T_JavaLangObject + ( T_double << <NUM_LIT:4> ) ; final int Object2boolean = T_JavaLangObject + ( T_boolean << <NUM_LIT:4> ) ; final int BOXING = <NUM_LIT> ; final int UNBOXING = <NUM_LIT> ; final int BitUninitialized = <NUM_LIT> ; final int BitAutoCloseable = <NUM_LIT:1> ; final int BitCloseable = <NUM_LIT:2> ; final int BitWrapperCloseable = <NUM_LIT:4> ; final int BitResourceFreeCloseable = <NUM_LIT:8> ; final int InheritableBits = BitAutoCloseable | BitCloseable ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . FakedTrackingVariable ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; public class LocalVariableBinding extends VariableBinding { public int resolvedPosition ; public static final int UNUSED = <NUM_LIT:0> ; public static final int USED = <NUM_LIT:1> ; public static final int FAKE_USED = <NUM_LIT:2> ; public int useFlag ; public BlockScope declaringScope ; public LocalDeclaration declaration ; public int [ ] initializationPCs ; public int initializationCount = <NUM_LIT:0> ; public FakedTrackingVariable closeTracker ; public LocalVariableBinding ( char [ ] name , TypeBinding type , int modifiers , boolean isArgument ) { super ( name , type , modifiers , isArgument ? Constant . NotAConstant : null ) ; if ( isArgument ) this . tagBits |= TagBits . IsArgument ; this . tagBits |= TagBits . IsEffectivelyFinal ; } public LocalVariableBinding ( LocalDeclaration declaration , TypeBinding type , int modifiers , boolean isArgument ) { this ( declaration . name , type , modifiers , isArgument ) ; this . declaration = declaration ; this . tagBits |= TagBits . IsEffectivelyFinal ; } public final int kind ( ) { return LOCAL ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; BlockScope scope = this . declaringScope ; int occurenceCount = <NUM_LIT:0> ; if ( scope != null ) { MethodScope methodScope = scope instanceof MethodScope ? ( MethodScope ) scope : scope . enclosingMethodScope ( ) ; ReferenceContext referenceContext = methodScope . referenceContext ; if ( referenceContext instanceof AbstractMethodDeclaration ) { MethodBinding methodBinding = ( ( AbstractMethodDeclaration ) referenceContext ) . binding ; if ( methodBinding != null ) { buffer . append ( methodBinding . computeUniqueKey ( false ) ) ; } } else if ( referenceContext instanceof TypeDeclaration ) { TypeBinding typeBinding = ( ( TypeDeclaration ) referenceContext ) . binding ; if ( typeBinding != null ) { buffer . append ( typeBinding . computeUniqueKey ( false ) ) ; } } getScopeKey ( scope , buffer ) ; LocalVariableBinding [ ] locals = scope . locals ; for ( int i = <NUM_LIT:0> ; i < scope . localIndex ; i ++ ) { LocalVariableBinding local = locals [ i ] ; if ( CharOperation . equals ( this . name , local . name ) ) { if ( this == local ) break ; occurenceCount ++ ; } } } buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( this . name ) ; if ( occurenceCount > <NUM_LIT:0> ) { buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( occurenceCount ) ; } int length = buffer . length ( ) ; char [ ] uniqueKey = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public AnnotationBinding [ ] getAnnotations ( ) { if ( this . declaringScope == null ) { if ( ( this . tagBits & TagBits . AnnotationResolved ) != <NUM_LIT:0> ) { if ( this . declaration == null ) { return Binding . NO_ANNOTATIONS ; } Annotation [ ] annotations = this . declaration . annotations ; if ( annotations != null ) { int length = annotations . length ; AnnotationBinding [ ] annotationBindings = new AnnotationBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { AnnotationBinding compilerAnnotation = annotations [ i ] . getCompilerAnnotation ( ) ; if ( compilerAnnotation == null ) { return Binding . NO_ANNOTATIONS ; } annotationBindings [ i ] = compilerAnnotation ; } return annotationBindings ; } } return Binding . NO_ANNOTATIONS ; } SourceTypeBinding sourceType = this . declaringScope . enclosingSourceType ( ) ; if ( sourceType == null ) return Binding . NO_ANNOTATIONS ; AnnotationBinding [ ] annotations = sourceType . retrieveAnnotations ( this ) ; if ( ( this . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> ) { if ( ( ( this . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) && this . declaration != null ) { Annotation [ ] annotationNodes = this . declaration . annotations ; if ( annotationNodes != null ) { int length = annotationNodes . length ; ASTNode . resolveAnnotations ( this . declaringScope , annotationNodes , this ) ; annotations = new AnnotationBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) annotations [ i ] = new AnnotationBinding ( annotationNodes [ i ] ) ; setAnnotations ( annotations , this . declaringScope ) ; } } } return annotations ; } private void getScopeKey ( BlockScope scope , StringBuffer buffer ) { int scopeIndex = scope . scopeIndex ( ) ; if ( scopeIndex != - <NUM_LIT:1> ) { getScopeKey ( ( BlockScope ) scope . parent , buffer ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( scopeIndex ) ; } } public boolean isNonNull ( ) { return ( this . tagBits & TagBits . AnnotationNonNull ) != <NUM_LIT:0> ; } public boolean isNullable ( ) { return ( this . tagBits & TagBits . AnnotationNullable ) != <NUM_LIT:0> ; } public boolean isSecret ( ) { return this . declaration == null && ( this . tagBits & TagBits . IsArgument ) == <NUM_LIT:0> ; } public void recordInitializationEndPC ( int pc ) { if ( this . initializationPCs [ ( ( this . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] == - <NUM_LIT:1> ) this . initializationPCs [ ( ( this . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] = pc ; } public void recordInitializationStartPC ( int pc ) { if ( this . initializationPCs == null ) { return ; } if ( this . initializationCount > <NUM_LIT:0> ) { int previousEndPC = this . initializationPCs [ ( ( this . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( previousEndPC == - <NUM_LIT:1> ) { return ; } if ( previousEndPC == pc ) { this . initializationPCs [ ( ( this . initializationCount - <NUM_LIT:1> ) << <NUM_LIT:1> ) + <NUM_LIT:1> ] = - <NUM_LIT:1> ; return ; } } int index = this . initializationCount << <NUM_LIT:1> ; if ( index == this . initializationPCs . length ) { System . arraycopy ( this . initializationPCs , <NUM_LIT:0> , ( this . initializationPCs = new int [ this . initializationCount << <NUM_LIT:2> ] ) , <NUM_LIT:0> , index ) ; } this . initializationPCs [ index ] = pc ; this . initializationPCs [ index + <NUM_LIT:1> ] = - <NUM_LIT:1> ; this . initializationCount ++ ; } public void setAnnotations ( AnnotationBinding [ ] annotations , Scope scope ) { if ( scope == null ) return ; SourceTypeBinding sourceType = scope . enclosingSourceType ( ) ; if ( sourceType != null ) sourceType . storeAnnotations ( this , annotations ) ; } public void resetInitializations ( ) { this . initializationCount = <NUM_LIT:0> ; this . initializationPCs = null ; } public String toString ( ) { String s = super . toString ( ) ; switch ( this . useFlag ) { case USED : s += "<STR_LIT>" + String . valueOf ( this . resolvedPosition ) + "<STR_LIT:]>" ; break ; case UNUSED : s += "<STR_LIT>" ; break ; case FAKE_USED : s += "<STR_LIT>" ; break ; } s += "<STR_LIT>" + String . valueOf ( this . id ) + "<STR_LIT:]>" ; if ( this . initializationCount > <NUM_LIT:0> ) { s += "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i < this . initializationCount ; i ++ ) { if ( i > <NUM_LIT:0> ) s += "<STR_LIT:U+002CU+0020>" ; s += String . valueOf ( this . initializationPCs [ i << <NUM_LIT:1> ] ) + "<STR_LIT:->" + ( ( this . initializationPCs [ ( i << <NUM_LIT:1> ) + <NUM_LIT:1> ] == - <NUM_LIT:1> ) ? "<STR_LIT:?>" : String . valueOf ( this . initializationPCs [ ( i << <NUM_LIT:1> ) + <NUM_LIT:1> ] ) ) ; } s += "<STR_LIT:]>" ; } return s ; } public boolean isParameter ( ) { return ( ( this . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; public class SourceTypeCollisionException extends RuntimeException { private static final long serialVersionUID = <NUM_LIT> ; public ICompilationUnit [ ] newAnnotationProcessorUnits ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public final class BaseTypeBinding extends TypeBinding { public static final int [ ] CONVERSIONS ; public static final int IDENTITY = <NUM_LIT:1> ; public static final int WIDENING = <NUM_LIT:2> ; public static final int NARROWING = <NUM_LIT:4> ; public static final int MAX_CONVERSIONS = <NUM_LIT:16> * <NUM_LIT:16> ; static { CONVERSIONS = initializeConversions ( ) ; } public static final int [ ] initializeConversions ( ) { int [ ] table = new int [ MAX_CONVERSIONS ] ; table [ TypeIds . Boolean2Boolean ] = IDENTITY ; table [ TypeIds . Byte2Byte ] = IDENTITY ; table [ TypeIds . Byte2Short ] = WIDENING ; table [ TypeIds . Byte2Char ] = NARROWING ; table [ TypeIds . Byte2Int ] = WIDENING ; table [ TypeIds . Byte2Long ] = WIDENING ; table [ TypeIds . Byte2Float ] = WIDENING ; table [ TypeIds . Byte2Double ] = WIDENING ; table [ TypeIds . Short2Byte ] = NARROWING ; table [ TypeIds . Short2Short ] = IDENTITY ; table [ TypeIds . Short2Char ] = NARROWING ; table [ TypeIds . Short2Int ] = WIDENING ; table [ TypeIds . Short2Long ] = WIDENING ; table [ TypeIds . Short2Float ] = WIDENING ; table [ TypeIds . Short2Double ] = WIDENING ; table [ TypeIds . Char2Byte ] = NARROWING ; table [ TypeIds . Char2Short ] = NARROWING ; table [ TypeIds . Char2Char ] = IDENTITY ; table [ TypeIds . Char2Int ] = WIDENING ; table [ TypeIds . Char2Long ] = WIDENING ; table [ TypeIds . Char2Float ] = WIDENING ; table [ TypeIds . Char2Double ] = WIDENING ; table [ TypeIds . Int2Byte ] = NARROWING ; table [ TypeIds . Int2Short ] = NARROWING ; table [ TypeIds . Int2Char ] = NARROWING ; table [ TypeIds . Int2Int ] = IDENTITY ; table [ TypeIds . Int2Long ] = WIDENING ; table [ TypeIds . Int2Float ] = WIDENING ; table [ TypeIds . Int2Double ] = WIDENING ; table [ TypeIds . Long2Byte ] = NARROWING ; table [ TypeIds . Long2Short ] = NARROWING ; table [ TypeIds . Long2Char ] = NARROWING ; table [ TypeIds . Long2Int ] = NARROWING ; table [ TypeIds . Long2Long ] = IDENTITY ; table [ TypeIds . Long2Float ] = WIDENING ; table [ TypeIds . Long2Double ] = WIDENING ; table [ TypeIds . Float2Byte ] = NARROWING ; table [ TypeIds . Float2Short ] = NARROWING ; table [ TypeIds . Float2Char ] = NARROWING ; table [ TypeIds . Float2Int ] = NARROWING ; table [ TypeIds . Float2Long ] = NARROWING ; table [ TypeIds . Float2Float ] = IDENTITY ; table [ TypeIds . Float2Double ] = WIDENING ; table [ TypeIds . Double2Byte ] = NARROWING ; table [ TypeIds . Double2Short ] = NARROWING ; table [ TypeIds . Double2Char ] = NARROWING ; table [ TypeIds . Double2Int ] = NARROWING ; table [ TypeIds . Double2Long ] = NARROWING ; table [ TypeIds . Double2Float ] = NARROWING ; table [ TypeIds . Double2Double ] = IDENTITY ; return table ; } public static final boolean isNarrowing ( int left , int right ) { int right2left = right + ( left << <NUM_LIT:4> ) ; return right2left >= <NUM_LIT:0> && right2left < MAX_CONVERSIONS && ( CONVERSIONS [ right2left ] & ( IDENTITY | NARROWING ) ) != <NUM_LIT:0> ; } public static final boolean isWidening ( int left , int right ) { int right2left = right + ( left << <NUM_LIT:4> ) ; return right2left >= <NUM_LIT:0> && right2left < MAX_CONVERSIONS && ( CONVERSIONS [ right2left ] & ( IDENTITY | WIDENING ) ) != <NUM_LIT:0> ; } public char [ ] simpleName ; private char [ ] constantPoolName ; BaseTypeBinding ( int id , char [ ] name , char [ ] constantPoolName ) { this . tagBits |= TagBits . IsBaseType ; this . id = id ; this . simpleName = name ; this . constantPoolName = constantPoolName ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { return constantPoolName ( ) ; } public char [ ] constantPoolName ( ) { return this . constantPoolName ; } public PackageBinding getPackage ( ) { return null ; } public final boolean isCompatibleWith ( TypeBinding left ) { if ( this == left ) return true ; int right2left = this . id + ( left . id << <NUM_LIT:4> ) ; if ( right2left >= <NUM_LIT:0> && right2left < MAX_CONVERSIONS && ( CONVERSIONS [ right2left ] & ( IDENTITY | WIDENING ) ) != <NUM_LIT:0> ) return true ; return this == TypeBinding . NULL && ! left . isBaseType ( ) ; } public boolean isUncheckedException ( boolean includeSupertype ) { return this == TypeBinding . NULL ; } public int kind ( ) { return Binding . BASE_TYPE ; } public char [ ] qualifiedSourceName ( ) { return this . simpleName ; } public char [ ] readableName ( ) { return this . simpleName ; } public char [ ] shortReadableName ( ) { return this . simpleName ; } public char [ ] sourceName ( ) { return this . simpleName ; } public String toString ( ) { return new String ( this . constantPoolName ) + "<STR_LIT>" + this . id + "<STR_LIT:)>" ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class SyntheticFieldBinding extends FieldBinding { public int index ; public SyntheticFieldBinding ( char [ ] name , TypeBinding type , int modifiers , ReferenceBinding declaringClass , Constant constant , int index ) { super ( name , type , modifiers , declaringClass , constant ) ; this . index = index ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; import org . eclipse . jdt . internal . compiler . util . Util ; public class MethodBinding extends Binding { public int modifiers ; public char [ ] selector ; public TypeBinding returnType ; public TypeBinding [ ] parameters ; public ReferenceBinding [ ] thrownExceptions ; public ReferenceBinding declaringClass ; public TypeVariableBinding [ ] typeVariables = Binding . NO_TYPE_VARIABLES ; char [ ] signature ; public long tagBits ; public Boolean [ ] parameterNonNullness ; protected MethodBinding ( ) { } public MethodBinding ( int modifiers , char [ ] selector , TypeBinding returnType , TypeBinding [ ] parameters , ReferenceBinding [ ] thrownExceptions , ReferenceBinding declaringClass ) { this . modifiers = modifiers ; this . selector = selector ; this . returnType = returnType ; this . parameters = ( parameters == null || parameters . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : parameters ; this . thrownExceptions = ( thrownExceptions == null || thrownExceptions . length == <NUM_LIT:0> ) ? Binding . NO_EXCEPTIONS : thrownExceptions ; this . declaringClass = declaringClass ; if ( this . declaringClass != null ) { if ( this . declaringClass . isStrictfp ( ) ) if ( ! ( isNative ( ) || isAbstract ( ) ) ) this . modifiers |= ClassFileConstants . AccStrictfp ; } } public MethodBinding ( int modifiers , TypeBinding [ ] parameters , ReferenceBinding [ ] thrownExceptions , ReferenceBinding declaringClass ) { this ( modifiers , TypeConstants . INIT , TypeBinding . VOID , parameters , thrownExceptions , declaringClass ) ; } public MethodBinding ( MethodBinding initialMethodBinding , ReferenceBinding declaringClass ) { this . modifiers = initialMethodBinding . modifiers ; this . selector = initialMethodBinding . selector ; this . returnType = initialMethodBinding . returnType ; this . parameters = initialMethodBinding . parameters ; this . thrownExceptions = initialMethodBinding . thrownExceptions ; this . declaringClass = declaringClass ; declaringClass . storeAnnotationHolder ( this , initialMethodBinding . declaringClass . retrieveAnnotationHolder ( initialMethodBinding , true ) ) ; } public final boolean areParameterErasuresEqual ( MethodBinding method ) { TypeBinding [ ] args = method . parameters ; if ( this . parameters == args ) return true ; int length = this . parameters . length ; if ( length != args . length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( this . parameters [ i ] != args [ i ] && this . parameters [ i ] . erasure ( ) != args [ i ] . erasure ( ) ) return false ; return true ; } public final boolean areParametersCompatibleWith ( TypeBinding [ ] arguments ) { int paramLength = this . parameters . length ; int argLength = arguments . length ; int lastIndex = argLength ; if ( isVarargs ( ) ) { lastIndex = paramLength - <NUM_LIT:1> ; if ( paramLength == argLength ) { TypeBinding varArgType = this . parameters [ lastIndex ] ; TypeBinding lastArgument = arguments [ lastIndex ] ; if ( varArgType != lastArgument && ! lastArgument . isCompatibleWith ( varArgType ) ) return false ; } else if ( paramLength < argLength ) { TypeBinding varArgType = ( ( ArrayBinding ) this . parameters [ lastIndex ] ) . elementsType ( ) ; for ( int i = lastIndex ; i < argLength ; i ++ ) if ( varArgType != arguments [ i ] && ! arguments [ i ] . isCompatibleWith ( varArgType ) ) return false ; } else if ( lastIndex != argLength ) { return false ; } } for ( int i = <NUM_LIT:0> ; i < lastIndex ; i ++ ) if ( this . parameters [ i ] != arguments [ i ] && ! arguments [ i ] . isCompatibleWith ( this . parameters [ i ] ) ) return false ; return true ; } public final boolean areParametersEqual ( MethodBinding method ) { TypeBinding [ ] args = method . parameters ; if ( this . parameters == args ) return true ; int length = this . parameters . length ; if ( length != args . length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( this . parameters [ i ] != args [ i ] ) return false ; return true ; } public final boolean areTypeVariableErasuresEqual ( MethodBinding method ) { TypeVariableBinding [ ] vars = method . typeVariables ; if ( this . typeVariables == vars ) return true ; int length = this . typeVariables . length ; if ( length != vars . length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( this . typeVariables [ i ] != vars [ i ] && this . typeVariables [ i ] . erasure ( ) != vars [ i ] . erasure ( ) ) return false ; return true ; } MethodBinding asRawMethod ( LookupEnvironment env ) { if ( this . typeVariables == Binding . NO_TYPE_VARIABLES ) return this ; int length = this . typeVariables . length ; TypeBinding [ ] arguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeVariableBinding var = this . typeVariables [ i ] ; if ( var . boundsCount ( ) <= <NUM_LIT:1> ) { arguments [ i ] = env . convertToRawType ( var . upperBound ( ) , false ) ; } else { TypeBinding [ ] itsSuperinterfaces = var . superInterfaces ( ) ; int superLength = itsSuperinterfaces . length ; TypeBinding rawFirstBound = null ; TypeBinding [ ] rawOtherBounds = null ; if ( var . boundsCount ( ) == superLength ) { rawFirstBound = env . convertToRawType ( itsSuperinterfaces [ <NUM_LIT:0> ] , false ) ; rawOtherBounds = new TypeBinding [ superLength - <NUM_LIT:1> ] ; for ( int s = <NUM_LIT:1> ; s < superLength ; s ++ ) rawOtherBounds [ s - <NUM_LIT:1> ] = env . convertToRawType ( itsSuperinterfaces [ s ] , false ) ; } else { rawFirstBound = env . convertToRawType ( var . superclass ( ) , false ) ; rawOtherBounds = new TypeBinding [ superLength ] ; for ( int s = <NUM_LIT:0> ; s < superLength ; s ++ ) rawOtherBounds [ s ] = env . convertToRawType ( itsSuperinterfaces [ s ] , false ) ; } arguments [ i ] = env . createWildcard ( null , <NUM_LIT:0> , rawFirstBound , rawOtherBounds , org . eclipse . jdt . internal . compiler . ast . Wildcard . EXTENDS ) ; } } return env . createParameterizedGenericMethod ( this , arguments ) ; } public final boolean canBeSeenBy ( InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( invocationType == this . declaringClass ) return true ; if ( isProtected ( ) ) { if ( invocationType . fPackage == this . declaringClass . fPackage ) return true ; return invocationSite . isSuperAccess ( ) ; } if ( isPrivate ( ) ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } return outerInvocationType == outerDeclaringClass ; } return invocationType . fPackage == this . declaringClass . fPackage ; } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { if ( isPublic ( ) ) return true ; if ( isPrivate ( ) ) return false ; return invocationPackage == this . declaringClass . getPackage ( ) ; } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( invocationType == this . declaringClass && invocationType == receiverType ) return true ; if ( invocationType == null ) return ! isPrivate ( ) && scope . getCurrentPackage ( ) == this . declaringClass . fPackage ; if ( isProtected ( ) ) { if ( invocationType == this . declaringClass ) return true ; if ( invocationType . fPackage == this . declaringClass . fPackage ) return true ; ReferenceBinding currentType = invocationType ; TypeBinding receiverErasure = receiverType . erasure ( ) ; ReferenceBinding declaringErasure = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; int depth = <NUM_LIT:0> ; do { if ( currentType . findSuperTypeOriginatingFrom ( declaringErasure ) != null ) { if ( invocationSite . isSuperAccess ( ) ) return true ; if ( receiverType instanceof ArrayBinding ) return false ; if ( isStatic ( ) ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } if ( currentType == receiverErasure || receiverErasure . findSuperTypeOriginatingFrom ( currentType ) != null ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } } depth ++ ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { receiverCheck : { if ( receiverType != this . declaringClass ) { if ( scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_6 && receiverType . isTypeVariable ( ) && ( ( TypeVariableBinding ) receiverType ) . isErasureBoundTo ( this . declaringClass . erasure ( ) ) ) break receiverCheck ; return false ; } } if ( invocationType != this . declaringClass ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } PackageBinding declaringPackage = this . declaringClass . fPackage ; if ( invocationType . fPackage != declaringPackage ) return false ; if ( receiverType instanceof ArrayBinding ) return false ; TypeBinding originalDeclaringClass = this . declaringClass . original ( ) ; ReferenceBinding currentType = ( ReferenceBinding ) ( receiverType ) ; do { if ( currentType . isCapture ( ) ) { if ( originalDeclaringClass == currentType . erasure ( ) . original ( ) ) return true ; } else { if ( originalDeclaringClass == currentType . original ( ) ) return true ; } PackageBinding currentPackage = currentType . fPackage ; if ( currentPackage != null && currentPackage != declaringPackage ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypes = this . returnType . collectMissingTypes ( missingTypes ) ; for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { missingTypes = this . parameters [ i ] . collectMissingTypes ( missingTypes ) ; } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { missingTypes = this . thrownExceptions [ i ] . collectMissingTypes ( missingTypes ) ; } for ( int i = <NUM_LIT:0> , max = this . typeVariables . length ; i < max ; i ++ ) { TypeVariableBinding variable = this . typeVariables [ i ] ; missingTypes = variable . superclass ( ) . collectMissingTypes ( missingTypes ) ; ReferenceBinding [ ] interfaces = variable . superInterfaces ( ) ; for ( int j = <NUM_LIT:0> , length = interfaces . length ; j < length ; j ++ ) { missingTypes = interfaces [ j ] . collectMissingTypes ( missingTypes ) ; } } } return missingTypes ; } MethodBinding computeSubstitutedMethod ( MethodBinding method , LookupEnvironment env ) { int length = this . typeVariables . length ; TypeVariableBinding [ ] vars = method . typeVariables ; if ( length != vars . length ) return null ; ParameterizedGenericMethodBinding substitute = env . createParameterizedGenericMethod ( method , this . typeVariables ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! this . typeVariables [ i ] . isInterchangeableWith ( vars [ i ] , substitute ) ) return null ; return substitute ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] declaringKey = this . declaringClass . computeUniqueKey ( false ) ; int declaringLength = declaringKey . length ; int selectorLength = this . selector == TypeConstants . INIT ? <NUM_LIT:0> : this . selector . length ; char [ ] sig = genericSignature ( ) ; boolean isGeneric = sig != null ; if ( ! isGeneric ) sig = signature ( ) ; int signatureLength = sig . length ; int thrownExceptionsLength = this . thrownExceptions . length ; int thrownExceptionsSignatureLength = <NUM_LIT:0> ; char [ ] [ ] thrownExceptionsSignatures = null ; boolean addThrownExceptions = thrownExceptionsLength > <NUM_LIT:0> && ( ! isGeneric || CharOperation . lastIndexOf ( '<CHAR_LIT>' , sig ) < <NUM_LIT:0> ) ; if ( addThrownExceptions ) { thrownExceptionsSignatures = new char [ thrownExceptionsLength ] [ ] ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionsLength ; i ++ ) { if ( this . thrownExceptions [ i ] != null ) { thrownExceptionsSignatures [ i ] = this . thrownExceptions [ i ] . signature ( ) ; thrownExceptionsSignatureLength += thrownExceptionsSignatures [ i ] . length + <NUM_LIT:1> ; } } } char [ ] uniqueKey = new char [ declaringLength + <NUM_LIT:1> + selectorLength + signatureLength + thrownExceptionsSignatureLength ] ; int index = <NUM_LIT:0> ; System . arraycopy ( declaringKey , <NUM_LIT:0> , uniqueKey , index , declaringLength ) ; index = declaringLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:.>' ; System . arraycopy ( this . selector , <NUM_LIT:0> , uniqueKey , index , selectorLength ) ; index += selectorLength ; System . arraycopy ( sig , <NUM_LIT:0> , uniqueKey , index , signatureLength ) ; if ( thrownExceptionsSignatureLength > <NUM_LIT:0> ) { index += signatureLength ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionsLength ; i ++ ) { char [ ] thrownExceptionSignature = thrownExceptionsSignatures [ i ] ; if ( thrownExceptionSignature != null ) { uniqueKey [ index ++ ] = '<CHAR_LIT>' ; int length = thrownExceptionSignature . length ; System . arraycopy ( thrownExceptionSignature , <NUM_LIT:0> , uniqueKey , index , length ) ; index += length ; } } } return uniqueKey ; } public final char [ ] constantPoolName ( ) { return this . selector ; } protected void fillInDefaultNonNullness ( ) { if ( this . parameterNonNullness == null ) this . parameterNonNullness = new Boolean [ this . parameters . length ] ; AbstractMethodDeclaration sourceMethod = sourceMethod ( ) ; boolean added = false ; int length = this . parameterNonNullness . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( this . parameters [ i ] . isBaseType ( ) ) continue ; if ( this . parameterNonNullness [ i ] == null ) { added = true ; this . parameterNonNullness [ i ] = Boolean . TRUE ; if ( sourceMethod != null ) { sourceMethod . arguments [ i ] . binding . tagBits |= TagBits . AnnotationNonNull ; } } else if ( this . parameterNonNullness [ i ] . booleanValue ( ) ) { sourceMethod . scope . problemReporter ( ) . nullAnnotationIsRedundant ( sourceMethod , i ) ; } } if ( added ) this . tagBits |= TagBits . HasParameterAnnotations ; if ( this . returnType != null && ! this . returnType . isBaseType ( ) && ( this . tagBits & ( TagBits . AnnotationNonNull | TagBits . AnnotationNullable ) ) == <NUM_LIT:0> ) { this . tagBits |= TagBits . AnnotationNonNull ; } else if ( ( this . tagBits & TagBits . AnnotationNonNull ) != <NUM_LIT:0> ) { sourceMethod . scope . problemReporter ( ) . nullAnnotationIsRedundant ( sourceMethod , - <NUM_LIT:1> ) ; } } public MethodBinding findOriginalInheritedMethod ( MethodBinding inheritedMethod ) { MethodBinding inheritedOriginal = inheritedMethod . original ( ) ; TypeBinding superType = this . declaringClass . findSuperTypeOriginatingFrom ( inheritedOriginal . declaringClass ) ; if ( superType == null || ! ( superType instanceof ReferenceBinding ) ) return null ; if ( inheritedOriginal . declaringClass != superType ) { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( inheritedOriginal . selector , inheritedOriginal . parameters . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) if ( superMethods [ m ] . original ( ) == inheritedOriginal ) return superMethods [ m ] ; } return inheritedOriginal ; } public char [ ] genericSignature ( ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) return null ; StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) { sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . typeVariables . length ; i < length ; i ++ ) { sig . append ( this . typeVariables [ i ] . genericSignature ( ) ) ; } sig . append ( '<CHAR_LIT:>>' ) ; } sig . append ( '<CHAR_LIT:(>' ) ; for ( int i = <NUM_LIT:0> , length = this . parameters . length ; i < length ; i ++ ) { sig . append ( this . parameters [ i ] . genericTypeSignature ( ) ) ; } sig . append ( '<CHAR_LIT:)>' ) ; if ( this . returnType != null ) sig . append ( this . returnType . genericTypeSignature ( ) ) ; boolean needExceptionSignatures = false ; int length = this . thrownExceptions . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ( this . thrownExceptions [ i ] . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { needExceptionSignatures = true ; break ; } } if ( needExceptionSignatures ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { sig . append ( '<CHAR_LIT>' ) ; sig . append ( this . thrownExceptions [ i ] . genericTypeSignature ( ) ) ; } } int sigLength = sig . length ( ) ; char [ ] genericSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , genericSignature , <NUM_LIT:0> ) ; return genericSignature ; } public final int getAccessFlags ( ) { return this . modifiers & ExtraCompilerModifiers . AccJustFlag ; } public AnnotationBinding [ ] getAnnotations ( ) { MethodBinding originalMethod = original ( ) ; return originalMethod . declaringClass . retrieveAnnotations ( originalMethod ) ; } public long getAnnotationTagBits ( ) { MethodBinding originalMethod = original ( ) ; if ( ( originalMethod . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> && originalMethod . declaringClass instanceof SourceTypeBinding ) { ClassScope scope = ( ( SourceTypeBinding ) originalMethod . declaringClass ) . scope ; if ( scope != null ) { TypeDeclaration typeDecl = scope . referenceContext ; AbstractMethodDeclaration methodDecl = typeDecl . declarationOf ( originalMethod ) ; if ( methodDecl != null ) ASTNode . resolveAnnotations ( methodDecl . scope , methodDecl . annotations , originalMethod ) ; long nullDefaultBits = this . tagBits & ( TagBits . AnnotationNonNullByDefault | TagBits . AnnotationNullUnspecifiedByDefault ) ; if ( nullDefaultBits != <NUM_LIT:0> && this . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) this . declaringClass ; if ( declaringSourceType . checkRedundantNullnessDefaultOne ( methodDecl , methodDecl . annotations , nullDefaultBits ) ) { declaringSourceType . checkRedundantNullnessDefaultRecurse ( methodDecl , methodDecl . annotations , nullDefaultBits ) ; } } } } return originalMethod . tagBits ; } public Object getDefaultValue ( ) { MethodBinding originalMethod = original ( ) ; if ( ( originalMethod . tagBits & TagBits . DefaultValueResolved ) == <NUM_LIT:0> ) { if ( originalMethod . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding sourceType = ( SourceTypeBinding ) originalMethod . declaringClass ; if ( sourceType . scope != null ) { AbstractMethodDeclaration methodDeclaration = originalMethod . sourceMethod ( ) ; if ( methodDeclaration != null && methodDeclaration . isAnnotationMethod ( ) ) { methodDeclaration . resolve ( sourceType . scope ) ; } } } originalMethod . tagBits |= TagBits . DefaultValueResolved ; } AnnotationHolder holder = originalMethod . declaringClass . retrieveAnnotationHolder ( originalMethod , true ) ; return holder == null ? null : holder . getDefaultValue ( ) ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { int length ; if ( ( length = this . parameters . length ) == <NUM_LIT:0> ) { return null ; } MethodBinding originalMethod = original ( ) ; AnnotationHolder holder = originalMethod . declaringClass . retrieveAnnotationHolder ( originalMethod , true ) ; AnnotationBinding [ ] [ ] allParameterAnnotations = holder == null ? null : holder . getParameterAnnotations ( ) ; if ( allParameterAnnotations == null && ( this . tagBits & TagBits . HasParameterAnnotations ) != <NUM_LIT:0> ) { allParameterAnnotations = new AnnotationBinding [ length ] [ ] ; if ( this . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding sourceType = ( SourceTypeBinding ) this . declaringClass ; if ( sourceType . scope != null ) { AbstractMethodDeclaration methodDecl = sourceType . scope . referenceType ( ) . declarationOf ( this ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Argument argument = methodDecl . arguments [ i ] ; if ( argument . annotations != null ) { ASTNode . resolveAnnotations ( methodDecl . scope , argument . annotations , argument . binding ) ; allParameterAnnotations [ i ] = argument . binding . getAnnotations ( ) ; } else { allParameterAnnotations [ i ] = Binding . NO_ANNOTATIONS ; } } } else { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { allParameterAnnotations [ i ] = Binding . NO_ANNOTATIONS ; } } } else { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { allParameterAnnotations [ i ] = Binding . NO_ANNOTATIONS ; } } setParameterAnnotations ( allParameterAnnotations ) ; } return allParameterAnnotations ; } public TypeVariableBinding getTypeVariable ( char [ ] variableName ) { for ( int i = this . typeVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( this . typeVariables [ i ] . sourceName , variableName ) ) return this . typeVariables [ i ] ; return null ; } public boolean hasSubstitutedParameters ( ) { return false ; } public boolean hasSubstitutedReturnType ( ) { return false ; } public final boolean isAbstract ( ) { return ( this . modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ; } public final boolean isBridge ( ) { return ( this . modifiers & ClassFileConstants . AccBridge ) != <NUM_LIT:0> ; } public final boolean isConstructor ( ) { return this . selector == TypeConstants . INIT ; } public final boolean isDefault ( ) { return ! isPublic ( ) && ! isProtected ( ) && ! isPrivate ( ) ; } public final boolean isDefaultAbstract ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccDefaultAbstract ) != <NUM_LIT:0> ; } public final boolean isDeprecated ( ) { return ( this . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ; } public final boolean isFinal ( ) { return ( this . modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ; } public final boolean isImplementing ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccImplementing ) != <NUM_LIT:0> ; } public final boolean isMain ( ) { if ( this . selector . length == <NUM_LIT:4> && CharOperation . equals ( this . selector , TypeConstants . MAIN ) && ( ( this . modifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccStatic ) ) != <NUM_LIT:0> ) && TypeBinding . VOID == this . returnType && this . parameters . length == <NUM_LIT:1> ) { TypeBinding paramType = this . parameters [ <NUM_LIT:0> ] ; if ( paramType . dimensions ( ) == <NUM_LIT:1> && paramType . leafComponentType ( ) . id == TypeIds . T_JavaLangString ) { return true ; } } return false ; } public final boolean isNative ( ) { return ( this . modifiers & ClassFileConstants . AccNative ) != <NUM_LIT:0> ; } public final boolean isOverriding ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccOverriding ) != <NUM_LIT:0> ; } public final boolean isPrivate ( ) { return ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ; } public final boolean isOrEnclosedByPrivateType ( ) { if ( ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) return true ; return this . declaringClass != null && this . declaringClass . isOrEnclosedByPrivateType ( ) ; } public final boolean isProtected ( ) { return ( this . modifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ; } public final boolean isPublic ( ) { return ( this . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ; } public final boolean isStatic ( ) { return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public final boolean isStrictfp ( ) { return ( this . modifiers & ClassFileConstants . AccStrictfp ) != <NUM_LIT:0> ; } public final boolean isSynchronized ( ) { return ( this . modifiers & ClassFileConstants . AccSynchronized ) != <NUM_LIT:0> ; } public final boolean isSynthetic ( ) { return ( this . modifiers & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } public final boolean isUsed ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) != <NUM_LIT:0> ; } public boolean isVarargs ( ) { return ( this . modifiers & ClassFileConstants . AccVarargs ) != <NUM_LIT:0> ; } public boolean isPolymorphic ( ) { return false ; } public final boolean isViewedAsDeprecated ( ) { return ( this . modifiers & ( ClassFileConstants . AccDeprecated | ExtraCompilerModifiers . AccDeprecatedImplicitly ) ) != <NUM_LIT:0> ; } public final int kind ( ) { return Binding . METHOD ; } public MethodBinding original ( ) { return this ; } public char [ ] readableName ( ) { StringBuffer buffer = new StringBuffer ( this . parameters . length + <NUM_LIT:1> * <NUM_LIT:20> ) ; if ( isConstructor ( ) ) buffer . append ( this . declaringClass . sourceName ( ) ) ; else buffer . append ( this . selector ) ; buffer . append ( '<CHAR_LIT:(>' ) ; if ( this . parameters != Binding . NO_PARAMETERS ) { for ( int i = <NUM_LIT:0> , length = this . parameters . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( this . parameters [ i ] . sourceName ( ) ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; return buffer . toString ( ) . toCharArray ( ) ; } public void setAnnotations ( AnnotationBinding [ ] annotations ) { this . declaringClass . storeAnnotations ( this , annotations ) ; } public void setAnnotations ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { this . declaringClass . storeAnnotationHolder ( this , AnnotationHolder . storeAnnotations ( annotations , parameterAnnotations , defaultValue , optionalEnv ) ) ; } public void setDefaultValue ( Object defaultValue ) { MethodBinding originalMethod = original ( ) ; originalMethod . tagBits |= TagBits . DefaultValueResolved ; AnnotationHolder holder = this . declaringClass . retrieveAnnotationHolder ( this , false ) ; if ( holder == null ) setAnnotations ( null , null , defaultValue , null ) ; else setAnnotations ( holder . getAnnotations ( ) , holder . getParameterAnnotations ( ) , defaultValue , null ) ; } public void setParameterAnnotations ( AnnotationBinding [ ] [ ] parameterAnnotations ) { AnnotationHolder holder = this . declaringClass . retrieveAnnotationHolder ( this , false ) ; if ( holder == null ) setAnnotations ( null , parameterAnnotations , null , null ) ; else setAnnotations ( holder . getAnnotations ( ) , parameterAnnotations , holder . getDefaultValue ( ) , null ) ; } protected final void setSelector ( char [ ] selector ) { this . selector = selector ; this . signature = null ; } public char [ ] shortReadableName ( ) { StringBuffer buffer = new StringBuffer ( this . parameters . length + <NUM_LIT:1> * <NUM_LIT:20> ) ; if ( isConstructor ( ) ) buffer . append ( this . declaringClass . shortReadableName ( ) ) ; else buffer . append ( this . selector ) ; buffer . append ( '<CHAR_LIT:(>' ) ; if ( this . parameters != Binding . NO_PARAMETERS ) { for ( int i = <NUM_LIT:0> , length = this . parameters . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( this . parameters [ i ] . shortReadableName ( ) ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; int nameLength = buffer . length ( ) ; char [ ] shortReadableName = new char [ nameLength ] ; buffer . getChars ( <NUM_LIT:0> , nameLength , shortReadableName , <NUM_LIT:0> ) ; return shortReadableName ; } public final char [ ] signature ( ) { if ( this . signature != null ) return this . signature ; StringBuffer buffer = new StringBuffer ( this . parameters . length + <NUM_LIT:1> * <NUM_LIT:20> ) ; buffer . append ( '<CHAR_LIT:(>' ) ; TypeBinding [ ] targetParameters = this . parameters ; boolean isConstructor = isConstructor ( ) ; if ( isConstructor && this . declaringClass . isEnum ( ) ) { buffer . append ( ConstantPool . JavaLangStringSignature ) ; buffer . append ( TypeBinding . INT . signature ( ) ) ; } boolean needSynthetics = isConstructor && this . declaringClass . isNestedType ( ) ; if ( needSynthetics ) { ReferenceBinding [ ] syntheticArgumentTypes = this . declaringClass . syntheticEnclosingInstanceTypes ( ) ; if ( syntheticArgumentTypes != null ) { for ( int i = <NUM_LIT:0> , count = syntheticArgumentTypes . length ; i < count ; i ++ ) { buffer . append ( syntheticArgumentTypes [ i ] . signature ( ) ) ; } } if ( this instanceof SyntheticMethodBinding ) { targetParameters = ( ( SyntheticMethodBinding ) this ) . targetMethod . parameters ; } } if ( targetParameters != Binding . NO_PARAMETERS ) { for ( int i = <NUM_LIT:0> ; i < targetParameters . length ; i ++ ) { buffer . append ( targetParameters [ i ] . signature ( ) ) ; } } if ( needSynthetics ) { SyntheticArgumentBinding [ ] syntheticOuterArguments = this . declaringClass . syntheticOuterLocalVariables ( ) ; int count = syntheticOuterArguments == null ? <NUM_LIT:0> : syntheticOuterArguments . length ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { buffer . append ( syntheticOuterArguments [ i ] . type . signature ( ) ) ; } for ( int i = targetParameters . length , extraLength = this . parameters . length ; i < extraLength ; i ++ ) { buffer . append ( this . parameters [ i ] . signature ( ) ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; if ( this . returnType != null ) buffer . append ( this . returnType . signature ( ) ) ; int nameLength = buffer . length ( ) ; this . signature = new char [ nameLength ] ; buffer . getChars ( <NUM_LIT:0> , nameLength , this . signature , <NUM_LIT:0> ) ; return this . signature ; } public final char [ ] signature ( ClassFile classFile ) { if ( this . signature != null ) { if ( ( this . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { boolean isConstructor = isConstructor ( ) ; TypeBinding [ ] targetParameters = this . parameters ; boolean needSynthetics = isConstructor && this . declaringClass . isNestedType ( ) ; if ( needSynthetics ) { ReferenceBinding [ ] syntheticArgumentTypes = this . declaringClass . syntheticEnclosingInstanceTypes ( ) ; if ( syntheticArgumentTypes != null ) { for ( int i = <NUM_LIT:0> , count = syntheticArgumentTypes . length ; i < count ; i ++ ) { ReferenceBinding syntheticArgumentType = syntheticArgumentTypes [ i ] ; if ( ( syntheticArgumentType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( classFile , syntheticArgumentType ) ; } } } if ( this instanceof SyntheticMethodBinding ) { targetParameters = ( ( SyntheticMethodBinding ) this ) . targetMethod . parameters ; } } if ( targetParameters != Binding . NO_PARAMETERS ) { for ( int i = <NUM_LIT:0> , max = targetParameters . length ; i < max ; i ++ ) { TypeBinding targetParameter = targetParameters [ i ] ; TypeBinding leafTargetParameterType = targetParameter . leafComponentType ( ) ; if ( ( leafTargetParameterType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( classFile , leafTargetParameterType ) ; } } } if ( needSynthetics ) { for ( int i = targetParameters . length , extraLength = this . parameters . length ; i < extraLength ; i ++ ) { TypeBinding parameter = this . parameters [ i ] ; TypeBinding leafParameterType = parameter . leafComponentType ( ) ; if ( ( leafParameterType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( classFile , leafParameterType ) ; } } } if ( this . returnType != null ) { TypeBinding ret = this . returnType . leafComponentType ( ) ; if ( ( ret . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( classFile , ret ) ; } } } return this . signature ; } StringBuffer buffer = new StringBuffer ( ( this . parameters . length + <NUM_LIT:1> ) * <NUM_LIT:20> ) ; buffer . append ( '<CHAR_LIT:(>' ) ; TypeBinding [ ] targetParameters = this . parameters ; boolean isConstructor = isConstructor ( ) ; if ( isConstructor && this . declaringClass . isEnum ( ) ) { buffer . append ( ConstantPool . JavaLangStringSignature ) ; buffer . append ( TypeBinding . INT . signature ( ) ) ; } boolean needSynthetics = isConstructor && this . declaringClass . isNestedType ( ) ; if ( needSynthetics ) { ReferenceBinding [ ] syntheticArgumentTypes = this . declaringClass . syntheticEnclosingInstanceTypes ( ) ; if ( syntheticArgumentTypes != null ) { for ( int i = <NUM_LIT:0> , count = syntheticArgumentTypes . length ; i < count ; i ++ ) { ReferenceBinding syntheticArgumentType = syntheticArgumentTypes [ i ] ; if ( ( syntheticArgumentType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . ContainsNestedTypeReferences ; Util . recordNestedType ( classFile , syntheticArgumentType ) ; } buffer . append ( syntheticArgumentType . signature ( ) ) ; } } if ( this instanceof SyntheticMethodBinding ) { targetParameters = ( ( SyntheticMethodBinding ) this ) . targetMethod . parameters ; } } if ( targetParameters != Binding . NO_PARAMETERS ) { for ( int i = <NUM_LIT:0> , max = targetParameters . length ; i < max ; i ++ ) { TypeBinding targetParameter = targetParameters [ i ] ; TypeBinding leafTargetParameterType = targetParameter . leafComponentType ( ) ; if ( ( leafTargetParameterType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . ContainsNestedTypeReferences ; Util . recordNestedType ( classFile , leafTargetParameterType ) ; } buffer . append ( targetParameter . signature ( ) ) ; } } if ( needSynthetics ) { SyntheticArgumentBinding [ ] syntheticOuterArguments = this . declaringClass . syntheticOuterLocalVariables ( ) ; int count = syntheticOuterArguments == null ? <NUM_LIT:0> : syntheticOuterArguments . length ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { buffer . append ( syntheticOuterArguments [ i ] . type . signature ( ) ) ; } for ( int i = targetParameters . length , extraLength = this . parameters . length ; i < extraLength ; i ++ ) { TypeBinding parameter = this . parameters [ i ] ; TypeBinding leafParameterType = parameter . leafComponentType ( ) ; if ( ( leafParameterType . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . ContainsNestedTypeReferences ; Util . recordNestedType ( classFile , leafParameterType ) ; } buffer . append ( parameter . signature ( ) ) ; } } buffer . append ( '<CHAR_LIT:)>' ) ; if ( this . returnType != null ) { TypeBinding ret = this . returnType . leafComponentType ( ) ; if ( ( ret . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . ContainsNestedTypeReferences ; Util . recordNestedType ( classFile , ret ) ; } buffer . append ( this . returnType . signature ( ) ) ; } int nameLength = buffer . length ( ) ; this . signature = new char [ nameLength ] ; buffer . getChars ( <NUM_LIT:0> , nameLength , this . signature , <NUM_LIT:0> ) ; return this . signature ; } public final int sourceEnd ( ) { AbstractMethodDeclaration method = sourceMethod ( ) ; if ( method == null ) { if ( this . declaringClass instanceof SourceTypeBinding ) return ( ( SourceTypeBinding ) this . declaringClass ) . sourceEnd ( ) ; return <NUM_LIT:0> ; } return method . sourceEnd ; } public AbstractMethodDeclaration sourceMethod ( ) { if ( isSynthetic ( ) ) { return null ; } SourceTypeBinding sourceType ; try { sourceType = ( SourceTypeBinding ) this . declaringClass ; } catch ( ClassCastException e ) { return null ; } AbstractMethodDeclaration [ ] methods = sourceType . scope . referenceContext . methods ; if ( methods != null ) { for ( int i = methods . length ; -- i >= <NUM_LIT:0> ; ) if ( this == methods [ i ] . binding ) return methods [ i ] ; } return null ; } public final int sourceStart ( ) { AbstractMethodDeclaration method = sourceMethod ( ) ; if ( method == null ) { if ( this . declaringClass instanceof SourceTypeBinding ) return ( ( SourceTypeBinding ) this . declaringClass ) . sourceStart ( ) ; return <NUM_LIT:0> ; } return method . sourceStart ; } public MethodBinding tiebreakMethod ( ) { return this ; } public String toString ( ) { StringBuffer output = new StringBuffer ( <NUM_LIT:10> ) ; if ( ( this . modifiers & ExtraCompilerModifiers . AccUnresolved ) != <NUM_LIT:0> ) { output . append ( "<STR_LIT>" ) ; } ASTNode . printModifiers ( this . modifiers , output ) ; output . append ( this . returnType != null ? this . returnType . debugName ( ) : "<STR_LIT>" ) ; output . append ( "<STR_LIT:U+0020>" ) ; output . append ( this . selector != null ? new String ( this . selector ) : "<STR_LIT>" ) ; output . append ( "<STR_LIT:(>" ) ; if ( this . parameters != null ) { if ( this . parameters != Binding . NO_PARAMETERS ) { for ( int i = <NUM_LIT:0> , length = this . parameters . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; output . append ( this . parameters [ i ] != null ? this . parameters [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { output . append ( "<STR_LIT>" ) ; } output . append ( "<STR_LIT>" ) ; if ( this . thrownExceptions != null ) { if ( this . thrownExceptions != Binding . NO_EXCEPTIONS ) { output . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . thrownExceptions . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; output . append ( ( this . thrownExceptions [ i ] != null ) ? this . thrownExceptions [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { output . append ( "<STR_LIT>" ) ; } return output . toString ( ) ; } public TypeVariableBinding [ ] typeVariables ( ) { return this . typeVariables ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . util . HashtableOfPackage ; import org . eclipse . jdt . internal . compiler . util . HashtableOfType ; public class PackageBinding extends Binding implements TypeConstants { public long tagBits = <NUM_LIT:0> ; public char [ ] [ ] compoundName ; PackageBinding parent ; public LookupEnvironment environment ; HashtableOfType knownTypes ; HashtableOfPackage knownPackages ; protected int defaultNullness = NO_NULL_DEFAULT ; protected PackageBinding ( ) { } public PackageBinding ( char [ ] topLevelPackageName , LookupEnvironment environment ) { this ( new char [ ] [ ] { topLevelPackageName } , null , environment ) ; } public PackageBinding ( char [ ] [ ] compoundName , PackageBinding parent , LookupEnvironment environment ) { this . compoundName = compoundName ; this . parent = parent ; this . environment = environment ; this . knownTypes = null ; this . knownPackages = new HashtableOfPackage ( <NUM_LIT:3> ) ; if ( compoundName != CharOperation . NO_CHAR_CHAR ) checkIfNullAnnotationPackage ( ) ; } public PackageBinding ( LookupEnvironment environment ) { this ( CharOperation . NO_CHAR_CHAR , null , environment ) ; } private void addNotFoundPackage ( char [ ] simpleName ) { this . knownPackages . put ( simpleName , LookupEnvironment . TheNotFoundPackage ) ; } private void addNotFoundType ( char [ ] simpleName ) { if ( this . knownTypes == null ) this . knownTypes = new HashtableOfType ( <NUM_LIT> ) ; this . knownTypes . put ( simpleName , LookupEnvironment . TheNotFoundType ) ; } void addPackage ( PackageBinding element ) { if ( ( element . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) clearMissingTagBit ( ) ; this . knownPackages . put ( element . compoundName [ element . compoundName . length - <NUM_LIT:1> ] , element ) ; } void addType ( ReferenceBinding element ) { if ( ( element . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) clearMissingTagBit ( ) ; if ( this . knownTypes == null ) this . knownTypes = new HashtableOfType ( <NUM_LIT> ) ; this . knownTypes . put ( element . compoundName [ element . compoundName . length - <NUM_LIT:1> ] , element ) ; if ( this . environment . globalOptions . isAnnotationBasedNullAnalysisEnabled ) if ( element . isAnnotationType ( ) || element instanceof UnresolvedReferenceBinding ) checkIfNullAnnotationType ( element ) ; } void clearMissingTagBit ( ) { PackageBinding current = this ; do { current . tagBits &= ~ TagBits . HasMissingType ; } while ( ( current = current . parent ) != null ) ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:/>' ) ; } private PackageBinding findPackage ( char [ ] name ) { if ( ! this . environment . isPackage ( this . compoundName , name ) ) return null ; char [ ] [ ] subPkgCompoundName = CharOperation . arrayConcat ( this . compoundName , name ) ; PackageBinding subPackageBinding = new PackageBinding ( subPkgCompoundName , this , this . environment ) ; addPackage ( subPackageBinding ) ; return subPackageBinding ; } PackageBinding getPackage ( char [ ] name ) { PackageBinding binding = getPackage0 ( name ) ; if ( binding != null ) { if ( binding == LookupEnvironment . TheNotFoundPackage ) return null ; else return binding ; } if ( ( binding = findPackage ( name ) ) != null ) return binding ; addNotFoundPackage ( name ) ; return null ; } PackageBinding getPackage0 ( char [ ] name ) { return this . knownPackages . get ( name ) ; } ReferenceBinding getType ( char [ ] name ) { ReferenceBinding referenceBinding = getType0 ( name ) ; if ( referenceBinding == null ) { if ( ( referenceBinding = this . environment . askForType ( this , name ) ) == null ) { addNotFoundType ( name ) ; return null ; } } if ( referenceBinding == LookupEnvironment . TheNotFoundType ) return null ; referenceBinding = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( referenceBinding , this . environment , false ) ; if ( referenceBinding . isNestedType ( ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , referenceBinding , ProblemReasons . InternalNameProvided ) ; return referenceBinding ; } ReferenceBinding getType0 ( char [ ] name ) { if ( this . knownTypes == null ) return null ; return this . knownTypes . get ( name ) ; } public Binding getTypeOrPackage ( char [ ] name ) { ReferenceBinding referenceBinding = getType0 ( name ) ; if ( referenceBinding != null && referenceBinding != LookupEnvironment . TheNotFoundType ) { referenceBinding = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( referenceBinding , this . environment , false ) ; if ( referenceBinding . isNestedType ( ) ) { return new ProblemReferenceBinding ( new char [ ] [ ] { name } , referenceBinding , ProblemReasons . InternalNameProvided ) ; } if ( ( referenceBinding . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { return referenceBinding ; } } PackageBinding packageBinding = getPackage0 ( name ) ; if ( packageBinding != null && packageBinding != LookupEnvironment . TheNotFoundPackage ) { return packageBinding ; } if ( referenceBinding == null ) { if ( ( referenceBinding = this . environment . askForType ( this , name ) ) != null ) { if ( referenceBinding . isNestedType ( ) ) { return new ProblemReferenceBinding ( new char [ ] [ ] { name } , referenceBinding , ProblemReasons . InternalNameProvided ) ; } return referenceBinding ; } addNotFoundType ( name ) ; } if ( packageBinding == null ) { if ( ( packageBinding = findPackage ( name ) ) != null ) { return packageBinding ; } if ( referenceBinding != null && referenceBinding != LookupEnvironment . TheNotFoundType ) { return referenceBinding ; } addNotFoundPackage ( name ) ; } return null ; } public final boolean isViewedAsDeprecated ( ) { if ( ( this . tagBits & TagBits . DeprecatedAnnotationResolved ) == <NUM_LIT:0> ) { this . tagBits |= TagBits . DeprecatedAnnotationResolved ; if ( this . compoundName != CharOperation . NO_CHAR_CHAR ) { ReferenceBinding packageInfo = this . getType ( TypeConstants . PACKAGE_INFO_NAME ) ; if ( packageInfo != null ) { packageInfo . initializeDeprecatedAnnotationTagBits ( ) ; this . tagBits |= packageInfo . tagBits & TagBits . AllStandardAnnotationsMask ; } } } return ( this . tagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ; } public final int kind ( ) { return Binding . PACKAGE ; } public int problemId ( ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) return ProblemReasons . NotFound ; return ProblemReasons . NoError ; } void checkIfNullAnnotationPackage ( ) { LookupEnvironment env = this . environment ; if ( env . globalOptions . isAnnotationBasedNullAnalysisEnabled ) { if ( isPackageOfQualifiedTypeName ( this . compoundName , env . getNullableAnnotationName ( ) ) ) env . nullableAnnotationPackage = this ; if ( isPackageOfQualifiedTypeName ( this . compoundName , env . getNonNullAnnotationName ( ) ) ) env . nonnullAnnotationPackage = this ; if ( isPackageOfQualifiedTypeName ( this . compoundName , env . getNonNullByDefaultAnnotationName ( ) ) ) env . nonnullByDefaultAnnotationPackage = this ; } } private boolean isPackageOfQualifiedTypeName ( char [ ] [ ] packageName , char [ ] [ ] typeName ) { int length ; if ( typeName == null || ( length = packageName . length ) != typeName . length - <NUM_LIT:1> ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! CharOperation . equals ( packageName [ i ] , typeName [ i ] ) ) return false ; return true ; } void checkIfNullAnnotationType ( ReferenceBinding type ) { if ( this . environment . nullableAnnotationPackage == this && CharOperation . equals ( type . compoundName , this . environment . getNullableAnnotationName ( ) ) ) { type . id = TypeIds . T_ConfiguredAnnotationNullable ; if ( ! ( type instanceof UnresolvedReferenceBinding ) ) this . environment . nullableAnnotationPackage = null ; } else if ( this . environment . nonnullAnnotationPackage == this && CharOperation . equals ( type . compoundName , this . environment . getNonNullAnnotationName ( ) ) ) { type . id = TypeIds . T_ConfiguredAnnotationNonNull ; if ( ! ( type instanceof UnresolvedReferenceBinding ) ) this . environment . nonnullAnnotationPackage = null ; } else if ( this . environment . nonnullByDefaultAnnotationPackage == this && CharOperation . equals ( type . compoundName , this . environment . getNonNullByDefaultAnnotationName ( ) ) ) { type . id = TypeIds . T_ConfiguredAnnotationNonNullByDefault ; if ( ! ( type instanceof UnresolvedReferenceBinding ) ) this . environment . nonnullByDefaultAnnotationPackage = null ; } } public char [ ] readableName ( ) { return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } public String toString ( ) { String str ; if ( this . compoundName == CharOperation . NO_CHAR_CHAR ) { str = "<STR_LIT>" ; } else { str = "<STR_LIT>" + ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; } if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { str += "<STR_LIT>" ; } return str ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . BooleanConstant ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . compiler . util . Util ; public class BinaryTypeBinding extends ReferenceBinding { protected ReferenceBinding superclass ; protected ReferenceBinding enclosingType ; protected ReferenceBinding [ ] superInterfaces ; protected FieldBinding [ ] fields ; protected MethodBinding [ ] methods ; private boolean infraMethodsComplete = false ; protected MethodBinding [ ] infraMethods = Binding . NO_METHODS ; protected ReferenceBinding [ ] memberTypes ; protected TypeVariableBinding [ ] typeVariables ; protected LookupEnvironment environment ; protected SimpleLookupTable storedAnnotations = null ; static Object convertMemberValue ( Object binaryValue , LookupEnvironment env , char [ ] [ ] [ ] missingTypeNames ) { if ( binaryValue == null ) return null ; if ( binaryValue instanceof Constant ) return binaryValue ; if ( binaryValue instanceof ClassSignature ) return env . getTypeFromSignature ( ( ( ClassSignature ) binaryValue ) . getTypeName ( ) , <NUM_LIT:0> , - <NUM_LIT:1> , false , null , missingTypeNames ) ; if ( binaryValue instanceof IBinaryAnnotation ) return createAnnotation ( ( IBinaryAnnotation ) binaryValue , env , missingTypeNames ) ; if ( binaryValue instanceof EnumConstantSignature ) { EnumConstantSignature ref = ( EnumConstantSignature ) binaryValue ; ReferenceBinding enumType = ( ReferenceBinding ) env . getTypeFromSignature ( ref . getTypeName ( ) , <NUM_LIT:0> , - <NUM_LIT:1> , false , null , missingTypeNames ) ; enumType = ( ReferenceBinding ) resolveType ( enumType , env , false ) ; return enumType . getField ( ref . getEnumConstantName ( ) , false ) ; } if ( binaryValue instanceof Object [ ] ) { Object [ ] objects = ( Object [ ] ) binaryValue ; int length = objects . length ; if ( length == <NUM_LIT:0> ) return objects ; Object [ ] values = new Object [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) values [ i ] = convertMemberValue ( objects [ i ] , env , missingTypeNames ) ; return values ; } throw new IllegalStateException ( ) ; } static AnnotationBinding createAnnotation ( IBinaryAnnotation annotationInfo , LookupEnvironment env , char [ ] [ ] [ ] missingTypeNames ) { IBinaryElementValuePair [ ] binaryPairs = annotationInfo . getElementValuePairs ( ) ; int length = binaryPairs == null ? <NUM_LIT:0> : binaryPairs . length ; ElementValuePair [ ] pairs = length == <NUM_LIT:0> ? Binding . NO_ELEMENT_VALUE_PAIRS : new ElementValuePair [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) pairs [ i ] = new ElementValuePair ( binaryPairs [ i ] . getName ( ) , convertMemberValue ( binaryPairs [ i ] . getValue ( ) , env , missingTypeNames ) , null ) ; char [ ] typeName = annotationInfo . getTypeName ( ) ; ReferenceBinding annotationType = env . getTypeFromConstantPoolName ( typeName , <NUM_LIT:1> , typeName . length - <NUM_LIT:1> , false , missingTypeNames ) ; return new UnresolvedAnnotationBinding ( annotationType , pairs , env ) ; } public static AnnotationBinding [ ] createAnnotations ( IBinaryAnnotation [ ] annotationInfos , LookupEnvironment env , char [ ] [ ] [ ] missingTypeNames ) { int length = annotationInfos == null ? <NUM_LIT:0> : annotationInfos . length ; AnnotationBinding [ ] result = length == <NUM_LIT:0> ? Binding . NO_ANNOTATIONS : new AnnotationBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) result [ i ] = createAnnotation ( annotationInfos [ i ] , env , missingTypeNames ) ; return result ; } public static TypeBinding resolveType ( TypeBinding type , LookupEnvironment environment , boolean convertGenericToRawType ) { switch ( type . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ( ( ParameterizedTypeBinding ) type ) . resolve ( ) ; break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) type ) . resolve ( ) ; case Binding . ARRAY_TYPE : resolveType ( ( ( ArrayBinding ) type ) . leafComponentType , environment , convertGenericToRawType ) ; break ; case Binding . TYPE_PARAMETER : ( ( TypeVariableBinding ) type ) . resolve ( ) ; break ; case Binding . GENERIC_TYPE : if ( convertGenericToRawType ) return environment . convertUnresolvedBinaryToRawType ( type ) ; break ; default : if ( type instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) type ) . resolve ( environment , convertGenericToRawType ) ; if ( convertGenericToRawType ) return environment . convertUnresolvedBinaryToRawType ( type ) ; break ; } return type ; } protected BinaryTypeBinding ( ) { } public BinaryTypeBinding ( PackageBinding packageBinding , IBinaryType binaryType , LookupEnvironment environment ) { this . compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , binaryType . getName ( ) ) ; computeId ( ) ; this . tagBits |= TagBits . IsBinaryBinding ; this . environment = environment ; this . fPackage = packageBinding ; this . fileName = binaryType . getFileName ( ) ; char [ ] typeSignature = binaryType . getGenericSignature ( ) ; this . typeVariables = typeSignature != null && typeSignature . length > <NUM_LIT:0> && typeSignature [ <NUM_LIT:0> ] == Util . C_GENERIC_START ? null : Binding . NO_TYPE_VARIABLES ; this . sourceName = binaryType . getSourceName ( ) ; this . modifiers = binaryType . getModifiers ( ) ; if ( ( binaryType . getTagBits ( ) & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) this . tagBits |= TagBits . HierarchyHasProblems ; if ( binaryType . isAnonymous ( ) ) { this . tagBits |= TagBits . AnonymousTypeMask ; } else if ( binaryType . isLocal ( ) ) { this . tagBits |= TagBits . LocalTypeMask ; } else if ( binaryType . isMember ( ) ) { this . tagBits |= TagBits . MemberTypeMask ; } char [ ] enclosingTypeName = binaryType . getEnclosingTypeName ( ) ; if ( enclosingTypeName != null ) { this . enclosingType = environment . getTypeFromConstantPoolName ( enclosingTypeName , <NUM_LIT:0> , - <NUM_LIT:1> , true , null ) ; this . tagBits |= TagBits . MemberTypeMask ; this . tagBits |= TagBits . HasUnresolvedEnclosingType ; if ( enclosingType ( ) . isStrictfp ( ) ) this . modifiers |= ClassFileConstants . AccStrictfp ; if ( enclosingType ( ) . isDeprecated ( ) ) this . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } public FieldBinding [ ] availableFields ( ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return this . fields ; if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } FieldBinding [ ] availableFields = new FieldBinding [ this . fields . length ] ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . fields . length ; i ++ ) { try { availableFields [ count ] = resolveTypeFor ( this . fields [ i ] ) ; count ++ ; } catch ( AbortCompilation a ) { } } if ( count < availableFields . length ) System . arraycopy ( availableFields , <NUM_LIT:0> , availableFields = new FieldBinding [ count ] , <NUM_LIT:0> , count ) ; return availableFields ; } private TypeVariableBinding [ ] addMethodTypeVariables ( TypeVariableBinding [ ] methodTypeVars ) { if ( this . typeVariables == null || this . typeVariables == Binding . NO_TYPE_VARIABLES ) { return methodTypeVars ; } if ( methodTypeVars == null || methodTypeVars == Binding . NO_TYPE_VARIABLES ) { return this . typeVariables ; } int total = this . typeVariables . length + methodTypeVars . length ; TypeVariableBinding [ ] combinedTypeVars = new TypeVariableBinding [ total ] ; System . arraycopy ( this . typeVariables , <NUM_LIT:0> , combinedTypeVars , <NUM_LIT:0> , this . typeVariables . length ) ; int size = this . typeVariables . length ; loop : for ( int i = <NUM_LIT:0> , len = methodTypeVars . length ; i < len ; i ++ ) { for ( int j = this . typeVariables . length - <NUM_LIT:1> ; j >= <NUM_LIT:0> ; j -- ) { if ( CharOperation . equals ( methodTypeVars [ i ] . sourceName , this . typeVariables [ j ] . sourceName ) ) continue loop ; } combinedTypeVars [ size ++ ] = methodTypeVars [ i ] ; } if ( size != total ) { System . arraycopy ( combinedTypeVars , <NUM_LIT:0> , combinedTypeVars = new TypeVariableBinding [ size ] , <NUM_LIT:0> , size ) ; } return combinedTypeVars ; } public MethodBinding [ ] availableMethods ( ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return this . methods ; if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } MethodBinding [ ] availableMethods = new MethodBinding [ this . methods . length ] ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . methods . length ; i ++ ) { try { availableMethods [ count ] = resolveTypesFor ( this . methods [ i ] ) ; count ++ ; } catch ( AbortCompilation a ) { } } if ( count < availableMethods . length ) System . arraycopy ( availableMethods , <NUM_LIT:0> , availableMethods = new MethodBinding [ count ] , <NUM_LIT:0> , count ) ; return availableMethods ; } void cachePartsFrom ( IBinaryType binaryType , boolean needFieldsAndMethods ) { try { this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . memberTypes = Binding . NO_MEMBER_TYPES ; IBinaryNestedType [ ] memberTypeStructures = binaryType . getMemberTypes ( ) ; if ( memberTypeStructures != null ) { int size = memberTypeStructures . length ; if ( size > <NUM_LIT:0> ) { this . memberTypes = new ReferenceBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { this . memberTypes [ i ] = this . environment . getTypeFromConstantPoolName ( memberTypeStructures [ i ] . getName ( ) , <NUM_LIT:0> , - <NUM_LIT:1> , false , null ) ; } this . tagBits |= TagBits . HasUnresolvedMemberTypes ; } } long sourceLevel = this . environment . globalOptions . originalSourceLevel ; char [ ] typeSignature = binaryType . getGenericSignature ( ) ; this . tagBits |= binaryType . getTagBits ( ) ; char [ ] [ ] [ ] missingTypeNames = binaryType . getMissingTypeNames ( ) ; SignatureWrapper wrapper = null ; if ( typeSignature != null ) { wrapper = new SignatureWrapper ( typeSignature ) ; if ( wrapper . signature [ wrapper . start ] == Util . C_GENERIC_START ) { wrapper . start ++ ; this . typeVariables = createTypeVariables ( wrapper , true , missingTypeNames ) ; wrapper . start ++ ; this . tagBits |= TagBits . HasUnresolvedTypeVariables ; this . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } } TypeVariableBinding [ ] typeVars = Binding . NO_TYPE_VARIABLES ; char [ ] methodDescriptor = binaryType . getEnclosingMethod ( ) ; if ( methodDescriptor != null ) { MethodBinding enclosingMethod = findMethod ( methodDescriptor , missingTypeNames ) ; if ( enclosingMethod != null ) { typeVars = enclosingMethod . typeVariables ; this . typeVariables = addMethodTypeVariables ( typeVars ) ; } } if ( typeSignature == null ) { char [ ] superclassName = binaryType . getSuperclassName ( ) ; if ( superclassName != null ) { this . superclass = this . environment . getTypeFromConstantPoolName ( superclassName , <NUM_LIT:0> , - <NUM_LIT:1> , false , missingTypeNames ) ; this . tagBits |= TagBits . HasUnresolvedSuperclass ; } this . superInterfaces = Binding . NO_SUPERINTERFACES ; char [ ] [ ] interfaceNames = binaryType . getInterfaceNames ( ) ; if ( interfaceNames != null ) { int size = interfaceNames . length ; if ( size > <NUM_LIT:0> ) { this . superInterfaces = new ReferenceBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) this . superInterfaces [ i ] = this . environment . getTypeFromConstantPoolName ( interfaceNames [ i ] , <NUM_LIT:0> , - <NUM_LIT:1> , false , missingTypeNames ) ; this . tagBits |= TagBits . HasUnresolvedSuperinterfaces ; } } } else { this . superclass = ( ReferenceBinding ) this . environment . getTypeFromTypeSignature ( wrapper , typeVars , this , missingTypeNames ) ; this . tagBits |= TagBits . HasUnresolvedSuperclass ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; if ( ! wrapper . atEnd ( ) ) { java . util . ArrayList types = new java . util . ArrayList ( <NUM_LIT:2> ) ; do { types . add ( this . environment . getTypeFromTypeSignature ( wrapper , typeVars , this , missingTypeNames ) ) ; } while ( ! wrapper . atEnd ( ) ) ; this . superInterfaces = new ReferenceBinding [ types . size ( ) ] ; types . toArray ( this . superInterfaces ) ; this . tagBits |= TagBits . HasUnresolvedSuperinterfaces ; } } if ( needFieldsAndMethods ) { createFields ( binaryType . getFields ( ) , sourceLevel , missingTypeNames ) ; createMethods ( binaryType . getMethods ( ) , sourceLevel , missingTypeNames ) ; boolean isViewedAsDeprecated = isViewedAsDeprecated ( ) ; if ( isViewedAsDeprecated ) { for ( int i = <NUM_LIT:0> , max = this . fields . length ; i < max ; i ++ ) { FieldBinding field = this . fields [ i ] ; if ( ! field . isDeprecated ( ) ) { field . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } for ( int i = <NUM_LIT:0> , max = this . methods . length ; i < max ; i ++ ) { MethodBinding method = this . methods [ i ] ; if ( ! method . isDeprecated ( ) ) { method . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } } } if ( this . environment . globalOptions . storeAnnotations ) setAnnotations ( createAnnotations ( binaryType . getAnnotations ( ) , this . environment , missingTypeNames ) ) ; } finally { if ( this . fields == null ) this . fields = Binding . NO_FIELDS ; if ( this . methods == null ) this . methods = Binding . NO_METHODS ; } } private void createFields ( IBinaryField [ ] iFields , long sourceLevel , char [ ] [ ] [ ] missingTypeNames ) { this . fields = Binding . NO_FIELDS ; if ( iFields != null ) { int size = iFields . length ; if ( size > <NUM_LIT:0> ) { this . fields = new FieldBinding [ size ] ; boolean use15specifics = sourceLevel >= ClassFileConstants . JDK1_5 ; boolean hasRestrictedAccess = hasRestrictedAccess ( ) ; int firstAnnotatedFieldIndex = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { IBinaryField binaryField = iFields [ i ] ; char [ ] fieldSignature = use15specifics ? binaryField . getGenericSignature ( ) : null ; TypeBinding type = fieldSignature == null ? this . environment . getTypeFromSignature ( binaryField . getTypeName ( ) , <NUM_LIT:0> , - <NUM_LIT:1> , false , this , missingTypeNames ) : this . environment . getTypeFromTypeSignature ( new SignatureWrapper ( fieldSignature ) , Binding . NO_TYPE_VARIABLES , this , missingTypeNames ) ; FieldBinding field = new FieldBinding ( binaryField . getName ( ) , type , binaryField . getModifiers ( ) | ExtraCompilerModifiers . AccUnresolved , this , binaryField . getConstant ( ) ) ; if ( firstAnnotatedFieldIndex < <NUM_LIT:0> && this . environment . globalOptions . storeAnnotations && binaryField . getAnnotations ( ) != null ) { firstAnnotatedFieldIndex = i ; } field . id = i ; if ( use15specifics ) field . tagBits |= binaryField . getTagBits ( ) ; if ( hasRestrictedAccess ) field . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; if ( fieldSignature != null ) field . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; this . fields [ i ] = field ; } if ( firstAnnotatedFieldIndex >= <NUM_LIT:0> ) { for ( int i = firstAnnotatedFieldIndex ; i < size ; i ++ ) { IBinaryField binaryField = iFields [ i ] ; this . fields [ i ] . setAnnotations ( createAnnotations ( binaryField . getAnnotations ( ) , this . environment , missingTypeNames ) ) ; } } } } } private MethodBinding createMethod ( IBinaryMethod method , long sourceLevel , char [ ] [ ] [ ] missingTypeNames ) { int methodModifiers = method . getModifiers ( ) | ExtraCompilerModifiers . AccUnresolved ; if ( sourceLevel < ClassFileConstants . JDK1_5 ) methodModifiers &= ~ ClassFileConstants . AccVarargs ; ReferenceBinding [ ] exceptions = Binding . NO_EXCEPTIONS ; TypeBinding [ ] parameters = Binding . NO_PARAMETERS ; TypeVariableBinding [ ] typeVars = Binding . NO_TYPE_VARIABLES ; AnnotationBinding [ ] [ ] paramAnnotations = null ; TypeBinding returnType = null ; final boolean use15specifics = sourceLevel >= ClassFileConstants . JDK1_5 ; char [ ] methodSignature = method . getGenericSignature ( ) ; if ( methodSignature == null ) { char [ ] methodDescriptor = method . getMethodDescriptor ( ) ; int numOfParams = <NUM_LIT:0> ; char nextChar ; int index = <NUM_LIT:0> ; while ( ( nextChar = methodDescriptor [ ++ index ] ) != Util . C_PARAM_END ) { if ( nextChar != Util . C_ARRAY ) { numOfParams ++ ; if ( nextChar == Util . C_RESOLVED ) while ( ( nextChar = methodDescriptor [ ++ index ] ) != Util . C_NAME_END ) { } } } int startIndex = <NUM_LIT:0> ; if ( method . isConstructor ( ) ) { if ( isMemberType ( ) && ! isStatic ( ) ) { startIndex ++ ; } if ( isEnum ( ) ) { startIndex += <NUM_LIT:2> ; } } int size = numOfParams - startIndex ; if ( size > <NUM_LIT:0> ) { parameters = new TypeBinding [ size ] ; if ( this . environment . globalOptions . storeAnnotations ) paramAnnotations = new AnnotationBinding [ size ] [ ] ; index = <NUM_LIT:1> ; int end = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numOfParams ; i ++ ) { while ( ( nextChar = methodDescriptor [ ++ end ] ) == Util . C_ARRAY ) { } if ( nextChar == Util . C_RESOLVED ) while ( ( nextChar = methodDescriptor [ ++ end ] ) != Util . C_NAME_END ) { } if ( i >= startIndex ) { parameters [ i - startIndex ] = this . environment . getTypeFromSignature ( methodDescriptor , index , end , false , this , missingTypeNames ) ; if ( paramAnnotations != null ) paramAnnotations [ i - startIndex ] = createAnnotations ( method . getParameterAnnotations ( i - startIndex ) , this . environment , missingTypeNames ) ; } index = end + <NUM_LIT:1> ; } } char [ ] [ ] exceptionTypes = method . getExceptionTypeNames ( ) ; if ( exceptionTypes != null ) { size = exceptionTypes . length ; if ( size > <NUM_LIT:0> ) { exceptions = new ReferenceBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) exceptions [ i ] = this . environment . getTypeFromConstantPoolName ( exceptionTypes [ i ] , <NUM_LIT:0> , - <NUM_LIT:1> , false , missingTypeNames ) ; } } if ( ! method . isConstructor ( ) ) returnType = this . environment . getTypeFromSignature ( methodDescriptor , index + <NUM_LIT:1> , - <NUM_LIT:1> , false , this , missingTypeNames ) ; } else { methodModifiers |= ExtraCompilerModifiers . AccGenericSignature ; SignatureWrapper wrapper = new SignatureWrapper ( methodSignature , use15specifics ) ; if ( wrapper . signature [ wrapper . start ] == Util . C_GENERIC_START ) { wrapper . start ++ ; typeVars = createTypeVariables ( wrapper , false , missingTypeNames ) ; wrapper . start ++ ; } if ( wrapper . signature [ wrapper . start ] == Util . C_PARAM_START ) { wrapper . start ++ ; if ( wrapper . signature [ wrapper . start ] == Util . C_PARAM_END ) { wrapper . start ++ ; } else { java . util . ArrayList types = new java . util . ArrayList ( <NUM_LIT:2> ) ; while ( wrapper . signature [ wrapper . start ] != Util . C_PARAM_END ) types . add ( this . environment . getTypeFromTypeSignature ( wrapper , typeVars , this , missingTypeNames ) ) ; wrapper . start ++ ; int numParam = types . size ( ) ; parameters = new TypeBinding [ numParam ] ; types . toArray ( parameters ) ; if ( this . environment . globalOptions . storeAnnotations ) { paramAnnotations = new AnnotationBinding [ numParam ] [ ] ; for ( int i = <NUM_LIT:0> ; i < numParam ; i ++ ) paramAnnotations [ i ] = createAnnotations ( method . getParameterAnnotations ( i ) , this . environment , missingTypeNames ) ; } } } returnType = this . environment . getTypeFromTypeSignature ( wrapper , typeVars , this , missingTypeNames ) ; if ( ! wrapper . atEnd ( ) && wrapper . signature [ wrapper . start ] == Util . C_EXCEPTION_START ) { java . util . ArrayList types = new java . util . ArrayList ( <NUM_LIT:2> ) ; do { wrapper . start ++ ; types . add ( this . environment . getTypeFromTypeSignature ( wrapper , typeVars , this , missingTypeNames ) ) ; } while ( ! wrapper . atEnd ( ) && wrapper . signature [ wrapper . start ] == Util . C_EXCEPTION_START ) ; exceptions = new ReferenceBinding [ types . size ( ) ] ; types . toArray ( exceptions ) ; } else { char [ ] [ ] exceptionTypes = method . getExceptionTypeNames ( ) ; if ( exceptionTypes != null ) { int size = exceptionTypes . length ; if ( size > <NUM_LIT:0> ) { exceptions = new ReferenceBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) exceptions [ i ] = this . environment . getTypeFromConstantPoolName ( exceptionTypes [ i ] , <NUM_LIT:0> , - <NUM_LIT:1> , false , missingTypeNames ) ; } } } } MethodBinding result = method . isConstructor ( ) ? new MethodBinding ( methodModifiers , parameters , exceptions , this ) : new MethodBinding ( methodModifiers , method . getSelector ( ) , returnType , parameters , exceptions , this ) ; if ( this . environment . globalOptions . storeAnnotations ) result . setAnnotations ( createAnnotations ( method . getAnnotations ( ) , this . environment , missingTypeNames ) , paramAnnotations , isAnnotationType ( ) ? convertMemberValue ( method . getDefaultValue ( ) , this . environment , missingTypeNames ) : null , this . environment ) ; if ( use15specifics ) result . tagBits |= method . getTagBits ( ) ; result . typeVariables = typeVars ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) typeVars [ i ] . declaringElement = result ; scanMethodForNullAnnotation ( method , result ) ; return result ; } private void createMethods ( IBinaryMethod [ ] iMethods , long sourceLevel , char [ ] [ ] [ ] missingTypeNames ) { int total = <NUM_LIT:0> , initialTotal = <NUM_LIT:0> , iClinit = - <NUM_LIT:1> ; int [ ] toSkip = null ; if ( iMethods != null ) { total = initialTotal = iMethods . length ; boolean keepBridgeMethods = sourceLevel < ClassFileConstants . JDK1_5 ; for ( int i = total ; -- i >= <NUM_LIT:0> ; ) { IBinaryMethod method = iMethods [ i ] ; if ( ( method . getModifiers ( ) & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ) { if ( keepBridgeMethods && ( method . getModifiers ( ) & ClassFileConstants . AccBridge ) != <NUM_LIT:0> ) continue ; if ( toSkip == null ) toSkip = new int [ iMethods . length ] ; toSkip [ i ] = - <NUM_LIT:1> ; total -- ; } else if ( iClinit == - <NUM_LIT:1> ) { char [ ] methodName = method . getSelector ( ) ; if ( methodName . length == <NUM_LIT:8> && methodName [ <NUM_LIT:0> ] == Util . C_GENERIC_START ) { iClinit = i ; total -- ; } } } } if ( total == <NUM_LIT:0> ) { this . methods = Binding . NO_METHODS ; return ; } boolean hasRestrictedAccess = hasRestrictedAccess ( ) ; this . methods = new MethodBinding [ total ] ; if ( total == initialTotal ) { for ( int i = <NUM_LIT:0> ; i < initialTotal ; i ++ ) { MethodBinding method = createMethod ( iMethods [ i ] , sourceLevel , missingTypeNames ) ; if ( hasRestrictedAccess ) method . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; this . methods [ i ] = method ; } } else { for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < initialTotal ; i ++ ) { if ( iClinit != i && ( toSkip == null || toSkip [ i ] != - <NUM_LIT:1> ) ) { MethodBinding method = createMethod ( iMethods [ i ] , sourceLevel , missingTypeNames ) ; if ( hasRestrictedAccess ) method . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; this . methods [ index ++ ] = method ; } } if ( this . environment . globalOptions . buildGroovyFiles == <NUM_LIT:2> ) { int skipped = initialTotal - this . methods . length - ( iClinit == - <NUM_LIT:1> ? <NUM_LIT:0> : <NUM_LIT:1> ) ; if ( skipped == <NUM_LIT:0> ) { this . infraMethods = Binding . NO_METHODS ; } else { this . infraMethods = new MethodBinding [ skipped ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < initialTotal ; i ++ ) { if ( iClinit != i && ( toSkip != null && toSkip [ i ] == - <NUM_LIT:1> ) ) { MethodBinding method = createMethod ( iMethods [ i ] , sourceLevel , missingTypeNames ) ; this . infraMethods [ index ++ ] = method ; } } } } } } private TypeVariableBinding [ ] createTypeVariables ( SignatureWrapper wrapper , boolean assignVariables , char [ ] [ ] [ ] missingTypeNames ) { char [ ] typeSignature = wrapper . signature ; int depth = <NUM_LIT:0> , length = typeSignature . length ; int rank = <NUM_LIT:0> ; ArrayList variables = new ArrayList ( <NUM_LIT:1> ) ; depth = <NUM_LIT:0> ; boolean pendingVariable = true ; createVariables : { for ( int i = <NUM_LIT:1> ; i < length ; i ++ ) { switch ( typeSignature [ i ] ) { case Util . C_GENERIC_START : depth ++ ; break ; case Util . C_GENERIC_END : if ( -- depth < <NUM_LIT:0> ) break createVariables ; break ; case Util . C_NAME_END : if ( ( depth == <NUM_LIT:0> ) && ( i + <NUM_LIT:1> < length ) && ( typeSignature [ i + <NUM_LIT:1> ] != Util . C_COLON ) ) pendingVariable = true ; break ; default : if ( pendingVariable ) { pendingVariable = false ; int colon = CharOperation . indexOf ( Util . C_COLON , typeSignature , i ) ; char [ ] variableName = CharOperation . subarray ( typeSignature , i , colon ) ; variables . add ( new TypeVariableBinding ( variableName , this , rank ++ , this . environment ) ) ; } } } } TypeVariableBinding [ ] result ; variables . toArray ( result = new TypeVariableBinding [ rank ] ) ; if ( assignVariables ) this . typeVariables = result ; for ( int i = <NUM_LIT:0> ; i < rank ; i ++ ) { initializeTypeVariable ( result [ i ] , result , wrapper , missingTypeNames ) ; } return result ; } public ReferenceBinding enclosingType ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedEnclosingType ) == <NUM_LIT:0> ) return this . enclosingType ; this . enclosingType = ( ReferenceBinding ) resolveType ( this . enclosingType , this . environment , false ) ; this . tagBits &= ~ TagBits . HasUnresolvedEnclosingType ; return this . enclosingType ; } public FieldBinding [ ] fields ( ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return this . fields ; if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } for ( int i = this . fields . length ; -- i >= <NUM_LIT:0> ; ) resolveTypeFor ( this . fields [ i ] ) ; this . tagBits |= TagBits . AreFieldsComplete ; return this . fields ; } private MethodBinding findMethod ( char [ ] methodDescriptor , char [ ] [ ] [ ] missingTypeNames ) { int index = - <NUM_LIT:1> ; while ( methodDescriptor [ ++ index ] != Util . C_PARAM_START ) { } char [ ] selector = new char [ index ] ; System . arraycopy ( methodDescriptor , <NUM_LIT:0> , selector , <NUM_LIT:0> , index ) ; TypeBinding [ ] parameters = Binding . NO_PARAMETERS ; int numOfParams = <NUM_LIT:0> ; char nextChar ; int paramStart = index ; while ( ( nextChar = methodDescriptor [ ++ index ] ) != Util . C_PARAM_END ) { if ( nextChar != Util . C_ARRAY ) { numOfParams ++ ; if ( nextChar == Util . C_RESOLVED ) while ( ( nextChar = methodDescriptor [ ++ index ] ) != Util . C_NAME_END ) { } } } if ( numOfParams > <NUM_LIT:0> ) { parameters = new TypeBinding [ numOfParams ] ; index = paramStart + <NUM_LIT:1> ; int end = paramStart ; for ( int i = <NUM_LIT:0> ; i < numOfParams ; i ++ ) { while ( ( nextChar = methodDescriptor [ ++ end ] ) == Util . C_ARRAY ) { } if ( nextChar == Util . C_RESOLVED ) while ( ( nextChar = methodDescriptor [ ++ end ] ) != Util . C_NAME_END ) { } TypeBinding param = this . environment . getTypeFromSignature ( methodDescriptor , index , end , false , this , missingTypeNames ) ; if ( param instanceof UnresolvedReferenceBinding ) { param = resolveType ( param , this . environment , true ) ; } parameters [ i ] = param ; index = end + <NUM_LIT:1> ; } } int parameterLength = parameters . length ; MethodBinding [ ] methods2 = this . enclosingType . getMethods ( selector , parameterLength ) ; loop : for ( int i = <NUM_LIT:0> , max = methods2 . length ; i < max ; i ++ ) { MethodBinding currentMethod = methods2 [ i ] ; TypeBinding [ ] parameters2 = currentMethod . parameters ; int currentMethodParameterLength = parameters2 . length ; if ( parameterLength == currentMethodParameterLength ) { for ( int j = <NUM_LIT:0> ; j < currentMethodParameterLength ; j ++ ) { if ( parameters [ j ] != parameters2 [ j ] && parameters [ j ] . erasure ( ) != parameters2 [ j ] . erasure ( ) ) { continue loop ; } } return currentMethod ; } } return null ; } public char [ ] genericTypeSignature ( ) { return computeGenericTypeSignature ( this . typeVariables ) ; } public MethodBinding getExactConstructor ( TypeBinding [ ] argumentTypes ) { if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } int argCount = argumentTypes . length ; long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( method . parameters . length == argCount ) { resolveTypesFor ( method ) ; TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } return null ; } public MethodBinding getExactMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , CompilationUnitScope refScope ) { if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } int argCount = argumentTypes . length ; boolean foundNothing = true ; long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; foundNothing = false ; if ( method . parameters . length == argCount ) { resolveTypesFor ( method ) ; TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } if ( foundNothing ) { if ( isInterface ( ) ) { if ( superInterfaces ( ) . length == <NUM_LIT:1> ) { if ( refScope != null ) refScope . recordTypeReference ( this . superInterfaces [ <NUM_LIT:0> ] ) ; return this . superInterfaces [ <NUM_LIT:0> ] . getExactMethod ( selector , argumentTypes , refScope ) ; } } else if ( superclass ( ) != null ) { if ( refScope != null ) refScope . recordTypeReference ( this . superclass ) ; return this . superclass . getExactMethod ( selector , argumentTypes , refScope ) ; } } return null ; } public FieldBinding getField ( char [ ] fieldName , boolean needResolve ) { if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } FieldBinding field = ReferenceBinding . binarySearch ( fieldName , this . fields ) ; return needResolve && field != null ? resolveTypeFor ( field ) : field ; } public ReferenceBinding getMemberType ( char [ ] typeName ) { for ( int i = this . memberTypes . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding memberType = this . memberTypes [ i ] ; if ( memberType instanceof UnresolvedReferenceBinding ) { char [ ] name = memberType . sourceName ; int prefixLength = this . compoundName [ this . compoundName . length - <NUM_LIT:1> ] . length + <NUM_LIT:1> ; if ( name . length == ( prefixLength + typeName . length ) ) if ( CharOperation . fragmentEquals ( typeName , name , prefixLength , true ) ) return this . memberTypes [ i ] = ( ReferenceBinding ) resolveType ( memberType , this . environment , false ) ; } else if ( CharOperation . equals ( typeName , memberType . sourceName ) ) { return memberType ; } } return null ; } public MethodBinding [ ] getMethods ( char [ ] selector ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; int length = end - start + <NUM_LIT:1> ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { MethodBinding [ ] result ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; return result ; } } return Binding . NO_METHODS ; } if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; int length = end - start + <NUM_LIT:1> ; MethodBinding [ ] result = new MethodBinding [ length ] ; for ( int i = start , index = <NUM_LIT:0> ; i <= end ; i ++ , index ++ ) result [ index ] = resolveTypesFor ( this . methods [ i ] ) ; return result ; } return Binding . NO_METHODS ; } public MethodBinding [ ] getMethods ( char [ ] selector , int suggestedParameterLength ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return getMethods ( selector ) ; if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; int length = end - start + <NUM_LIT:1> ; int count = <NUM_LIT:0> ; for ( int i = start ; i <= end ; i ++ ) { int len = this . methods [ i ] . parameters . length ; if ( len <= suggestedParameterLength || ( this . methods [ i ] . isVarargs ( ) && len == suggestedParameterLength + <NUM_LIT:1> ) ) count ++ ; } if ( count == <NUM_LIT:0> ) { MethodBinding [ ] result = new MethodBinding [ length ] ; for ( int i = start , index = <NUM_LIT:0> ; i <= end ; i ++ ) result [ index ++ ] = resolveTypesFor ( this . methods [ i ] ) ; return result ; } else { MethodBinding [ ] result = new MethodBinding [ count ] ; for ( int i = start , index = <NUM_LIT:0> ; i <= end ; i ++ ) { int len = this . methods [ i ] . parameters . length ; if ( len <= suggestedParameterLength || ( this . methods [ i ] . isVarargs ( ) && len == suggestedParameterLength + <NUM_LIT:1> ) ) result [ index ++ ] = resolveTypesFor ( this . methods [ i ] ) ; } return result ; } } return Binding . NO_METHODS ; } public boolean hasMemberTypes ( ) { return this . memberTypes . length > <NUM_LIT:0> ; } public TypeVariableBinding getTypeVariable ( char [ ] variableName ) { TypeVariableBinding variable = super . getTypeVariable ( variableName ) ; variable . resolve ( ) ; return variable ; } public boolean hasTypeBit ( int bit ) { boolean wasToleratingMissingTypeProcessingAnnotations = this . environment . mayTolerateMissingType ; this . environment . mayTolerateMissingType = true ; try { superclass ( ) ; superInterfaces ( ) ; } finally { this . environment . mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations ; } return ( this . typeBits & bit ) != <NUM_LIT:0> ; } private void initializeTypeVariable ( TypeVariableBinding variable , TypeVariableBinding [ ] existingVariables , SignatureWrapper wrapper , char [ ] [ ] [ ] missingTypeNames ) { int colon = CharOperation . indexOf ( Util . C_COLON , wrapper . signature , wrapper . start ) ; wrapper . start = colon + <NUM_LIT:1> ; ReferenceBinding type , firstBound = null ; if ( wrapper . signature [ wrapper . start ] == Util . C_COLON ) { type = this . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; } else { TypeBinding typeFromTypeSignature = this . environment . getTypeFromTypeSignature ( wrapper , existingVariables , this , missingTypeNames ) ; if ( typeFromTypeSignature instanceof ReferenceBinding ) { type = ( ReferenceBinding ) typeFromTypeSignature ; } else { type = this . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; } firstBound = type ; } variable . modifiers |= ExtraCompilerModifiers . AccUnresolved ; variable . superclass = type ; ReferenceBinding [ ] bounds = null ; if ( wrapper . signature [ wrapper . start ] == Util . C_COLON ) { java . util . ArrayList types = new java . util . ArrayList ( <NUM_LIT:2> ) ; do { wrapper . start ++ ; types . add ( this . environment . getTypeFromTypeSignature ( wrapper , existingVariables , this , missingTypeNames ) ) ; } while ( wrapper . signature [ wrapper . start ] == Util . C_COLON ) ; bounds = new ReferenceBinding [ types . size ( ) ] ; types . toArray ( bounds ) ; } variable . superInterfaces = bounds == null ? Binding . NO_SUPERINTERFACES : bounds ; if ( firstBound == null ) { firstBound = variable . superInterfaces . length == <NUM_LIT:0> ? null : variable . superInterfaces [ <NUM_LIT:0> ] ; } variable . firstBound = firstBound ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == 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 . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return otherType . erasure ( ) == this ; } return false ; } public boolean isGenericType ( ) { return this . typeVariables != Binding . NO_TYPE_VARIABLES ; } public boolean isHierarchyConnected ( ) { return ( this . tagBits & ( TagBits . HasUnresolvedSuperclass | TagBits . HasUnresolvedSuperinterfaces ) ) == <NUM_LIT:0> ; } public int kind ( ) { if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) return Binding . GENERIC_TYPE ; return Binding . TYPE ; } public ReferenceBinding [ ] memberTypes ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedMemberTypes ) == <NUM_LIT:0> ) return this . memberTypes ; for ( int i = this . memberTypes . length ; -- i >= <NUM_LIT:0> ; ) this . memberTypes [ i ] = ( ReferenceBinding ) resolveType ( this . memberTypes [ i ] , this . environment , false ) ; this . tagBits &= ~ TagBits . HasUnresolvedMemberTypes ; return this . memberTypes ; } public MethodBinding [ ] infraMethods ( ) { if ( ! this . infraMethodsComplete ) { for ( int i = this . infraMethods . length ; -- i >= <NUM_LIT:0> ; ) { resolveTypesFor ( this . infraMethods [ i ] ) ; } this . infraMethodsComplete = true ; } return this . infraMethods ; } public MethodBinding [ ] methods ( ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return this . methods ; if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } for ( int i = this . methods . length ; -- i >= <NUM_LIT:0> ; ) resolveTypesFor ( this . methods [ i ] ) ; this . tagBits |= TagBits . AreMethodsComplete ; return this . methods ; } private FieldBinding resolveTypeFor ( FieldBinding field ) { if ( ( field . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return field ; TypeBinding resolvedType = resolveType ( field . type , this . environment , true ) ; field . type = resolvedType ; if ( ( resolvedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { field . tagBits |= TagBits . HasMissingType ; } field . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return field ; } MethodBinding resolveTypesFor ( MethodBinding method ) { if ( ( method . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return method ; if ( ! method . isConstructor ( ) ) { TypeBinding resolvedType = resolveType ( method . returnType , this . environment , true ) ; method . returnType = resolvedType ; if ( ( resolvedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } } for ( int i = method . parameters . length ; -- i >= <NUM_LIT:0> ; ) { TypeBinding resolvedType = resolveType ( method . parameters [ i ] , this . environment , true ) ; method . parameters [ i ] = resolvedType ; if ( ( resolvedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } } for ( int i = method . thrownExceptions . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding resolvedType = ( ReferenceBinding ) resolveType ( method . thrownExceptions [ i ] , this . environment , true ) ; method . thrownExceptions [ i ] = resolvedType ; if ( ( resolvedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } } for ( int i = method . typeVariables . length ; -- i >= <NUM_LIT:0> ; ) { method . typeVariables [ i ] . resolve ( ) ; } method . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return method ; } AnnotationBinding [ ] retrieveAnnotations ( Binding binding ) { return AnnotationBinding . addStandardAnnotations ( super . retrieveAnnotations ( binding ) , binding . getAnnotationTagBits ( ) , this . environment ) ; } SimpleLookupTable storedAnnotations ( boolean forceInitialize ) { if ( forceInitialize && this . storedAnnotations == null ) { if ( ! this . environment . globalOptions . storeAnnotations ) return null ; this . storedAnnotations = new SimpleLookupTable ( <NUM_LIT:3> ) ; } return this . storedAnnotations ; } void scanMethodForNullAnnotation ( IBinaryMethod method , MethodBinding methodBinding ) { if ( ! this . environment . globalOptions . isAnnotationBasedNullAnalysisEnabled ) return ; char [ ] [ ] nullableAnnotationName = this . environment . getNullableAnnotationName ( ) ; char [ ] [ ] nonNullAnnotationName = this . environment . getNonNullAnnotationName ( ) ; char [ ] [ ] nonNullByDefaultAnnotationName = this . environment . getNonNullByDefaultAnnotationName ( ) ; if ( nullableAnnotationName == null || nonNullAnnotationName == null || nonNullByDefaultAnnotationName == null ) return ; int currentDefault = NO_NULL_DEFAULT ; if ( ( this . tagBits & TagBits . AnnotationNonNullByDefault ) != <NUM_LIT:0> ) { currentDefault = NONNULL_BY_DEFAULT ; } else if ( ( this . tagBits & TagBits . AnnotationNullUnspecifiedByDefault ) != <NUM_LIT:0> ) { currentDefault = NULL_UNSPECIFIED_BY_DEFAULT ; } IBinaryAnnotation [ ] annotations = method . getAnnotations ( ) ; boolean explicitNullness = false ; if ( annotations != null ) { for ( int i = <NUM_LIT:0> ; i < annotations . length ; i ++ ) { char [ ] annotationTypeName = annotations [ i ] . getTypeName ( ) ; if ( annotationTypeName [ <NUM_LIT:0> ] != Util . C_RESOLVED ) continue ; char [ ] [ ] typeName = CharOperation . splitOn ( '<CHAR_LIT:/>' , annotationTypeName , <NUM_LIT:1> , annotationTypeName . length - <NUM_LIT:1> ) ; if ( CharOperation . equals ( typeName , nonNullByDefaultAnnotationName ) ) { methodBinding . tagBits |= TagBits . AnnotationNonNullByDefault ; currentDefault = NONNULL_BY_DEFAULT ; } if ( ! explicitNullness && CharOperation . equals ( typeName , nonNullAnnotationName ) ) { methodBinding . tagBits |= TagBits . AnnotationNonNull ; explicitNullness = true ; } if ( ! explicitNullness && CharOperation . equals ( typeName , nullableAnnotationName ) ) { methodBinding . tagBits |= TagBits . AnnotationNullable ; explicitNullness = true ; } } } if ( ! explicitNullness && ( methodBinding . returnType != null && ! methodBinding . returnType . isBaseType ( ) ) && currentDefault == NONNULL_BY_DEFAULT ) { methodBinding . tagBits |= TagBits . AnnotationNonNull ; } TypeBinding [ ] parameters = methodBinding . parameters ; int numVisibleParams = parameters . length ; int numParamAnnotations = method . getAnnotatedParametersCount ( ) ; if ( numParamAnnotations > <NUM_LIT:0> || currentDefault == NONNULL_BY_DEFAULT ) { for ( int j = <NUM_LIT:0> ; j < numVisibleParams ; j ++ ) { explicitNullness = false ; if ( numParamAnnotations > <NUM_LIT:0> ) { int startIndex = numParamAnnotations - numVisibleParams ; IBinaryAnnotation [ ] paramAnnotations = method . getParameterAnnotations ( j + startIndex ) ; if ( paramAnnotations != null ) { for ( int i = <NUM_LIT:0> ; i < paramAnnotations . length ; i ++ ) { char [ ] annotationTypeName = paramAnnotations [ i ] . getTypeName ( ) ; if ( annotationTypeName [ <NUM_LIT:0> ] != Util . C_RESOLVED ) continue ; char [ ] [ ] typeName = CharOperation . splitOn ( '<CHAR_LIT:/>' , annotationTypeName , <NUM_LIT:1> , annotationTypeName . length - <NUM_LIT:1> ) ; if ( CharOperation . equals ( typeName , nonNullAnnotationName ) ) { if ( methodBinding . parameterNonNullness == null ) methodBinding . parameterNonNullness = new Boolean [ numVisibleParams ] ; methodBinding . parameterNonNullness [ j ] = Boolean . TRUE ; explicitNullness = true ; break ; } else if ( CharOperation . equals ( typeName , nullableAnnotationName ) ) { if ( methodBinding . parameterNonNullness == null ) methodBinding . parameterNonNullness = new Boolean [ numVisibleParams ] ; methodBinding . parameterNonNullness [ j ] = Boolean . FALSE ; explicitNullness = true ; break ; } } } } if ( ! explicitNullness && currentDefault == NONNULL_BY_DEFAULT ) { if ( methodBinding . parameterNonNullness == null ) methodBinding . parameterNonNullness = new Boolean [ numVisibleParams ] ; if ( methodBinding . parameters [ j ] != null && ! methodBinding . parameters [ j ] . isBaseType ( ) ) { methodBinding . parameterNonNullness [ j ] = Boolean . TRUE ; } } } } } void scanTypeForNullDefaultAnnotation ( IBinaryType binaryType , PackageBinding packageBinding , BinaryTypeBinding binaryBinding ) { char [ ] [ ] nonNullByDefaultAnnotationName = this . environment . getNonNullByDefaultAnnotationName ( ) ; if ( nonNullByDefaultAnnotationName == null ) return ; IBinaryAnnotation [ ] annotations = binaryType . getAnnotations ( ) ; boolean isPackageInfo = CharOperation . equals ( binaryBinding . sourceName ( ) , TypeConstants . PACKAGE_INFO_NAME ) ; if ( annotations != null ) { long annotationBit = <NUM_LIT> ; int nullness = NO_NULL_DEFAULT ; int length = annotations . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] annotationTypeName = annotations [ i ] . getTypeName ( ) ; if ( annotationTypeName [ <NUM_LIT:0> ] != Util . C_RESOLVED ) continue ; char [ ] [ ] typeName = CharOperation . splitOn ( '<CHAR_LIT:/>' , annotationTypeName , <NUM_LIT:1> , annotationTypeName . length - <NUM_LIT:1> ) ; if ( CharOperation . equals ( typeName , nonNullByDefaultAnnotationName ) ) { IBinaryElementValuePair [ ] elementValuePairs = annotations [ i ] . getElementValuePairs ( ) ; if ( elementValuePairs != null && elementValuePairs . length == <NUM_LIT:1> ) { Object value = elementValuePairs [ <NUM_LIT:0> ] . getValue ( ) ; if ( value instanceof BooleanConstant && ! ( ( BooleanConstant ) value ) . booleanValue ( ) ) { annotationBit = TagBits . AnnotationNullUnspecifiedByDefault ; nullness = NULL_UNSPECIFIED_BY_DEFAULT ; break ; } } annotationBit = TagBits . AnnotationNonNullByDefault ; nullness = NONNULL_BY_DEFAULT ; break ; } } if ( annotationBit != <NUM_LIT> ) { binaryBinding . tagBits |= annotationBit ; if ( isPackageInfo ) packageBinding . defaultNullness = nullness ; return ; } } if ( isPackageInfo ) { packageBinding . defaultNullness = Binding . NULL_UNSPECIFIED_BY_DEFAULT ; return ; } ReferenceBinding enclosingTypeBinding = binaryBinding . enclosingType ; if ( enclosingTypeBinding != null ) { if ( ( enclosingTypeBinding . tagBits & TagBits . AnnotationNonNullByDefault ) != <NUM_LIT:0> ) { binaryBinding . tagBits |= TagBits . AnnotationNonNullByDefault ; return ; } else if ( ( enclosingTypeBinding . tagBits & TagBits . AnnotationNullUnspecifiedByDefault ) != <NUM_LIT:0> ) { binaryBinding . tagBits |= TagBits . AnnotationNullUnspecifiedByDefault ; return ; } } if ( packageBinding . defaultNullness == Binding . NO_NULL_DEFAULT && ! isPackageInfo ) { ReferenceBinding packageInfo = packageBinding . getType ( TypeConstants . PACKAGE_INFO_NAME ) ; if ( packageInfo == null ) { packageBinding . defaultNullness = Binding . NULL_UNSPECIFIED_BY_DEFAULT ; } } switch ( packageBinding . defaultNullness ) { case Binding . NONNULL_BY_DEFAULT : binaryBinding . tagBits |= TagBits . AnnotationNonNullByDefault ; break ; case Binding . NULL_UNSPECIFIED_BY_DEFAULT : binaryBinding . tagBits |= TagBits . AnnotationNullUnspecifiedByDefault ; break ; } } public ReferenceBinding superclass ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedSuperclass ) == <NUM_LIT:0> ) return this . superclass ; this . superclass = ( ReferenceBinding ) resolveType ( this . superclass , this . environment , true ) ; this . tagBits &= ~ TagBits . HasUnresolvedSuperclass ; if ( this . superclass . problemId ( ) == ProblemReasons . NotFound ) { this . tagBits |= TagBits . HierarchyHasProblems ; } else { boolean wasToleratingMissingTypeProcessingAnnotations = this . environment . mayTolerateMissingType ; this . environment . mayTolerateMissingType = true ; try { this . superclass . superclass ( ) ; this . superclass . superInterfaces ( ) ; } finally { this . environment . mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations ; } } this . typeBits |= ( this . superclass . typeBits & TypeIds . InheritableBits ) ; if ( ( this . typeBits & ( TypeIds . BitAutoCloseable | TypeIds . BitCloseable ) ) != <NUM_LIT:0> ) this . typeBits |= applyCloseableWhitelists ( ) ; return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedSuperinterfaces ) == <NUM_LIT:0> ) return this . superInterfaces ; for ( int i = this . superInterfaces . length ; -- i >= <NUM_LIT:0> ; ) { this . superInterfaces [ i ] = ( ReferenceBinding ) resolveType ( this . superInterfaces [ i ] , this . environment , true ) ; if ( this . superInterfaces [ i ] . problemId ( ) == ProblemReasons . NotFound ) { this . tagBits |= TagBits . HierarchyHasProblems ; } else { boolean wasToleratingMissingTypeProcessingAnnotations = this . environment . mayTolerateMissingType ; this . environment . mayTolerateMissingType = true ; try { this . superInterfaces [ i ] . superclass ( ) ; this . superInterfaces [ i ] . superInterfaces ( ) ; } finally { this . environment . mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations ; } } this . typeBits |= ( this . superInterfaces [ i ] . typeBits & TypeIds . InheritableBits ) ; } this . tagBits &= ~ TagBits . HasUnresolvedSuperinterfaces ; return this . superInterfaces ; } public TypeVariableBinding [ ] typeVariables ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedTypeVariables ) == <NUM_LIT:0> ) return this . typeVariables ; for ( int i = this . typeVariables . length ; -- i >= <NUM_LIT:0> ; ) this . typeVariables [ i ] . resolve ( ) ; this . tagBits &= ~ TagBits . HasUnresolvedTypeVariables ; return this . typeVariables ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; if ( isDeprecated ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPublic ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isProtected ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPrivate ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isAbstract ( ) && isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isStatic ( ) && isNestedType ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isFinal ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isEnum ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isAnnotationType ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; if ( this . typeVariables == null ) { buffer . append ( "<STR_LIT>" ) ; } else if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) { buffer . append ( "<STR_LIT:<>" ) ; for ( int i = <NUM_LIT:0> , length = this . typeVariables . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; if ( this . typeVariables [ i ] == null ) { buffer . append ( "<STR_LIT>" ) ; continue ; } char [ ] varChars = this . typeVariables [ i ] . toString ( ) . toCharArray ( ) ; buffer . append ( varChars , <NUM_LIT:1> , varChars . length - <NUM_LIT:2> ) ; } buffer . append ( "<STR_LIT:>>" ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . superclass != null ) ? this . superclass . debugName ( ) : "<STR_LIT>" ) ; if ( this . superInterfaces != null ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( ( this . superInterfaces [ i ] != null ) ? this . superInterfaces [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . enclosingType != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . enclosingType . debugName ( ) ) ; } if ( this . fields != null ) { if ( this . fields != Binding . NO_FIELDS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) buffer . append ( ( this . fields [ i ] != null ) ? "<STR_LIT:n>" + this . fields [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . methods != null ) { if ( this . methods != Binding . NO_METHODS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) buffer . append ( ( this . methods [ i ] != null ) ? "<STR_LIT:n>" + this . methods [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . memberTypes != null ) { if ( this . memberTypes != Binding . NO_MEMBER_TYPES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . memberTypes . length ; i < length ; i ++ ) buffer . append ( ( this . memberTypes [ i ] != null ) ? "<STR_LIT:n>" + this . memberTypes [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } MethodBinding [ ] unResolvedMethods ( ) { return this . methods ; } public FieldBinding [ ] unResolvedFields ( ) { return this . fields ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; abstract public class TypeBinding extends Binding { public int id = TypeIds . NoId ; public long tagBits = <NUM_LIT:0> ; public final static BaseTypeBinding INT = new BaseTypeBinding ( TypeIds . T_int , TypeConstants . INT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding BYTE = new BaseTypeBinding ( TypeIds . T_byte , TypeConstants . BYTE , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding SHORT = new BaseTypeBinding ( TypeIds . T_short , TypeConstants . SHORT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding CHAR = new BaseTypeBinding ( TypeIds . T_char , TypeConstants . CHAR , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding LONG = new BaseTypeBinding ( TypeIds . T_long , TypeConstants . LONG , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding FLOAT = new BaseTypeBinding ( TypeIds . T_float , TypeConstants . FLOAT , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding DOUBLE = new BaseTypeBinding ( TypeIds . T_double , TypeConstants . DOUBLE , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding BOOLEAN = new BaseTypeBinding ( TypeIds . T_boolean , TypeConstants . BOOLEAN , new char [ ] { '<CHAR_LIT:Z>' } ) ; public final static BaseTypeBinding NULL = new BaseTypeBinding ( TypeIds . T_null , TypeConstants . NULL , new char [ ] { '<CHAR_LIT>' } ) ; public final static BaseTypeBinding VOID = new BaseTypeBinding ( TypeIds . T_void , TypeConstants . VOID , new char [ ] { '<CHAR_LIT>' } ) ; public static final TypeBinding wellKnownType ( Scope scope , int id ) { switch ( id ) { case TypeIds . T_boolean : return TypeBinding . BOOLEAN ; case TypeIds . T_byte : return TypeBinding . BYTE ; case TypeIds . T_char : return TypeBinding . CHAR ; case TypeIds . T_short : return TypeBinding . SHORT ; case TypeIds . T_double : return TypeBinding . DOUBLE ; case TypeIds . T_float : return TypeBinding . FLOAT ; case TypeIds . T_int : return TypeBinding . INT ; case TypeIds . T_long : return TypeBinding . LONG ; case TypeIds . T_JavaLangObject : return scope . getJavaLangObject ( ) ; case TypeIds . T_JavaLangString : return scope . getJavaLangString ( ) ; default : return null ; } } public boolean canBeInstantiated ( ) { return ! isBaseType ( ) ; } public TypeBinding capture ( Scope scope , int position ) { return this ; } public TypeBinding closestMatch ( ) { return this ; } public List collectMissingTypes ( List missingTypes ) { return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { } public abstract char [ ] constantPoolName ( ) ; public String debugName ( ) { return new String ( readableName ( ) ) ; } public int dimensions ( ) { return <NUM_LIT:0> ; } public ReferenceBinding enclosingType ( ) { return null ; } public TypeBinding erasure ( ) { return this ; } public ReferenceBinding findSuperTypeOriginatingFrom ( int wellKnownOriginalID , boolean originalIsClass ) { if ( ! ( this instanceof ReferenceBinding ) ) return null ; ReferenceBinding reference = ( ReferenceBinding ) this ; if ( reference . id == wellKnownOriginalID || ( original ( ) . id == wellKnownOriginalID ) ) return reference ; ReferenceBinding currentType = reference ; if ( originalIsClass ) { while ( ( currentType = currentType . superclass ( ) ) != null ) { if ( currentType . id == wellKnownOriginalID ) return currentType ; if ( currentType . original ( ) . id == wellKnownOriginalID ) return currentType ; } return null ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . id == wellKnownOriginalID ) return currentType ; if ( currentType . original ( ) . id == wellKnownOriginalID ) return currentType ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return null ; } public TypeBinding findSuperTypeOriginatingFrom ( TypeBinding otherType ) { if ( this == otherType ) return this ; if ( otherType == null ) return null ; switch ( kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding arrayType = ( ArrayBinding ) this ; int otherDim = otherType . dimensions ( ) ; if ( arrayType . dimensions != otherDim ) { switch ( otherType . id ) { case TypeIds . T_JavaLangObject : case TypeIds . T_JavaIoSerializable : case TypeIds . T_JavaLangCloneable : return otherType ; } if ( otherDim < arrayType . dimensions && otherType . leafComponentType ( ) . id == TypeIds . T_JavaLangObject ) { return otherType ; } return null ; } if ( ! ( arrayType . leafComponentType instanceof ReferenceBinding ) ) return null ; TypeBinding leafSuperType = arrayType . leafComponentType . findSuperTypeOriginatingFrom ( otherType . leafComponentType ( ) ) ; if ( leafSuperType == null ) return null ; return arrayType . environment ( ) . createArrayType ( leafSuperType , arrayType . dimensions ) ; case Binding . TYPE_PARAMETER : if ( isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) this ; TypeBinding captureBound = capture . firstBound ; if ( captureBound instanceof ArrayBinding ) { TypeBinding match = captureBound . findSuperTypeOriginatingFrom ( otherType ) ; if ( match != null ) return match ; } } case Binding . TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . GENERIC_TYPE : case Binding . RAW_TYPE : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : otherType = otherType . original ( ) ; if ( this == otherType ) return this ; if ( original ( ) == otherType ) return this ; ReferenceBinding currentType = ( ReferenceBinding ) this ; if ( ! otherType . isInterface ( ) ) { while ( ( currentType = currentType . superclass ( ) ) != null ) { if ( currentType == otherType ) return currentType ; if ( currentType . original ( ) == otherType ) return currentType ; } return null ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType == otherType ) return currentType ; if ( currentType . original ( ) == otherType ) return currentType ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } return null ; } public TypeBinding genericCast ( TypeBinding targetType ) { if ( this == targetType ) return null ; TypeBinding targetErasure = targetType . erasure ( ) ; if ( erasure ( ) . findSuperTypeOriginatingFrom ( targetErasure ) != null ) return null ; return targetErasure ; } public char [ ] genericTypeSignature ( ) { return signature ( ) ; } public TypeBinding getErasureCompatibleType ( TypeBinding declaringClass ) { switch ( kind ( ) ) { case Binding . TYPE_PARAMETER : TypeVariableBinding variable = ( TypeVariableBinding ) this ; if ( variable . erasure ( ) . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return this ; } if ( variable . superclass != null && variable . superclass . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return variable . superclass . getErasureCompatibleType ( declaringClass ) ; } for ( int i = <NUM_LIT:0> , otherLength = variable . superInterfaces . length ; i < otherLength ; i ++ ) { ReferenceBinding superInterface = variable . superInterfaces [ i ] ; if ( superInterface . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return superInterface . getErasureCompatibleType ( declaringClass ) ; } } return this ; case Binding . INTERSECTION_TYPE : WildcardBinding intersection = ( WildcardBinding ) this ; if ( intersection . erasure ( ) . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return this ; } if ( intersection . superclass != null && intersection . superclass . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return intersection . superclass . getErasureCompatibleType ( declaringClass ) ; } for ( int i = <NUM_LIT:0> , otherLength = intersection . superInterfaces . length ; i < otherLength ; i ++ ) { ReferenceBinding superInterface = intersection . superInterfaces [ i ] ; if ( superInterface . findSuperTypeOriginatingFrom ( declaringClass ) != null ) { return superInterface . getErasureCompatibleType ( declaringClass ) ; } } return this ; default : return this ; } } public abstract PackageBinding getPackage ( ) ; void initializeForStaticImports ( ) { } public boolean isAnnotationType ( ) { return false ; } public final boolean isAnonymousType ( ) { return ( this . tagBits & TagBits . IsAnonymousType ) != <NUM_LIT:0> ; } public final boolean isArrayType ( ) { return ( this . tagBits & TagBits . IsArrayType ) != <NUM_LIT:0> ; } public final boolean isBaseType ( ) { return ( this . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ; } public boolean isBoundParameterizedType ( ) { return ( this . tagBits & TagBits . IsBoundParameterizedType ) != <NUM_LIT:0> ; } public boolean isCapture ( ) { return false ; } public boolean isClass ( ) { return false ; } public abstract boolean isCompatibleWith ( TypeBinding right ) ; public boolean isEnum ( ) { return false ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; } return false ; } public boolean isGenericType ( ) { return false ; } public final boolean isHierarchyInconsistent ( ) { return ( this . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ; } public boolean isInterface ( ) { return false ; } public boolean isIntersectionType ( ) { return false ; } public final boolean isLocalType ( ) { return ( this . tagBits & TagBits . IsLocalType ) != <NUM_LIT:0> ; } public final boolean isMemberType ( ) { return ( this . tagBits & TagBits . IsMemberType ) != <NUM_LIT:0> ; } public final boolean isNestedType ( ) { return ( this . tagBits & TagBits . IsNestedType ) != <NUM_LIT:0> ; } public final boolean isNumericType ( ) { switch ( this . id ) { case TypeIds . T_int : case TypeIds . T_float : case TypeIds . T_double : case TypeIds . T_short : case TypeIds . T_byte : case TypeIds . T_long : case TypeIds . T_char : return true ; default : return false ; } } public final boolean isParameterizedType ( ) { return kind ( ) == Binding . PARAMETERIZED_TYPE ; } public final boolean isParameterizedTypeWithActualArguments ( ) { return ( kind ( ) == Binding . PARAMETERIZED_TYPE ) && ( ( ParameterizedTypeBinding ) this ) . arguments != null ; } public boolean isParameterizedWithOwnVariables ( ) { if ( kind ( ) != Binding . PARAMETERIZED_TYPE ) return false ; ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; if ( paramType . arguments == null ) return false ; TypeVariableBinding [ ] variables = erasure ( ) . typeVariables ( ) ; for ( int i = <NUM_LIT:0> , length = variables . length ; i < length ; i ++ ) { if ( variables [ i ] != paramType . arguments [ i ] ) return false ; } ReferenceBinding enclosing = paramType . enclosingType ( ) ; if ( enclosing != null && enclosing . erasure ( ) . isGenericType ( ) && ! enclosing . isParameterizedWithOwnVariables ( ) ) { return false ; } return true ; } private boolean isProvableDistinctSubType ( TypeBinding otherType ) { if ( otherType . isInterface ( ) ) { if ( isInterface ( ) ) return false ; if ( isArrayType ( ) || ( ( this instanceof ReferenceBinding ) && ( ( ReferenceBinding ) this ) . isFinal ( ) ) || ( isTypeVariable ( ) && ( ( TypeVariableBinding ) this ) . superclass ( ) . isFinal ( ) ) ) { return ! isCompatibleWith ( otherType ) ; } return false ; } else { if ( isInterface ( ) ) { if ( otherType . isArrayType ( ) || ( ( otherType instanceof ReferenceBinding ) && ( ( ReferenceBinding ) otherType ) . isFinal ( ) ) || ( otherType . isTypeVariable ( ) && ( ( TypeVariableBinding ) otherType ) . superclass ( ) . isFinal ( ) ) ) { return ! isCompatibleWith ( otherType ) ; } } else { if ( ! isTypeVariable ( ) && ! otherType . isTypeVariable ( ) ) { return ! isCompatibleWith ( otherType ) ; } } } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { if ( this == otherType ) return false ; if ( otherType == null ) return true ; switch ( kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; switch ( otherType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( paramType . genericType ( ) != otherParamType . genericType ( ) ) return true ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return true ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing . isProvablyDistinct ( otherEnclosing ) ) return true ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return true ; } } } int length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return true ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramType . arguments [ i ] . isProvablyDistinctTypeArgument ( otherArguments [ i ] , paramType , i ) ) return true ; } return false ; case Binding . GENERIC_TYPE : if ( paramType . genericType ( ) != otherType ) return true ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherType . enclosingType ( ) ; if ( otherEnclosing == null ) return true ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return true ; } else { if ( ! enclosing . isEquivalentTo ( otherType . enclosingType ( ) ) ) return true ; } } } length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; otherArguments = otherType . typeVariables ( ) ; otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return true ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramType . arguments [ i ] . isProvablyDistinctTypeArgument ( otherArguments [ i ] , paramType , i ) ) return true ; } return false ; case Binding . RAW_TYPE : return erasure ( ) != otherType . erasure ( ) ; case Binding . TYPE : return erasure ( ) != otherType ; } return true ; case Binding . RAW_TYPE : switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . TYPE : return erasure ( ) != otherType . erasure ( ) ; } return true ; case Binding . TYPE : switch ( otherType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return this != otherType . erasure ( ) ; } break ; default : break ; } return true ; } private boolean isProvablyDistinctTypeArgument ( TypeBinding otherArgument , final ParameterizedTypeBinding paramType , final int rank ) { if ( this == otherArgument ) return false ; TypeBinding upperBound1 = null ; TypeBinding lowerBound1 = null ; ReferenceBinding genericType = paramType . genericType ( ) ; switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; case Binding . INTERSECTION_TYPE : break ; case Binding . TYPE_PARAMETER : final TypeVariableBinding variable = ( TypeVariableBinding ) this ; if ( variable . isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) variable ; switch ( capture . wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = capture . wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = capture . wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } if ( variable . firstBound == null ) return false ; TypeBinding eliminatedType = Scope . convertEliminatingTypeVariables ( variable , genericType , rank , null ) ; switch ( eliminatedType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : wildcard = ( WildcardBinding ) eliminatedType ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound1 = wildcard . bound ; break ; case Wildcard . SUPER : lowerBound1 = wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } break ; } TypeBinding upperBound2 = null ; TypeBinding lowerBound2 = null ; switch ( otherArgument . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding otherWildcard = ( WildcardBinding ) otherArgument ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherWildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherWildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; case Binding . INTERSECTION_TYPE : break ; case Binding . TYPE_PARAMETER : TypeVariableBinding otherVariable = ( TypeVariableBinding ) otherArgument ; if ( otherVariable . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherVariable ; switch ( otherCapture . wildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherCapture . wildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherCapture . wildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } if ( otherVariable . firstBound == null ) return false ; TypeBinding otherEliminatedType = Scope . convertEliminatingTypeVariables ( otherVariable , genericType , rank , null ) ; switch ( otherEliminatedType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : otherWildcard = ( WildcardBinding ) otherEliminatedType ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : upperBound2 = otherWildcard . bound ; break ; case Wildcard . SUPER : lowerBound2 = otherWildcard . bound ; break ; case Wildcard . UNBOUND : return false ; } break ; } break ; } if ( lowerBound1 != null ) { if ( lowerBound2 != null ) { return false ; } else if ( upperBound2 != null ) { if ( lowerBound1 . isTypeVariable ( ) || upperBound2 . isTypeVariable ( ) ) { return false ; } return ! lowerBound1 . isCompatibleWith ( upperBound2 ) ; } else { if ( lowerBound1 . isTypeVariable ( ) || otherArgument . isTypeVariable ( ) ) { return false ; } return ! lowerBound1 . isCompatibleWith ( otherArgument ) ; } } else if ( upperBound1 != null ) { if ( lowerBound2 != null ) { return ! lowerBound2 . isCompatibleWith ( upperBound1 ) ; } else if ( upperBound2 != null ) { return upperBound1 . isProvableDistinctSubType ( upperBound2 ) && upperBound2 . isProvableDistinctSubType ( upperBound1 ) ; } else { return otherArgument . isProvableDistinctSubType ( upperBound1 ) ; } } else { if ( lowerBound2 != null ) { if ( lowerBound2 . isTypeVariable ( ) || isTypeVariable ( ) ) { return false ; } return ! lowerBound2 . isCompatibleWith ( this ) ; } else if ( upperBound2 != null ) { return isProvableDistinctSubType ( upperBound2 ) ; } else { return true ; } } } public final boolean isRawType ( ) { return kind ( ) == Binding . RAW_TYPE ; } public boolean isReifiable ( ) { TypeBinding leafType = leafComponentType ( ) ; if ( ! ( leafType instanceof ReferenceBinding ) ) return true ; ReferenceBinding current = ( ReferenceBinding ) leafType ; do { switch ( current . kind ( ) ) { case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . GENERIC_TYPE : return false ; case Binding . PARAMETERIZED_TYPE : if ( current . isBoundParameterizedType ( ) ) return false ; break ; case Binding . RAW_TYPE : return true ; } if ( current . isStatic ( ) ) { return true ; } if ( current . isLocalType ( ) ) { LocalTypeBinding localTypeBinding = ( LocalTypeBinding ) current . erasure ( ) ; MethodBinding enclosingMethod = localTypeBinding . enclosingMethod ; if ( enclosingMethod != null && enclosingMethod . isStatic ( ) ) { return true ; } } } while ( ( current = current . enclosingType ( ) ) != null ) ; return true ; } public boolean isThrowable ( ) { return false ; } public boolean isTypeArgumentContainedBy ( TypeBinding otherType ) { if ( this == otherType ) return true ; switch ( otherType . kind ( ) ) { case Binding . TYPE_PARAMETER : { if ( ! isParameterizedType ( ) || ! otherType . isCapture ( ) ) { return false ; } CaptureBinding capture = ( CaptureBinding ) otherType ; WildcardBinding wildcard = capture . wildcard ; TypeBinding upperBound = null ; TypeBinding [ ] otherBounds = null ; switch ( wildcard . boundKind ) { case Wildcard . SUPER : return false ; case Wildcard . UNBOUND : TypeVariableBinding variable = wildcard . genericType . typeVariables ( ) [ wildcard . rank ] ; upperBound = variable . upperBound ( ) ; otherBounds = variable . boundsCount ( ) > <NUM_LIT:1> ? variable . otherUpperBounds ( ) : null ; break ; case Wildcard . EXTENDS : upperBound = wildcard . bound ; otherBounds = wildcard . otherBounds ; break ; } if ( upperBound . id == TypeIds . T_JavaLangObject && otherBounds == null ) { return false ; } otherType = capture . environment . createWildcard ( null , <NUM_LIT:0> , upperBound , otherBounds , Wildcard . EXTENDS ) ; return isTypeArgumentContainedBy ( otherType ) ; } case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : TypeBinding lowerBound = this ; TypeBinding upperBound = this ; switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : if ( wildcard . otherBounds != null ) break ; upperBound = wildcard . bound ; lowerBound = null ; break ; case Wildcard . SUPER : upperBound = wildcard ; lowerBound = wildcard . bound ; break ; case Wildcard . UNBOUND : upperBound = wildcard ; lowerBound = null ; } break ; case Binding . TYPE_PARAMETER : if ( isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) this ; if ( capture . lowerBound != null ) lowerBound = capture . lowerBound ; } } WildcardBinding otherWildcard = ( WildcardBinding ) otherType ; if ( otherWildcard . otherBounds != null ) return false ; TypeBinding otherBound = otherWildcard . bound ; switch ( otherWildcard . boundKind ) { case Wildcard . EXTENDS : if ( otherBound == this ) return true ; if ( upperBound == null ) return false ; TypeBinding match = upperBound . findSuperTypeOriginatingFrom ( otherBound ) ; if ( match != null && ( match = match . leafComponentType ( ) ) . isRawType ( ) ) { return match == otherBound . leafComponentType ( ) ; } return upperBound . isCompatibleWith ( otherBound ) ; case Wildcard . SUPER : if ( otherBound == this ) return true ; if ( lowerBound == null ) return false ; match = otherBound . findSuperTypeOriginatingFrom ( lowerBound ) ; if ( match != null && ( match = match . leafComponentType ( ) ) . isRawType ( ) ) { return match == lowerBound . leafComponentType ( ) ; } return otherBound . isCompatibleWith ( lowerBound ) ; case Wildcard . UNBOUND : default : return true ; } case Binding . PARAMETERIZED_TYPE : if ( ! isParameterizedType ( ) ) return false ; ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) this ; ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( paramType . actualType ( ) != otherParamType . actualType ( ) ) return false ; if ( ! paramType . isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } int length = paramType . arguments == null ? <NUM_LIT:0> : paramType . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return false ; nextArgument : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = paramType . arguments [ i ] ; TypeBinding otherArgument = otherArguments [ i ] ; if ( argument == otherArgument ) continue nextArgument ; int kind = argument . kind ( ) ; if ( otherArgument . kind ( ) != kind ) return false ; switch ( kind ) { case Binding . PARAMETERIZED_TYPE : if ( argument . isTypeArgumentContainedBy ( otherArgument ) ) continue nextArgument ; break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) argument ; otherWildcard = ( WildcardBinding ) otherArgument ; switch ( wildcard . boundKind ) { case Wildcard . EXTENDS : if ( otherWildcard . boundKind == Wildcard . UNBOUND && wildcard . bound == wildcard . typeVariable ( ) . upperBound ( ) ) continue nextArgument ; break ; case Wildcard . SUPER : break ; case Wildcard . UNBOUND : if ( otherWildcard . boundKind == Wildcard . EXTENDS && otherWildcard . bound == otherWildcard . typeVariable ( ) . upperBound ( ) ) continue nextArgument ; break ; } break ; } return false ; } return true ; } if ( otherType . id == TypeIds . T_JavaLangObject ) { switch ( kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) this ; if ( wildcard . boundKind == Wildcard . SUPER && wildcard . bound . id == TypeIds . T_JavaLangObject ) { return true ; } break ; } } return false ; } public boolean isTypeVariable ( ) { return false ; } public boolean isUnboundWildcard ( ) { return false ; } public boolean isUncheckedException ( boolean includeSupertype ) { return false ; } public boolean isWildcard ( ) { return false ; } public int kind ( ) { return Binding . TYPE ; } public TypeBinding leafComponentType ( ) { return this ; } public boolean needsUncheckedConversion ( TypeBinding targetType ) { if ( this == targetType ) return false ; targetType = targetType . leafComponentType ( ) ; if ( ! ( targetType instanceof ReferenceBinding ) ) return false ; TypeBinding currentType = leafComponentType ( ) ; TypeBinding match = currentType . findSuperTypeOriginatingFrom ( targetType ) ; if ( ! ( match instanceof ReferenceBinding ) ) return false ; ReferenceBinding compatible = ( ReferenceBinding ) match ; while ( compatible . isRawType ( ) ) { if ( targetType . isBoundParameterizedType ( ) ) return true ; if ( compatible . isStatic ( ) ) break ; if ( ( compatible = compatible . enclosingType ( ) ) == null ) break ; if ( ( targetType = targetType . enclosingType ( ) ) == null ) break ; } return false ; } public TypeBinding original ( ) { switch ( kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . ARRAY_TYPE : return erasure ( ) ; default : return this ; } } public char [ ] qualifiedPackageName ( ) { PackageBinding packageBinding = getPackage ( ) ; return packageBinding == null || packageBinding . compoundName == CharOperation . NO_CHAR_CHAR ? CharOperation . NO_CHAR : packageBinding . readableName ( ) ; } public abstract char [ ] qualifiedSourceName ( ) ; public char [ ] signature ( ) { return constantPoolName ( ) ; } public abstract char [ ] sourceName ( ) ; public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment environment ) { } public TypeVariableBinding [ ] typeVariables ( ) { return Binding . NO_TYPE_VARIABLES ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class SyntheticMethodBinding extends MethodBinding { public FieldBinding targetReadField ; public FieldBinding targetWriteField ; public MethodBinding targetMethod ; public TypeBinding targetEnumType ; public int purpose ; public int startIndex ; public int endIndex ; public final static int FieldReadAccess = <NUM_LIT:1> ; public final static int FieldWriteAccess = <NUM_LIT:2> ; public final static int SuperFieldReadAccess = <NUM_LIT:3> ; public final static int SuperFieldWriteAccess = <NUM_LIT:4> ; public final static int MethodAccess = <NUM_LIT:5> ; public final static int ConstructorAccess = <NUM_LIT:6> ; public final static int SuperMethodAccess = <NUM_LIT:7> ; public final static int BridgeMethod = <NUM_LIT:8> ; public final static int EnumValues = <NUM_LIT:9> ; public final static int EnumValueOf = <NUM_LIT:10> ; public final static int SwitchTable = <NUM_LIT:11> ; public final static int TooManyEnumsConstants = <NUM_LIT:12> ; public int sourceStart = <NUM_LIT:0> ; public int index ; public SyntheticMethodBinding ( FieldBinding targetField , boolean isReadAccess , boolean isSuperAccess , ReferenceBinding declaringClass ) { this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) declaringClass ; SyntheticMethodBinding [ ] knownAccessMethods = declaringSourceType . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; this . selector = CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( methodId ) . toCharArray ( ) ) ; if ( isReadAccess ) { this . returnType = targetField . type ; if ( targetField . isStatic ( ) ) { this . parameters = Binding . NO_PARAMETERS ; } else { this . parameters = new TypeBinding [ <NUM_LIT:1> ] ; this . parameters [ <NUM_LIT:0> ] = declaringSourceType ; } this . targetReadField = targetField ; this . purpose = isSuperAccess ? SyntheticMethodBinding . SuperFieldReadAccess : SyntheticMethodBinding . FieldReadAccess ; } else { this . returnType = TypeBinding . VOID ; if ( targetField . isStatic ( ) ) { this . parameters = new TypeBinding [ <NUM_LIT:1> ] ; this . parameters [ <NUM_LIT:0> ] = targetField . type ; } else { this . parameters = new TypeBinding [ <NUM_LIT:2> ] ; this . parameters [ <NUM_LIT:0> ] = declaringSourceType ; this . parameters [ <NUM_LIT:1> ] = targetField . type ; } this . targetWriteField = targetField ; this . purpose = isSuperAccess ? SyntheticMethodBinding . SuperFieldWriteAccess : SyntheticMethodBinding . FieldWriteAccess ; } this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . declaringClass = declaringSourceType ; boolean needRename ; do { check : { needRename = false ; long range ; MethodBinding [ ] methods = declaringSourceType . methods ( ) ; if ( ( range = ReferenceBinding . binarySearch ( this . selector , methods ) ) >= <NUM_LIT:0> ) { int paramCount = this . parameters . length ; nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = methods [ imethod ] ; if ( method . parameters . length == paramCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { if ( toMatch [ i ] != this . parameters [ i ] ) { continue nextMethod ; } } needRename = true ; break check ; } } } if ( knownAccessMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownAccessMethods . length ; i < length ; i ++ ) { if ( knownAccessMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownAccessMethods [ i ] . selector ) && areParametersEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { setSelector ( CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( ++ methodId ) . toCharArray ( ) ) ) ; } } while ( needRename ) ; FieldDeclaration [ ] fieldDecls = declaringSourceType . scope . referenceContext . fields ; if ( fieldDecls != null ) { for ( int i = <NUM_LIT:0> , max = fieldDecls . length ; i < max ; i ++ ) { if ( fieldDecls [ i ] . binding == targetField ) { this . sourceStart = fieldDecls [ i ] . sourceStart ; return ; } } } this . sourceStart = declaringSourceType . scope . referenceContext . sourceStart ; } public SyntheticMethodBinding ( FieldBinding targetField , ReferenceBinding declaringClass , TypeBinding enumBinding , char [ ] selector ) { this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) declaringClass ; SyntheticMethodBinding [ ] knownAccessMethods = declaringSourceType . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; this . selector = selector ; this . returnType = declaringSourceType . scope . createArrayType ( TypeBinding . INT , <NUM_LIT:1> ) ; this . parameters = Binding . NO_PARAMETERS ; this . targetReadField = targetField ; this . targetEnumType = enumBinding ; this . purpose = SyntheticMethodBinding . SwitchTable ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . declaringClass = declaringSourceType ; if ( declaringSourceType . isStrictfp ( ) ) { this . modifiers |= ClassFileConstants . AccStrictfp ; } boolean needRename ; do { check : { needRename = false ; long range ; MethodBinding [ ] methods = declaringSourceType . methods ( ) ; if ( ( range = ReferenceBinding . binarySearch ( this . selector , methods ) ) >= <NUM_LIT:0> ) { int paramCount = this . parameters . length ; nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = methods [ imethod ] ; if ( method . parameters . length == paramCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int i = <NUM_LIT:0> ; i < paramCount ; i ++ ) { if ( toMatch [ i ] != this . parameters [ i ] ) { continue nextMethod ; } } needRename = true ; break check ; } } } if ( knownAccessMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownAccessMethods . length ; i < length ; i ++ ) { if ( knownAccessMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownAccessMethods [ i ] . selector ) && areParametersEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { setSelector ( CharOperation . concat ( selector , String . valueOf ( ++ methodId ) . toCharArray ( ) ) ) ; } } while ( needRename ) ; this . sourceStart = declaringSourceType . scope . referenceContext . sourceStart ; } public SyntheticMethodBinding ( MethodBinding targetMethod , boolean isSuperAccess , ReferenceBinding declaringClass ) { if ( targetMethod . isConstructor ( ) ) { initializeConstructorAccessor ( targetMethod ) ; } else { initializeMethodAccessor ( targetMethod , isSuperAccess , declaringClass ) ; } } public SyntheticMethodBinding ( MethodBinding overridenMethodToBridge , MethodBinding targetMethod , SourceTypeBinding declaringClass ) { this . declaringClass = declaringClass ; this . selector = overridenMethodToBridge . selector ; this . modifiers = ( targetMethod . modifiers | ClassFileConstants . AccBridge | ClassFileConstants . AccSynthetic ) & ~ ( ClassFileConstants . AccSynchronized | ClassFileConstants . AccAbstract | ClassFileConstants . AccNative | ClassFileConstants . AccFinal | ExtraCompilerModifiers . AccGenericSignature ) ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; this . returnType = overridenMethodToBridge . returnType ; this . parameters = overridenMethodToBridge . parameters ; this . thrownExceptions = overridenMethodToBridge . thrownExceptions ; this . targetMethod = targetMethod ; this . purpose = SyntheticMethodBinding . BridgeMethod ; SyntheticMethodBinding [ ] knownAccessMethods = declaringClass . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; } public SyntheticMethodBinding ( SourceTypeBinding declaringEnum , char [ ] selector ) { this . declaringClass = declaringEnum ; this . selector = selector ; this . modifiers = ClassFileConstants . AccPublic | ClassFileConstants . AccStatic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; LookupEnvironment environment = declaringEnum . scope . environment ( ) ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; if ( selector == TypeConstants . VALUES ) { this . returnType = environment . createArrayType ( environment . convertToParameterizedType ( declaringEnum ) , <NUM_LIT:1> ) ; this . parameters = Binding . NO_PARAMETERS ; this . purpose = SyntheticMethodBinding . EnumValues ; } else if ( selector == TypeConstants . VALUEOF ) { this . returnType = environment . convertToParameterizedType ( declaringEnum ) ; this . parameters = new TypeBinding [ ] { declaringEnum . scope . getJavaLangString ( ) } ; this . purpose = SyntheticMethodBinding . EnumValueOf ; } SyntheticMethodBinding [ ] knownAccessMethods = ( ( SourceTypeBinding ) this . declaringClass ) . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; if ( declaringEnum . isStrictfp ( ) ) { this . modifiers |= ClassFileConstants . AccStrictfp ; } } public SyntheticMethodBinding ( SourceTypeBinding declaringEnum , int startIndex , int endIndex ) { this . declaringClass = declaringEnum ; SyntheticMethodBinding [ ] knownAccessMethods = declaringEnum . syntheticMethods ( ) ; this . index = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( TypeConstants . SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX ) . append ( this . index ) ; this . selector = String . valueOf ( buffer ) . toCharArray ( ) ; this . modifiers = ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; this . purpose = SyntheticMethodBinding . TooManyEnumsConstants ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . returnType = TypeBinding . VOID ; this . parameters = Binding . NO_PARAMETERS ; this . startIndex = startIndex ; this . endIndex = endIndex ; } public SyntheticMethodBinding ( MethodBinding overridenMethodToBridge , SourceTypeBinding declaringClass ) { this . declaringClass = declaringClass ; this . selector = overridenMethodToBridge . selector ; this . modifiers = ( overridenMethodToBridge . modifiers | ClassFileConstants . AccBridge | ClassFileConstants . AccSynthetic ) & ~ ( ClassFileConstants . AccSynchronized | ClassFileConstants . AccAbstract | ClassFileConstants . AccNative | ClassFileConstants . AccFinal | ExtraCompilerModifiers . AccGenericSignature ) ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; this . returnType = overridenMethodToBridge . returnType ; this . parameters = overridenMethodToBridge . parameters ; this . thrownExceptions = overridenMethodToBridge . thrownExceptions ; this . targetMethod = overridenMethodToBridge ; this . purpose = SyntheticMethodBinding . SuperMethodAccess ; SyntheticMethodBinding [ ] knownAccessMethods = declaringClass . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; } public void initializeConstructorAccessor ( MethodBinding accessedConstructor ) { this . targetMethod = accessedConstructor ; this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding sourceType = ( SourceTypeBinding ) accessedConstructor . declaringClass ; SyntheticMethodBinding [ ] knownSyntheticMethods = sourceType . syntheticMethods ( ) ; this . index = knownSyntheticMethods == null ? <NUM_LIT:0> : knownSyntheticMethods . length ; this . selector = accessedConstructor . selector ; this . returnType = accessedConstructor . returnType ; this . purpose = SyntheticMethodBinding . ConstructorAccess ; final int parametersLength = accessedConstructor . parameters . length ; this . parameters = new TypeBinding [ parametersLength + <NUM_LIT:1> ] ; System . arraycopy ( accessedConstructor . parameters , <NUM_LIT:0> , this . parameters , <NUM_LIT:0> , parametersLength ) ; this . parameters [ parametersLength ] = accessedConstructor . declaringClass ; this . thrownExceptions = accessedConstructor . thrownExceptions ; this . declaringClass = sourceType ; boolean needRename ; do { check : { needRename = false ; MethodBinding [ ] methods = sourceType . methods ( ) ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { if ( CharOperation . equals ( this . selector , methods [ i ] . selector ) && areParameterErasuresEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } if ( knownSyntheticMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownSyntheticMethods . length ; i < length ; i ++ ) { if ( knownSyntheticMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownSyntheticMethods [ i ] . selector ) && areParameterErasuresEqual ( knownSyntheticMethods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { int length = this . parameters . length ; System . arraycopy ( this . parameters , <NUM_LIT:0> , this . parameters = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . parameters [ length ] = this . declaringClass ; } } while ( needRename ) ; AbstractMethodDeclaration [ ] methodDecls = sourceType . scope . referenceContext . methods ; if ( methodDecls != null ) { for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { if ( methodDecls [ i ] . binding == accessedConstructor ) { this . sourceStart = methodDecls [ i ] . sourceStart ; return ; } } } } public void initializeMethodAccessor ( MethodBinding accessedMethod , boolean isSuperAccess , ReferenceBinding receiverType ) { this . targetMethod = accessedMethod ; this . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic ; this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; SourceTypeBinding declaringSourceType = ( SourceTypeBinding ) receiverType ; SyntheticMethodBinding [ ] knownAccessMethods = declaringSourceType . syntheticMethods ( ) ; int methodId = knownAccessMethods == null ? <NUM_LIT:0> : knownAccessMethods . length ; this . index = methodId ; this . selector = CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( methodId ) . toCharArray ( ) ) ; this . returnType = accessedMethod . returnType ; this . purpose = isSuperAccess ? SyntheticMethodBinding . SuperMethodAccess : SyntheticMethodBinding . MethodAccess ; if ( accessedMethod . isStatic ( ) ) { this . parameters = accessedMethod . parameters ; } else { this . parameters = new TypeBinding [ accessedMethod . parameters . length + <NUM_LIT:1> ] ; this . parameters [ <NUM_LIT:0> ] = declaringSourceType ; System . arraycopy ( accessedMethod . parameters , <NUM_LIT:0> , this . parameters , <NUM_LIT:1> , accessedMethod . parameters . length ) ; } this . thrownExceptions = accessedMethod . thrownExceptions ; this . declaringClass = declaringSourceType ; boolean needRename ; do { check : { needRename = false ; MethodBinding [ ] methods = declaringSourceType . methods ( ) ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { if ( CharOperation . equals ( this . selector , methods [ i ] . selector ) && areParameterErasuresEqual ( methods [ i ] ) ) { needRename = true ; break check ; } } if ( knownAccessMethods != null ) { for ( int i = <NUM_LIT:0> , length = knownAccessMethods . length ; i < length ; i ++ ) { if ( knownAccessMethods [ i ] == null ) continue ; if ( CharOperation . equals ( this . selector , knownAccessMethods [ i ] . selector ) && areParameterErasuresEqual ( knownAccessMethods [ i ] ) ) { needRename = true ; break check ; } } } } if ( needRename ) { setSelector ( CharOperation . concat ( TypeConstants . SYNTHETIC_ACCESS_METHOD_PREFIX , String . valueOf ( ++ methodId ) . toCharArray ( ) ) ) ; } } while ( needRename ) ; AbstractMethodDeclaration [ ] methodDecls = declaringSourceType . scope . referenceContext . methods ; if ( methodDecls != null ) { for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { if ( methodDecls [ i ] . binding == accessedMethod ) { this . sourceStart = methodDecls [ i ] . sourceStart ; return ; } } } } protected boolean isConstructorRelated ( ) { return this . purpose == SyntheticMethodBinding . ConstructorAccess ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class UnresolvedReferenceBinding extends ReferenceBinding { ReferenceBinding resolvedType ; TypeBinding [ ] wrappers ; UnresolvedReferenceBinding ( char [ ] [ ] compoundName , PackageBinding packageBinding ) { this . compoundName = compoundName ; this . sourceName = compoundName [ compoundName . length - <NUM_LIT:1> ] ; this . fPackage = packageBinding ; this . wrappers = null ; } void addWrapper ( TypeBinding wrapper , LookupEnvironment environment ) { if ( this . resolvedType != null ) { wrapper . swapUnresolved ( this , this . resolvedType , environment ) ; return ; } if ( this . wrappers == null ) { this . wrappers = new TypeBinding [ ] { wrapper } ; } else { int length = this . wrappers . length ; System . arraycopy ( this . wrappers , <NUM_LIT:0> , this . wrappers = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . wrappers [ length ] = wrapper ; } } public String debugName ( ) { return toString ( ) ; } public boolean hasTypeBit ( int bit ) { return false ; } ReferenceBinding resolve ( LookupEnvironment environment , boolean convertGenericToRawType ) { ReferenceBinding targetType = this . resolvedType ; if ( targetType == null ) { targetType = this . fPackage . getType0 ( this . compoundName [ this . compoundName . length - <NUM_LIT:1> ] ) ; if ( targetType == this ) { targetType = environment . askForType ( this . compoundName ) ; } if ( targetType == null || targetType == this ) { if ( ( this . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> && ! environment . mayTolerateMissingType ) { environment . problemReporter . isClassPathCorrect ( this . compoundName , environment . unitBeingCompleted , environment . missingClassFileLocation ) ; } targetType = environment . createMissingType ( null , this . compoundName ) ; } setResolvedType ( targetType , environment ) ; } if ( convertGenericToRawType ) { targetType = ( ReferenceBinding ) environment . convertUnresolvedBinaryToRawType ( targetType ) ; } return targetType ; } void setResolvedType ( ReferenceBinding targetType , LookupEnvironment environment ) { if ( this . resolvedType == targetType ) return ; this . resolvedType = targetType ; if ( this . wrappers != null ) for ( int i = <NUM_LIT:0> , l = this . wrappers . length ; i < l ; i ++ ) this . wrappers [ i ] . swapUnresolved ( this , targetType , environment ) ; environment . updateCaches ( this , targetType ) ; } public String toString ( ) { return "<STR_LIT>" + ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; public class BlockScope extends Scope { public LocalVariableBinding [ ] locals ; public int localIndex ; public int startIndex ; public int offset ; public int maxOffset ; public BlockScope [ ] shiftScopes ; public Scope [ ] subscopes = new Scope [ <NUM_LIT:1> ] ; public int subscopeCount = <NUM_LIT:0> ; public CaseStatement enclosingCase ; public final static VariableBinding [ ] EmulationPathToImplicitThis = { } ; public final static VariableBinding [ ] NoEnclosingInstanceInConstructorCall = { } ; public final static VariableBinding [ ] NoEnclosingInstanceInStaticContext = { } ; public BlockScope ( BlockScope parent ) { this ( parent , true ) ; } public BlockScope ( BlockScope parent , boolean addToParentScope ) { this ( Scope . BLOCK_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ <NUM_LIT:5> ] ; if ( addToParentScope ) parent . addSubscope ( this ) ; this . startIndex = parent . localIndex ; } public BlockScope ( BlockScope parent , int variableCount ) { this ( Scope . BLOCK_SCOPE , parent ) ; this . locals = new LocalVariableBinding [ variableCount ] ; parent . addSubscope ( this ) ; this . startIndex = parent . localIndex ; } protected BlockScope ( int kind , Scope parent ) { super ( kind , parent ) ; } public final void addAnonymousType ( TypeDeclaration anonymousType , ReferenceBinding superBinding ) { ClassScope anonymousClassScope = new ClassScope ( this , anonymousType ) ; anonymousClassScope . buildAnonymousTypeBinding ( enclosingSourceType ( ) , superBinding ) ; } public final void addLocalType ( TypeDeclaration localType ) { ClassScope localTypeScope = new ClassScope ( this , localType ) ; addSubscope ( localTypeScope ) ; localTypeScope . buildLocalTypeBinding ( enclosingSourceType ( ) ) ; } public final void addLocalVariable ( LocalVariableBinding binding ) { checkAndSetModifiersForVariable ( binding ) ; if ( this . localIndex == this . locals . length ) System . arraycopy ( this . locals , <NUM_LIT:0> , ( this . locals = new LocalVariableBinding [ this . localIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . localIndex ) ; this . locals [ this . localIndex ++ ] = binding ; binding . declaringScope = this ; binding . id = outerMostMethodScope ( ) . analysisIndex ++ ; } public void addSubscope ( Scope childScope ) { if ( this . subscopeCount == this . subscopes . length ) System . arraycopy ( this . subscopes , <NUM_LIT:0> , ( this . subscopes = new Scope [ this . subscopeCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . subscopeCount ) ; this . subscopes [ this . subscopeCount ++ ] = childScope ; } public final boolean allowBlankFinalFieldAssignment ( FieldBinding binding ) { if ( enclosingReceiverType ( ) != binding . declaringClass ) return false ; MethodScope methodScope = methodScope ( ) ; if ( methodScope . isStatic != binding . isStatic ( ) ) return false ; return methodScope . isInsideInitializer ( ) || ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . isInitializationMethod ( ) ; } String basicToString ( int tab ) { String newLine = "<STR_LIT:n>" ; for ( int i = tab ; -- i >= <NUM_LIT:0> ; ) newLine += "<STR_LIT:t>" ; String s = newLine + "<STR_LIT>" ; newLine += "<STR_LIT:t>" ; s += newLine + "<STR_LIT>" ; for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) s += newLine + "<STR_LIT:t>" + this . locals [ i ] . toString ( ) ; s += newLine + "<STR_LIT>" + this . startIndex ; return s ; } private void checkAndSetModifiersForVariable ( LocalVariableBinding varBinding ) { int modifiers = varBinding . modifiers ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> && varBinding . declaration != null ) { problemReporter ( ) . duplicateModifierForVariable ( varBinding . declaration , this instanceof MethodScope ) ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; int unexpectedModifiers = ~ ClassFileConstants . AccFinal ; if ( ( realModifiers & unexpectedModifiers ) != <NUM_LIT:0> && varBinding . declaration != null ) { problemReporter ( ) . illegalModifierForVariable ( varBinding . declaration , this instanceof MethodScope ) ; } varBinding . modifiers = modifiers ; } void computeLocalVariablePositions ( int ilocal , int initOffset , CodeStream codeStream ) { this . offset = initOffset ; this . maxOffset = initOffset ; int maxLocals = this . localIndex ; boolean hasMoreVariables = ilocal < maxLocals ; int iscope = <NUM_LIT:0> , maxScopes = this . subscopeCount ; boolean hasMoreScopes = maxScopes > <NUM_LIT:0> ; while ( hasMoreVariables || hasMoreScopes ) { if ( hasMoreScopes && ( ! hasMoreVariables || ( this . subscopes [ iscope ] . startIndex ( ) <= ilocal ) ) ) { if ( this . subscopes [ iscope ] instanceof BlockScope ) { BlockScope subscope = ( BlockScope ) this . subscopes [ iscope ] ; int subOffset = subscope . shiftScopes == null ? this . offset : subscope . maxShiftedOffset ( ) ; subscope . computeLocalVariablePositions ( <NUM_LIT:0> , subOffset , codeStream ) ; if ( subscope . maxOffset > this . maxOffset ) this . maxOffset = subscope . maxOffset ; } hasMoreScopes = ++ iscope < maxScopes ; } else { LocalVariableBinding local = this . locals [ ilocal ] ; boolean generateCurrentLocalVar = ( local . useFlag > LocalVariableBinding . UNUSED && local . constant ( ) == Constant . NotAConstant ) ; if ( local . useFlag == LocalVariableBinding . UNUSED && ( local . declaration != null ) && ( ( local . declaration . bits & ASTNode . IsLocalDeclarationReachable ) != <NUM_LIT:0> ) ) { if ( ! ( local . declaration instanceof Argument ) ) problemReporter ( ) . unusedLocalVariable ( local . declaration ) ; } if ( ! generateCurrentLocalVar ) { if ( local . declaration != null && compilerOptions ( ) . preserveAllLocalVariables ) { generateCurrentLocalVar = true ; if ( local . useFlag == LocalVariableBinding . UNUSED ) local . useFlag = LocalVariableBinding . USED ; } } if ( generateCurrentLocalVar ) { if ( local . declaration != null ) { codeStream . record ( local ) ; } local . resolvedPosition = this . offset ; if ( ( local . type == TypeBinding . LONG ) || ( local . type == TypeBinding . DOUBLE ) ) { this . offset += <NUM_LIT:2> ; } else { this . offset ++ ; } if ( this . offset > <NUM_LIT> ) { problemReporter ( ) . noMoreAvailableSpaceForLocal ( local , local . declaration == null ? ( ASTNode ) methodScope ( ) . referenceContext : local . declaration ) ; } } else { local . resolvedPosition = - <NUM_LIT:1> ; } hasMoreVariables = ++ ilocal < maxLocals ; } } if ( this . offset > this . maxOffset ) this . maxOffset = this . offset ; } public void emulateOuterAccess ( LocalVariableBinding outerLocalVariable ) { BlockScope outerVariableScope = outerLocalVariable . declaringScope ; if ( outerVariableScope == null ) return ; MethodScope currentMethodScope = methodScope ( ) ; if ( outerVariableScope . methodScope ( ) != currentMethodScope ) { NestedTypeBinding currentType = ( NestedTypeBinding ) enclosingSourceType ( ) ; if ( ! currentType . isLocalType ( ) ) { return ; } if ( ! currentMethodScope . isInsideInitializerOrConstructor ( ) ) { currentType . addSyntheticArgumentAndField ( outerLocalVariable ) ; } else { currentType . addSyntheticArgument ( outerLocalVariable ) ; } } } public final ReferenceBinding findLocalType ( char [ ] name ) { long compliance = compilerOptions ( ) . complianceLevel ; for ( int i = this . subscopeCount - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { if ( this . subscopes [ i ] instanceof ClassScope ) { LocalTypeBinding sourceType = ( LocalTypeBinding ) ( ( ClassScope ) this . subscopes [ i ] ) . referenceContext . binding ; if ( compliance >= ClassFileConstants . JDK1_4 && sourceType . enclosingCase != null ) { if ( ! isInsideCase ( sourceType . enclosingCase ) ) { continue ; } } if ( CharOperation . equals ( sourceType . sourceName ( ) , name ) ) return sourceType ; } } return null ; } public LocalDeclaration [ ] findLocalVariableDeclarations ( int position ) { int ilocal = <NUM_LIT:0> , maxLocals = this . localIndex ; boolean hasMoreVariables = maxLocals > <NUM_LIT:0> ; LocalDeclaration [ ] localDeclarations = null ; int declPtr = <NUM_LIT:0> ; int iscope = <NUM_LIT:0> , maxScopes = this . subscopeCount ; boolean hasMoreScopes = maxScopes > <NUM_LIT:0> ; while ( hasMoreVariables || hasMoreScopes ) { if ( hasMoreScopes && ( ! hasMoreVariables || ( this . subscopes [ iscope ] . startIndex ( ) <= ilocal ) ) ) { Scope subscope = this . subscopes [ iscope ] ; if ( subscope . kind == Scope . BLOCK_SCOPE ) { localDeclarations = ( ( BlockScope ) subscope ) . findLocalVariableDeclarations ( position ) ; if ( localDeclarations != null ) { return localDeclarations ; } } hasMoreScopes = ++ iscope < maxScopes ; } else { LocalVariableBinding local = this . locals [ ilocal ] ; if ( local != null ) { LocalDeclaration localDecl = local . declaration ; if ( localDecl != null ) { if ( localDecl . declarationSourceStart <= position ) { if ( position <= localDecl . declarationSourceEnd ) { if ( localDeclarations == null ) { localDeclarations = new LocalDeclaration [ maxLocals ] ; } localDeclarations [ declPtr ++ ] = localDecl ; } } else { return localDeclarations ; } } } hasMoreVariables = ++ ilocal < maxLocals ; if ( ! hasMoreVariables && localDeclarations != null ) { return localDeclarations ; } } } return null ; } public LocalVariableBinding findVariable ( char [ ] variableName ) { int varLength = variableName . length ; for ( int i = this . localIndex - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { LocalVariableBinding local ; char [ ] localName ; if ( ( localName = ( local = this . locals [ i ] ) . name ) . length == varLength && CharOperation . equals ( localName , variableName ) ) return local ; } return null ; } public Binding getBinding ( char [ ] [ ] compoundName , int mask , InvocationSite invocationSite , boolean needResolve ) { Binding binding = getBinding ( compoundName [ <NUM_LIT:0> ] , mask | Binding . TYPE | Binding . PACKAGE , invocationSite , needResolve ) ; invocationSite . setFieldIndex ( <NUM_LIT:1> ) ; if ( binding instanceof VariableBinding ) return binding ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( compoundName ) ; if ( ! binding . isValidBinding ( ) ) return binding ; int length = compoundName . length ; int currentIndex = <NUM_LIT:1> ; foundType : if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { unitScope . recordReference ( packageBinding . compoundName , compoundName [ currentIndex ] ) ; binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; invocationSite . setFieldIndex ( currentIndex ) ; if ( binding == null ) { if ( currentIndex == length ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } if ( binding instanceof ReferenceBinding ) { if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( ! ( ( ReferenceBinding ) binding ) . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) binding , ProblemReasons . NotVisible ) ; break foundType ; } packageBinding = ( PackageBinding ) binding ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } ReferenceBinding referenceBinding = ( ReferenceBinding ) binding ; binding = environment ( ) . convertToRawType ( referenceBinding , false ) ; if ( invocationSite instanceof ASTNode ) { ASTNode invocationNode = ( ASTNode ) invocationSite ; if ( invocationNode . isTypeUseDeprecated ( referenceBinding , this ) ) { problemReporter ( ) . deprecatedType ( referenceBinding , invocationNode ) ; } } Binding problemFieldBinding = null ; while ( currentIndex < length ) { referenceBinding = ( ReferenceBinding ) binding ; char [ ] nextName = compoundName [ currentIndex ++ ] ; invocationSite . setFieldIndex ( currentIndex ) ; invocationSite . setActualReceiverType ( referenceBinding ) ; if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> && ( binding = findField ( referenceBinding , nextName , invocationSite , true ) ) != null ) { if ( binding . isValidBinding ( ) ) { break ; } problemFieldBinding = new ProblemFieldBinding ( ( ( ProblemFieldBinding ) binding ) . closestMatch , ( ( ProblemFieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , binding . problemId ( ) ) ; if ( binding . problemId ( ) != ProblemReasons . NotVisible ) { return problemFieldBinding ; } } if ( ( binding = findMemberType ( nextName , referenceBinding ) ) == null ) { if ( problemFieldBinding != null ) { return problemFieldBinding ; } if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> ) { return new ProblemFieldBinding ( null , referenceBinding , nextName , ProblemReasons . NotFound ) ; } else if ( ( mask & Binding . VARIABLE ) != <NUM_LIT:0> ) { return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , referenceBinding , ProblemReasons . NotFound ) ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , referenceBinding , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( problemFieldBinding != null ) { return problemFieldBinding ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; } if ( invocationSite instanceof ASTNode ) { referenceBinding = ( ReferenceBinding ) binding ; ASTNode invocationNode = ( ASTNode ) invocationSite ; if ( invocationNode . isTypeUseDeprecated ( referenceBinding , this ) ) { problemReporter ( ) . deprecatedType ( referenceBinding , invocationNode ) ; } } } if ( ( mask & Binding . FIELD ) != <NUM_LIT:0> && ( binding instanceof FieldBinding ) ) { FieldBinding field = ( FieldBinding ) binding ; if ( ! field . isStatic ( ) ) return new ProblemFieldBinding ( field , field . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NonStaticReferenceInStaticContext ) ; return binding ; } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> && ( binding instanceof ReferenceBinding ) ) { return binding ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } public final Binding getBinding ( char [ ] [ ] compoundName , InvocationSite invocationSite ) { int currentIndex = <NUM_LIT:0> ; int length = compoundName . length ; Binding binding = getBinding ( compoundName [ currentIndex ++ ] , Binding . VARIABLE | Binding . TYPE | Binding . PACKAGE , invocationSite , true ) ; if ( ! binding . isValidBinding ( ) ) return binding ; foundType : if ( binding instanceof PackageBinding ) { while ( currentIndex < length ) { PackageBinding packageBinding = ( PackageBinding ) binding ; binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { if ( currentIndex == length ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ProblemReasons . NotFound ) ; } if ( binding instanceof ReferenceBinding ) { if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; if ( ! ( ( ReferenceBinding ) binding ) . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) binding , ProblemReasons . NotVisible ) ; break foundType ; } } return binding ; } foundField : if ( binding instanceof ReferenceBinding ) { while ( currentIndex < length ) { ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; char [ ] nextName = compoundName [ currentIndex ++ ] ; TypeBinding receiverType = typeBinding . capture ( this , invocationSite . sourceEnd ( ) ) ; if ( ( binding = findField ( receiverType , nextName , invocationSite , true ) ) != null ) { if ( ! binding . isValidBinding ( ) ) { return new ProblemFieldBinding ( ( FieldBinding ) binding , ( ( FieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , binding . problemId ( ) ) ; } if ( ! ( ( FieldBinding ) binding ) . isStatic ( ) ) return new ProblemFieldBinding ( ( FieldBinding ) binding , ( ( FieldBinding ) binding ) . declaringClass , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NonStaticReferenceInStaticContext ) ; break foundField ; } if ( ( binding = findMemberType ( nextName , typeBinding ) ) == null ) { return new ProblemBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , binding . problemId ( ) ) ; } } return binding ; } VariableBinding variableBinding = ( VariableBinding ) binding ; while ( currentIndex < length ) { TypeBinding typeBinding = variableBinding . type ; if ( typeBinding == null ) { return new ProblemFieldBinding ( null , null , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NotFound ) ; } TypeBinding receiverType = typeBinding . capture ( this , invocationSite . sourceEnd ( ) ) ; variableBinding = findField ( receiverType , compoundName [ currentIndex ++ ] , invocationSite , true ) ; if ( variableBinding == null ) { return new ProblemFieldBinding ( null , receiverType instanceof ReferenceBinding ? ( ReferenceBinding ) receiverType : null , CharOperation . concatWith ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , '<CHAR_LIT:.>' ) , ProblemReasons . NotFound ) ; } if ( ! variableBinding . isValidBinding ( ) ) return variableBinding ; } return variableBinding ; } public VariableBinding [ ] getEmulationPath ( LocalVariableBinding outerLocalVariable ) { MethodScope currentMethodScope = methodScope ( ) ; SourceTypeBinding sourceType = currentMethodScope . enclosingSourceType ( ) ; BlockScope variableScope = outerLocalVariable . declaringScope ; if ( variableScope == null || currentMethodScope == variableScope . methodScope ( ) ) { return new VariableBinding [ ] { outerLocalVariable } ; } if ( currentMethodScope . isInsideInitializerOrConstructor ( ) && ( sourceType . isNestedType ( ) ) ) { SyntheticArgumentBinding syntheticArg ; if ( ( syntheticArg = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( outerLocalVariable ) ) != null ) { return new VariableBinding [ ] { syntheticArg } ; } } if ( ! currentMethodScope . isStatic ) { FieldBinding syntheticField ; if ( ( syntheticField = sourceType . getSyntheticField ( outerLocalVariable ) ) != null ) { return new VariableBinding [ ] { syntheticField } ; } } return null ; } public Object [ ] getEmulationPath ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch , boolean denyEnclosingArgInConstructorCall ) { MethodScope currentMethodScope = methodScope ( ) ; SourceTypeBinding sourceType = currentMethodScope . enclosingSourceType ( ) ; if ( ! currentMethodScope . isStatic && ! currentMethodScope . isConstructorCall ) { if ( sourceType == targetEnclosingType || ( ! onlyExactMatch && sourceType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) { return BlockScope . EmulationPathToImplicitThis ; } } if ( ! sourceType . isNestedType ( ) || sourceType . isStatic ( ) ) { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } else if ( currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } return null ; } boolean insideConstructor = currentMethodScope . isInsideInitializerOrConstructor ( ) ; if ( insideConstructor ) { SyntheticArgumentBinding syntheticArg ; if ( ( syntheticArg = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( targetEnclosingType , onlyExactMatch ) ) != null ) { if ( denyEnclosingArgInConstructorCall && currentMethodScope . isConstructorCall && ( sourceType == targetEnclosingType || ( ! onlyExactMatch && sourceType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } return new Object [ ] { syntheticArg } ; } } if ( currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } if ( sourceType . isAnonymousType ( ) ) { ReferenceBinding enclosingType = sourceType . enclosingType ( ) ; if ( enclosingType . isNestedType ( ) ) { NestedTypeBinding nestedEnclosingType = ( NestedTypeBinding ) enclosingType ; SyntheticArgumentBinding enclosingArgument = nestedEnclosingType . getSyntheticArgument ( nestedEnclosingType . enclosingType ( ) , onlyExactMatch ) ; if ( enclosingArgument != null ) { FieldBinding syntheticField = sourceType . getSyntheticField ( enclosingArgument ) ; if ( syntheticField != null ) { if ( syntheticField . type == targetEnclosingType || ( ! onlyExactMatch && ( ( ReferenceBinding ) syntheticField . type ) . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) return new Object [ ] { syntheticField } ; } } } } FieldBinding syntheticField = sourceType . getSyntheticField ( targetEnclosingType , onlyExactMatch ) ; if ( syntheticField != null ) { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } return new Object [ ] { syntheticField } ; } Object [ ] path = new Object [ <NUM_LIT:2> ] ; ReferenceBinding currentType = sourceType . enclosingType ( ) ; if ( insideConstructor ) { path [ <NUM_LIT:0> ] = ( ( NestedTypeBinding ) sourceType ) . getSyntheticArgument ( currentType , onlyExactMatch ) ; } else { if ( currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } path [ <NUM_LIT:0> ] = sourceType . getSyntheticField ( currentType , onlyExactMatch ) ; } if ( path [ <NUM_LIT:0> ] != null ) { int count = <NUM_LIT:1> ; ReferenceBinding currentEnclosingType ; while ( ( currentEnclosingType = currentType . enclosingType ( ) ) != null ) { if ( currentType == targetEnclosingType || ( ! onlyExactMatch && currentType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) break ; if ( currentMethodScope != null ) { currentMethodScope = currentMethodScope . enclosingMethodScope ( ) ; if ( currentMethodScope != null && currentMethodScope . isConstructorCall ) { return BlockScope . NoEnclosingInstanceInConstructorCall ; } if ( currentMethodScope != null && currentMethodScope . isStatic ) { return BlockScope . NoEnclosingInstanceInStaticContext ; } } syntheticField = ( ( NestedTypeBinding ) currentType ) . getSyntheticField ( currentEnclosingType , onlyExactMatch ) ; if ( syntheticField == null ) break ; if ( count == path . length ) { System . arraycopy ( path , <NUM_LIT:0> , ( path = new Object [ count + <NUM_LIT:1> ] ) , <NUM_LIT:0> , count ) ; } path [ count ++ ] = ( ( SourceTypeBinding ) syntheticField . declaringClass ) . addSyntheticMethod ( syntheticField , true , false ) ; currentType = currentEnclosingType ; } if ( currentType == targetEnclosingType || ( ! onlyExactMatch && currentType . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) ) { return path ; } } return null ; } public final boolean isDuplicateLocalVariable ( char [ ] name ) { BlockScope current = this ; while ( true ) { for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) { if ( CharOperation . equals ( name , current . locals [ i ] . name ) ) return true ; } if ( current . kind != Scope . BLOCK_SCOPE ) return false ; current = ( BlockScope ) current . parent ; } } public int maxShiftedOffset ( ) { int max = - <NUM_LIT:1> ; if ( this . shiftScopes != null ) { for ( int i = <NUM_LIT:0> , length = this . shiftScopes . length ; i < length ; i ++ ) { if ( this . shiftScopes [ i ] != null ) { int subMaxOffset = this . shiftScopes [ i ] . maxOffset ; if ( subMaxOffset > max ) max = subMaxOffset ; } } } return max ; } public final boolean needBlankFinalFieldInitializationCheck ( FieldBinding binding ) { boolean isStatic = binding . isStatic ( ) ; ReferenceBinding fieldDeclaringClass = binding . declaringClass ; MethodScope methodScope = methodScope ( ) ; while ( methodScope != null ) { if ( methodScope . isStatic != isStatic ) return false ; if ( ! methodScope . isInsideInitializer ( ) && ! ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . isInitializationMethod ( ) ) { return false ; } ReferenceBinding enclosingType = methodScope . enclosingReceiverType ( ) ; if ( enclosingType == fieldDeclaringClass ) { return true ; } if ( ! enclosingType . erasure ( ) . isAnonymousType ( ) ) { return false ; } methodScope = methodScope . enclosingMethodScope ( ) ; } return false ; } public ProblemReporter problemReporter ( ) { return methodScope ( ) . problemReporter ( ) ; } public void propagateInnerEmulation ( ReferenceBinding targetType , boolean isEnclosingInstanceSupplied ) { SyntheticArgumentBinding [ ] syntheticArguments ; if ( ( syntheticArguments = targetType . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { SyntheticArgumentBinding syntheticArg = syntheticArguments [ i ] ; if ( ! ( isEnclosingInstanceSupplied && ( syntheticArg . type == targetType . enclosingType ( ) ) ) ) { emulateOuterAccess ( syntheticArg . actualOuterLocalVariable ) ; } } } } public TypeDeclaration referenceType ( ) { return methodScope ( ) . referenceType ( ) ; } public int scopeIndex ( ) { if ( this instanceof MethodScope ) return - <NUM_LIT:1> ; BlockScope parentScope = ( BlockScope ) this . parent ; Scope [ ] parentSubscopes = parentScope . subscopes ; for ( int i = <NUM_LIT:0> , max = parentScope . subscopeCount ; i < max ; i ++ ) { if ( parentSubscopes [ i ] == this ) return i ; } return - <NUM_LIT:1> ; } int startIndex ( ) { return this . startIndex ; } public String toString ( ) { return toString ( <NUM_LIT:0> ) ; } public String toString ( int tab ) { String s = basicToString ( tab ) ; for ( int i = <NUM_LIT:0> ; i < this . subscopeCount ; i ++ ) if ( this . subscopes [ i ] instanceof BlockScope ) s += ( ( BlockScope ) this . subscopes [ i ] ) . toString ( tab + <NUM_LIT:1> ) + "<STR_LIT:n>" ; return s ; } public void resetEnclosingMethodStaticFlag ( ) { MethodScope methodScope = methodScope ( ) ; if ( methodScope != null ) { if ( methodScope . referenceContext instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( MethodDeclaration ) methodScope . referenceContext ; methodDeclaration . bits &= ~ ASTNode . CanBeStatic ; } else if ( methodScope . referenceContext instanceof TypeDeclaration ) { methodScope = methodScope . enclosingMethodScope ( ) ; if ( methodScope != null && methodScope . referenceContext instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( MethodDeclaration ) methodScope . referenceContext ; methodDeclaration . bits &= ~ ASTNode . CanBeStatic ; } } } } public void resetDeclaringClassMethodStaticFlag ( TypeBinding declaringClass ) { MethodScope methodScope = methodScope ( ) ; if ( methodScope != null && methodScope . referenceContext instanceof TypeDeclaration ) { methodScope = methodScope . enclosingMethodScope ( ) ; } while ( methodScope != null && methodScope . referenceContext instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( MethodDeclaration ) methodScope . referenceContext ; methodDeclaration . bits &= ~ ASTNode . CanBeStatic ; ClassScope enclosingClassScope = methodScope . enclosingClassScope ( ) ; if ( enclosingClassScope != null ) { TypeDeclaration type = enclosingClassScope . referenceContext ; if ( type != null && type . binding != null && declaringClass != null && type . binding != declaringClass . original ( ) ) { methodScope = enclosingClassScope . enclosingMethodScope ( ) ; } else { break ; } } else { break ; } } } private List trackingVariables ; public FlowInfo finallyInfo ; public int registerTrackingVariable ( FakedTrackingVariable fakedTrackingVariable ) { if ( this . trackingVariables == null ) this . trackingVariables = new ArrayList ( <NUM_LIT:3> ) ; this . trackingVariables . add ( fakedTrackingVariable ) ; MethodScope outerMethodScope = outerMostMethodScope ( ) ; return outerMethodScope . analysisIndex ++ ; } public void removeTrackingVar ( FakedTrackingVariable trackingVariable ) { if ( trackingVariable . innerTracker != null ) { removeTrackingVar ( trackingVariable . innerTracker ) ; trackingVariable . innerTracker = null ; } if ( this . trackingVariables != null ) if ( this . trackingVariables . remove ( trackingVariable ) ) return ; if ( this . parent instanceof BlockScope ) ( ( BlockScope ) this . parent ) . removeTrackingVar ( trackingVariable ) ; } public void pruneWrapperTrackingVar ( FakedTrackingVariable trackingVariable ) { this . trackingVariables . remove ( trackingVariable ) ; } public void checkUnclosedCloseables ( FlowInfo flowInfo , FlowContext flowContext , ASTNode location , BlockScope locationScope ) { if ( ! compilerOptions ( ) . analyseResourceLeaks ) return ; if ( this . trackingVariables == null ) { if ( location != null && this . parent instanceof BlockScope ) ( ( BlockScope ) this . parent ) . checkUnclosedCloseables ( flowInfo , flowContext , location , locationScope ) ; return ; } if ( location != null && flowInfo . reachMode ( ) != <NUM_LIT:0> ) return ; FakedTrackingVariable returnVar = ( location instanceof ReturnStatement ) ? FakedTrackingVariable . getCloseTrackingVariable ( ( ( ReturnStatement ) location ) . expression ) : null ; Set varSet = new HashSet ( this . trackingVariables ) ; FakedTrackingVariable trackingVar ; while ( ( trackingVar = FakedTrackingVariable . pickVarForReporting ( varSet , this , location != null ) ) != null ) { if ( returnVar != null && trackingVar . isResourceBeingReturned ( returnVar ) ) { continue ; } if ( location != null && trackingVar . hasDefinitelyNoResource ( flowInfo ) ) { continue ; } if ( location != null && flowContext != null && flowContext . recordExitAgainstResource ( this , flowInfo , trackingVar , location ) ) { continue ; } int status = trackingVar . findMostSpecificStatus ( flowInfo , this , locationScope ) ; if ( status == FlowInfo . NULL ) { reportResourceLeak ( trackingVar , location , status ) ; continue ; } if ( location == null ) { if ( trackingVar . reportRecordedErrors ( this , status ) ) continue ; } if ( status == FlowInfo . POTENTIALLY_NULL ) { reportResourceLeak ( trackingVar , location , status ) ; } else if ( status == FlowInfo . NON_NULL ) { if ( environment ( ) . globalOptions . complianceLevel >= ClassFileConstants . JDK1_7 ) trackingVar . reportExplicitClosing ( problemReporter ( ) ) ; } } if ( location == null ) { for ( int i = <NUM_LIT:0> ; i < this . localIndex ; i ++ ) this . locals [ i ] . closeTracker = null ; this . trackingVariables = null ; } else { int size = this . trackingVariables . size ( ) ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { FakedTrackingVariable tracker = ( FakedTrackingVariable ) this . trackingVariables . get ( <NUM_LIT:0> ) ; tracker . resetReportingBits ( ) ; } } } private void reportResourceLeak ( FakedTrackingVariable trackingVar , ASTNode location , int nullStatus ) { if ( location != null ) trackingVar . recordErrorLocation ( location , nullStatus ) ; else trackingVar . reportError ( problemReporter ( ) , null , nullStatus ) ; } public void correlateTrackingVarsIfElse ( FlowInfo thenFlowInfo , FlowInfo elseFlowInfo ) { if ( this . trackingVariables != null ) { for ( int i = <NUM_LIT:0> ; i < this . trackingVariables . size ( ) ; i ++ ) { FakedTrackingVariable trackingVar = ( FakedTrackingVariable ) this . trackingVariables . get ( i ) ; if ( trackingVar . originalBinding == null ) continue ; if ( thenFlowInfo . isDefinitelyNonNull ( trackingVar . binding ) && elseFlowInfo . isDefinitelyNull ( trackingVar . originalBinding ) ) { elseFlowInfo . markAsDefinitelyNonNull ( trackingVar . binding ) ; } else if ( elseFlowInfo . isDefinitelyNonNull ( trackingVar . binding ) && thenFlowInfo . isDefinitelyNull ( trackingVar . originalBinding ) ) { thenFlowInfo . markAsDefinitelyNonNull ( trackingVar . binding ) ; } } } if ( this . parent instanceof BlockScope ) ( ( BlockScope ) this . parent ) . correlateTrackingVarsIfElse ( thenFlowInfo , elseFlowInfo ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; private MethodBinding tiebreakMethod ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { ParameterizedGenericMethodBinding methodSubstitute ; TypeVariableBinding [ ] typeVariables = originalMethod . typeVariables ; TypeBinding [ ] substitutes = invocationSite . genericTypeArguments ( ) ; InferenceContext inferenceContext = null ; TypeBinding [ ] uncheckedArguments = null ; computeSubstitutes : { if ( substitutes != null ) { if ( substitutes . length != typeVariables . length ) { return new ProblemMethodBinding ( originalMethod , originalMethod . selector , substitutes , ProblemReasons . TypeParameterArityMismatch ) ; } methodSubstitute = scope . environment ( ) . createParameterizedGenericMethod ( originalMethod , substitutes ) ; break computeSubstitutes ; } TypeBinding [ ] parameters = originalMethod . parameters ; inferenceContext = new InferenceContext ( originalMethod ) ; methodSubstitute = inferFromArgumentTypes ( scope , originalMethod , arguments , parameters , inferenceContext ) ; if ( methodSubstitute == null ) return null ; if ( inferenceContext . hasUnresolvedTypeArgument ( ) ) { if ( inferenceContext . isUnchecked ) { int length = inferenceContext . substitutes . length ; System . arraycopy ( inferenceContext . substitutes , <NUM_LIT:0> , uncheckedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } if ( methodSubstitute . returnType != TypeBinding . VOID ) { TypeBinding expectedType = invocationSite . expectedType ( ) ; if ( expectedType != null ) { inferenceContext . hasExplicitExpectedType = true ; } else { expectedType = scope . getJavaLangObject ( ) ; } inferenceContext . expectedType = expectedType ; } methodSubstitute = methodSubstitute . inferFromExpectedType ( scope , inferenceContext ) ; if ( methodSubstitute == null ) return null ; } } Substitution substitution = null ; if ( inferenceContext != null ) { substitution = new LingeringTypeVariableEliminator ( typeVariables , inferenceContext . substitutes , scope ) ; } else { substitution = methodSubstitute ; } for ( int i = <NUM_LIT:0> , length = typeVariables . length ; i < length ; i ++ ) { TypeVariableBinding typeVariable = typeVariables [ i ] ; TypeBinding substitute = methodSubstitute . typeArguments [ i ] ; TypeBinding substituteForChecks ; if ( substitute instanceof TypeVariableBinding ) { substituteForChecks = substitute ; } else { substituteForChecks = Scope . substitute ( new LingeringTypeVariableEliminator ( typeVariables , null , scope ) , substitute ) ; } if ( uncheckedArguments != null && uncheckedArguments [ i ] == null ) continue ; switch ( typeVariable . boundCheck ( substitution , substituteForChecks ) ) { case TypeConstants . MISMATCH : int argLength = arguments . length ; TypeBinding [ ] augmentedArguments = new TypeBinding [ argLength + <NUM_LIT:2> ] ; System . arraycopy ( arguments , <NUM_LIT:0> , augmentedArguments , <NUM_LIT:0> , argLength ) ; augmentedArguments [ argLength ] = substitute ; augmentedArguments [ argLength + <NUM_LIT:1> ] = typeVariable ; return new ProblemMethodBinding ( methodSubstitute , originalMethod . selector , augmentedArguments , ProblemReasons . ParameterBoundMismatch ) ; case TypeConstants . UNCHECKED : methodSubstitute . tagBits |= TagBits . HasUncheckedTypeArgumentForBoundCheck ; break ; } } return methodSubstitute ; } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , InferenceContext inferenceContext ) { if ( originalMethod . isVarargs ( ) ) { int paramLength = parameters . length ; int minArgLength = paramLength - <NUM_LIT:1> ; int argLength = arguments . length ; for ( int i = <NUM_LIT:0> ; i < minArgLength ; i ++ ) { parameters [ i ] . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } if ( minArgLength < argLength ) { TypeBinding varargType = parameters [ minArgLength ] ; TypeBinding lastArgument = arguments [ minArgLength ] ; checkVarargDimension : { if ( paramLength == argLength ) { if ( lastArgument == TypeBinding . NULL ) break checkVarargDimension ; switch ( lastArgument . dimensions ( ) ) { case <NUM_LIT:0> : break ; case <NUM_LIT:1> : if ( ! lastArgument . leafComponentType ( ) . isBaseType ( ) ) break checkVarargDimension ; break ; default : break checkVarargDimension ; } } varargType = ( ( ArrayBinding ) varargType ) . elementsType ( ) ; } for ( int i = minArgLength ; i < argLength ; i ++ ) { varargType . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } } else { int paramLength = parameters . length ; for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { parameters [ i ] . collectSubstitutes ( scope , arguments [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; if ( ! resolveSubstituteConstraints ( scope , originalVariables , inferenceContext , false ) ) return null ; TypeBinding [ ] inferredSustitutes = inferenceContext . substitutes ; TypeBinding [ ] actualSubstitutes = inferredSustitutes ; for ( int i = <NUM_LIT:0> , varLength = originalVariables . length ; i < varLength ; i ++ ) { if ( inferredSustitutes [ i ] == null ) { if ( actualSubstitutes == inferredSustitutes ) { System . arraycopy ( inferredSustitutes , <NUM_LIT:0> , actualSubstitutes = new TypeBinding [ varLength ] , <NUM_LIT:0> , i ) ; } actualSubstitutes [ i ] = originalVariables [ i ] ; } else if ( actualSubstitutes != inferredSustitutes ) { actualSubstitutes [ i ] = inferredSustitutes [ i ] ; } } ParameterizedGenericMethodBinding paramMethod = scope . environment ( ) . createParameterizedGenericMethod ( originalMethod , actualSubstitutes ) ; return paramMethod ; } private static boolean resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , InferenceContext inferenceContext , boolean considerEXTENDSConstraints ) { TypeBinding [ ] substitutes = inferenceContext . substitutes ; int varLength = typeVariables . length ; nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] equalSubstitutes = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_EQUAL ) ; if ( equalSubstitutes != null ) { nextConstraint : for ( int j = <NUM_LIT:0> , equalLength = equalSubstitutes . length ; j < equalLength ; j ++ ) { TypeBinding equalSubstitute = equalSubstitutes [ j ] ; if ( equalSubstitute == null ) continue nextConstraint ; if ( equalSubstitute == current ) { for ( int k = j + <NUM_LIT:1> ; k < equalLength ; k ++ ) { equalSubstitute = equalSubstitutes [ k ] ; if ( equalSubstitute != current && equalSubstitute != null ) { substitutes [ i ] = equalSubstitute ; continue nextTypeParameter ; } } substitutes [ i ] = current ; continue nextTypeParameter ; } substitutes [ i ] = equalSubstitute ; continue nextTypeParameter ; } } } if ( inferenceContext . hasUnresolvedTypeArgument ( ) ) { nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] bounds = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_SUPER ) ; if ( bounds == null ) continue nextTypeParameter ; TypeBinding mostSpecificSubstitute = scope . lowerUpperBound ( bounds ) ; if ( mostSpecificSubstitute == null ) { return false ; } if ( mostSpecificSubstitute != TypeBinding . VOID ) { substitutes [ i ] = mostSpecificSubstitute ; } } } if ( considerEXTENDSConstraints && inferenceContext . hasUnresolvedTypeArgument ( ) ) { nextTypeParameter : for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding current = typeVariables [ i ] ; TypeBinding substitute = substitutes [ i ] ; if ( substitute != null ) continue nextTypeParameter ; TypeBinding [ ] bounds = inferenceContext . getSubstitutes ( current , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( bounds == null ) continue nextTypeParameter ; TypeBinding [ ] glb = Scope . greaterLowerBound ( bounds ) ; TypeBinding mostSpecificSubstitute = null ; if ( glb != null ) { if ( glb . length == <NUM_LIT:1> ) { mostSpecificSubstitute = glb [ <NUM_LIT:0> ] ; } else { TypeBinding [ ] otherBounds = new TypeBinding [ glb . length - <NUM_LIT:1> ] ; System . arraycopy ( glb , <NUM_LIT:1> , otherBounds , <NUM_LIT:0> , glb . length - <NUM_LIT:1> ) ; mostSpecificSubstitute = scope . environment ( ) . createWildcard ( null , <NUM_LIT:0> , glb [ <NUM_LIT:0> ] , otherBounds , Wildcard . EXTENDS ) ; } } if ( mostSpecificSubstitute != null ) { substitutes [ i ] = mostSpecificSubstitute ; } } } return true ; } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; int length = originalVariables . length ; TypeBinding [ ] rawArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { rawArguments [ i ] = environment . convertToRawType ( originalVariables [ i ] . erasure ( ) , false ) ; } this . isRaw = true ; this . tagBits = originalMethod . tagBits ; this . environment = environment ; this . modifiers = originalMethod . modifiers ; this . selector = originalMethod . selector ; this . declaringClass = rawType == null ? originalMethod . declaringClass : rawType ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . typeArguments = rawArguments ; this . originalMethod = originalMethod ; boolean ignoreRawTypeSubstitution = rawType == null || originalMethod . isStatic ( ) ; this . parameters = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . parameters : Scope . substitute ( rawType , originalMethod . parameters ) ) ; this . thrownExceptions = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . thrownExceptions : Scope . substitute ( rawType , originalMethod . thrownExceptions ) ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; this . returnType = Scope . substitute ( this , ignoreRawTypeSubstitution ? originalMethod . returnType : Scope . substitute ( rawType , originalMethod . returnType ) ) ; this . wasInferred = false ; this . parameterNonNullness = originalMethod . parameterNonNullness ; } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { this . environment = environment ; this . modifiers = originalMethod . modifiers ; this . selector = originalMethod . selector ; this . declaringClass = originalMethod . declaringClass ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . typeArguments = typeArguments ; this . isRaw = false ; this . tagBits = originalMethod . tagBits ; this . originalMethod = originalMethod ; this . parameters = Scope . substitute ( this , originalMethod . parameters ) ; this . returnType = Scope . substitute ( this , originalMethod . returnType ) ; this . thrownExceptions = Scope . substitute ( this , originalMethod . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } this . wasInferred = true ; this . parameterNonNullness = originalMethod . parameterNonNullness ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . originalMethod . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( '<CHAR_LIT>' ) ; if ( ! this . isRaw ) { int length = this . typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding typeArgument = this . typeArguments [ i ] ; buffer . append ( typeArgument . computeUniqueKey ( false ) ) ; } } buffer . append ( '<CHAR_LIT:>>' ) ; int resultLength = buffer . length ( ) ; char [ ] result = new char [ resultLength ] ; buffer . getChars ( <NUM_LIT:0> , resultLength , result , <NUM_LIT:0> ) ; return result ; } public LookupEnvironment environment ( ) { return this . environment ; } public boolean hasSubstitutedParameters ( ) { if ( this . wasInferred ) return this . originalMethod . hasSubstitutedParameters ( ) ; return super . hasSubstitutedParameters ( ) ; } public boolean hasSubstitutedReturnType ( ) { if ( this . inferredReturnType ) return this . originalMethod . hasSubstitutedReturnType ( ) ; return super . hasSubstitutedReturnType ( ) ; } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , InferenceContext inferenceContext ) { TypeVariableBinding [ ] originalVariables = this . originalMethod . typeVariables ; int varLength = originalVariables . length ; if ( inferenceContext . expectedType != null ) { this . returnType . collectSubstitutes ( scope , inferenceContext . expectedType , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeVariableBinding originalVariable = originalVariables [ i ] ; TypeBinding argument = this . typeArguments [ i ] ; boolean argAlreadyInferred = argument != originalVariable ; if ( originalVariable . firstBound == originalVariable . superclass ) { TypeBinding substitutedBound = Scope . substitute ( this , originalVariable . superclass ) ; argument . collectSubstitutes ( scope , substitutedBound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; if ( argAlreadyInferred ) { substitutedBound . collectSubstitutes ( scope , argument , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } for ( int j = <NUM_LIT:0> , max = originalVariable . superInterfaces . length ; j < max ; j ++ ) { TypeBinding substitutedBound = Scope . substitute ( this , originalVariable . superInterfaces [ j ] ) ; argument . collectSubstitutes ( scope , substitutedBound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; if ( argAlreadyInferred ) { substitutedBound . collectSubstitutes ( scope , argument , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; if ( inferenceContext . status == InferenceContext . FAILED ) return null ; } } } if ( ! resolveSubstituteConstraints ( scope , originalVariables , inferenceContext , true ) ) return null ; for ( int i = <NUM_LIT:0> ; i < varLength ; i ++ ) { TypeBinding substitute = inferenceContext . substitutes [ i ] ; if ( substitute != null ) { this . typeArguments [ i ] = substitute ; } else { this . typeArguments [ i ] = inferenceContext . substitutes [ i ] = originalVariables [ i ] . upperBound ( ) ; } } this . typeArguments = Scope . substitute ( this , this . typeArguments ) ; TypeBinding oldReturnType = this . returnType ; this . returnType = Scope . substitute ( this , this . returnType ) ; this . inferredReturnType = inferenceContext . hasExplicitExpectedType && this . returnType != oldReturnType ; this . parameters = Scope . substitute ( this , this . parameters ) ; this . thrownExceptions = Scope . substitute ( this , this . thrownExceptions ) ; if ( this . thrownExceptions == null ) this . thrownExceptions = Binding . NO_EXCEPTIONS ; checkMissingType : { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) break checkMissingType ; if ( ( this . returnType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } for ( int i = <NUM_LIT:0> , max = this . parameters . length ; i < max ; i ++ ) { if ( ( this . parameters [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } for ( int i = <NUM_LIT:0> , max = this . thrownExceptions . length ; i < max ; i ++ ) { if ( ( this . thrownExceptions [ i ] . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . HasMissingType ; break checkMissingType ; } } } return this ; } private static class LingeringTypeVariableEliminator implements Substitution { final private TypeVariableBinding [ ] variables ; final private TypeBinding [ ] substitutes ; final private Scope scope ; public LingeringTypeVariableEliminator ( TypeVariableBinding [ ] variables , TypeBinding [ ] substitutes , Scope scope ) { this . variables = variables ; this . substitutes = substitutes ; this . scope = scope ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { if ( typeVariable . rank >= this . variables . length || this . variables [ typeVariable . rank ] != typeVariable ) { return typeVariable ; } if ( this . substitutes != null ) { return Scope . substitute ( new LingeringTypeVariableEliminator ( this . variables , null , this . scope ) , this . substitutes [ typeVariable . rank ] ) ; } ReferenceBinding genericType = ( ReferenceBinding ) ( typeVariable . declaringElement instanceof ReferenceBinding ? typeVariable . declaringElement : null ) ; return this . scope . environment ( ) . createWildcard ( genericType , typeVariable . rank , null , null , Wildcard . UNBOUND ) ; } public LookupEnvironment environment ( ) { return this . scope . environment ( ) ; } public boolean isRawSubstitution ( ) { return false ; } } public boolean isRawSubstitution ( ) { return this . isRaw ; } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { TypeVariableBinding [ ] variables = this . originalMethod . typeVariables ; int length = variables . length ; if ( originalVariable . rank < length && variables [ originalVariable . rank ] == originalVariable ) { return this . typeArguments [ originalVariable . rank ] ; } return originalVariable ; } public MethodBinding tiebreakMethod ( ) { if ( this . tiebreakMethod == null ) this . tiebreakMethod = this . originalMethod . asRawMethod ( this . environment ) ; return this . tiebreakMethod ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . CompoundNameVector ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . HashtableOfType ; import org . eclipse . jdt . internal . compiler . util . ObjectVector ; import org . eclipse . jdt . internal . compiler . util . SimpleNameVector ; public class CompilationUnitScope extends Scope { public LookupEnvironment environment ; public CompilationUnitDeclaration referenceContext ; public char [ ] [ ] currentPackageName ; public PackageBinding fPackage ; public ImportBinding [ ] imports ; public int importPtr ; public HashtableOfObject typeOrPackageCache ; public SourceTypeBinding [ ] topLevelTypes ; private CompoundNameVector qualifiedReferences ; private SimpleNameVector simpleNameReferences ; private SimpleNameVector rootReferences ; private ObjectVector referencedTypes ; private ObjectVector referencedSuperTypes ; HashtableOfType constantPoolNameUsage ; private int captureID = <NUM_LIT:1> ; private ImportBinding [ ] tempImports ; public CompilationUnitScope ( CompilationUnitDeclaration unit , LookupEnvironment environment ) { super ( COMPILATION_UNIT_SCOPE , null ) ; this . environment = environment ; this . referenceContext = unit ; unit . scope = this ; this . currentPackageName = unit . currentPackage == null ? CharOperation . NO_CHAR_CHAR : unit . currentPackage . tokens ; if ( compilerOptions ( ) . produceReferenceInfo ) { this . qualifiedReferences = new CompoundNameVector ( ) ; this . simpleNameReferences = new SimpleNameVector ( ) ; this . rootReferences = new SimpleNameVector ( ) ; this . referencedTypes = new ObjectVector ( ) ; this . referencedSuperTypes = new ObjectVector ( ) ; } else { this . qualifiedReferences = null ; this . simpleNameReferences = null ; this . rootReferences = null ; this . referencedTypes = null ; this . referencedSuperTypes = null ; } } void buildFieldsAndMethods ( ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . scope . buildFieldsAndMethods ( ) ; } protected boolean reportPackageIsNotExpectedPackage ( CompilationUnitDeclaration referenceContext ) { problemReporter ( ) . packageIsNotExpectedPackage ( referenceContext ) ; return true ; } void buildTypeBindings ( AccessRestriction accessRestriction ) { this . topLevelTypes = new SourceTypeBinding [ <NUM_LIT:0> ] ; boolean firstIsSynthetic = false ; if ( this . referenceContext . compilationResult . compilationUnit != null ) { char [ ] [ ] expectedPackageName = this . referenceContext . compilationResult . compilationUnit . getPackageName ( ) ; if ( expectedPackageName != null && ! CharOperation . equals ( this . currentPackageName , expectedPackageName ) ) { boolean errorReported = true ; if ( this . referenceContext . currentPackage != null || this . referenceContext . types != null || this . referenceContext . imports != null ) { errorReported = reportPackageIsNotExpectedPackage ( this . referenceContext ) ; } if ( errorReported ) { this . currentPackageName = expectedPackageName . length == <NUM_LIT:0> ? CharOperation . NO_CHAR_CHAR : expectedPackageName ; } } } if ( this . currentPackageName == CharOperation . NO_CHAR_CHAR ) { this . fPackage = this . environment . defaultPackage ; } else { if ( ( this . fPackage = this . environment . createPackage ( this . currentPackageName ) ) == null ) { if ( this . referenceContext . currentPackage != null ) { problemReporter ( ) . packageCollidesWithType ( this . referenceContext ) ; } this . fPackage = this . environment . defaultPackage ; return ; } else if ( this . referenceContext . isPackageInfo ( ) ) { if ( this . referenceContext . types == null || this . referenceContext . types . length == <NUM_LIT:0> ) { this . referenceContext . types = new TypeDeclaration [ <NUM_LIT:1> ] ; this . referenceContext . createPackageInfoType ( ) ; firstIsSynthetic = true ; } if ( this . referenceContext . currentPackage != null && this . referenceContext . currentPackage . annotations != null ) { this . referenceContext . types [ <NUM_LIT:0> ] . annotations = this . referenceContext . currentPackage . annotations ; } } recordQualifiedReference ( this . currentPackageName ) ; } TypeDeclaration [ ] types = this . referenceContext . types ; int typeLength = ( types == null ) ? <NUM_LIT:0> : types . length ; this . topLevelTypes = new SourceTypeBinding [ typeLength ] ; int count = <NUM_LIT:0> ; nextType : for ( int i = <NUM_LIT:0> ; i < typeLength ; i ++ ) { TypeDeclaration typeDecl = types [ i ] ; if ( this . environment . isProcessingAnnotations && this . environment . isMissingType ( typeDecl . name ) ) throw new SourceTypeCollisionException ( ) ; ReferenceBinding typeBinding = this . fPackage . getType0 ( typeDecl . name ) ; recordSimpleReference ( typeDecl . name ) ; if ( typeBinding != null && typeBinding . isValidBinding ( ) && ! ( typeBinding instanceof UnresolvedReferenceBinding ) ) { if ( this . environment . isProcessingAnnotations ) throw new SourceTypeCollisionException ( ) ; problemReporter ( ) . duplicateTypes ( this . referenceContext , typeDecl ) ; continue nextType ; } if ( this . fPackage != this . environment . defaultPackage && this . fPackage . getPackage ( typeDecl . name ) != null ) { problemReporter ( ) . typeCollidesWithPackage ( this . referenceContext , typeDecl ) ; } checkPublicTypeNameMatchesFilename ( typeDecl ) ; ClassScope child = buildClassScope ( this , typeDecl ) ; SourceTypeBinding type = child . buildType ( null , this . fPackage , accessRestriction ) ; if ( firstIsSynthetic && i == <NUM_LIT:0> ) type . modifiers |= ClassFileConstants . AccSynthetic ; if ( type != null ) this . topLevelTypes [ count ++ ] = type ; } if ( count != this . topLevelTypes . length ) System . arraycopy ( this . topLevelTypes , <NUM_LIT:0> , this . topLevelTypes = new SourceTypeBinding [ count ] , <NUM_LIT:0> , count ) ; } protected void checkPublicTypeNameMatchesFilename ( TypeDeclaration typeDecl ) { if ( ( typeDecl . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { char [ ] mainTypeName ; if ( ( mainTypeName = this . referenceContext . getMainTypeName ( ) ) != null && ! CharOperation . equals ( mainTypeName , typeDecl . name ) ) { problemReporter ( ) . publicClassMustMatchFileName ( this . referenceContext , typeDecl ) ; } } } protected ClassScope buildClassScope ( Scope parent , TypeDeclaration typeDecl ) { return new ClassScope ( parent , typeDecl ) ; } void checkAndSetImports ( ) { if ( this . referenceContext . imports == null ) { this . imports = getDefaultImports ( ) ; return ; } int numberOfStatements = this . referenceContext . imports . length ; int numberOfImports = numberOfStatements + <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; if ( ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && CharOperation . equals ( TypeConstants . JAVA_LANG , importReference . tokens ) && ! importReference . isStatic ( ) ) { numberOfImports -- ; break ; } } ImportBinding [ ] resolvedImports = null ; int index = - <NUM_LIT:1> ; ImportBinding [ ] defaultImportBindings = getDefaultImports ( ) ; if ( defaultImportBindings . length == <NUM_LIT:1> ) { resolvedImports = new ImportBinding [ numberOfImports ] ; resolvedImports [ <NUM_LIT:0> ] = getDefaultImports ( ) [ <NUM_LIT:0> ] ; index = <NUM_LIT:1> ; } else { resolvedImports = new ImportBinding [ numberOfImports + defaultImportBindings . length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < defaultImportBindings . length ; i ++ ) { resolvedImports [ index ++ ] = defaultImportBindings [ i ] ; } } nextImport : for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; char [ ] [ ] compoundName = importReference . tokens ; for ( int j = <NUM_LIT:0> ; j < index ; j ++ ) { ImportBinding resolved = resolvedImports [ j ] ; if ( resolved . onDemand == ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && resolved . isStatic ( ) == importReference . isStatic ( ) ) if ( CharOperation . equals ( compoundName , resolvedImports [ j ] . compoundName ) ) continue nextImport ; } if ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( compoundName , this . currentPackageName ) ) continue nextImport ; Binding importBinding = findImport ( compoundName , compoundName . length ) ; if ( ! importBinding . isValidBinding ( ) || ( importReference . isStatic ( ) && importBinding instanceof PackageBinding ) ) continue nextImport ; resolvedImports [ index ++ ] = new ImportBinding ( compoundName , true , importBinding , importReference ) ; } else { resolvedImports [ index ++ ] = new ImportBinding ( compoundName , false , null , importReference ) ; } } if ( resolvedImports . length > index ) System . arraycopy ( resolvedImports , <NUM_LIT:0> , resolvedImports = new ImportBinding [ index ] , <NUM_LIT:0> , index ) ; this . imports = resolvedImports ; } protected void checkParameterizedTypes ( ) { if ( compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) return ; for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) { ClassScope scope = this . topLevelTypes [ i ] . scope ; scope . checkParameterizedTypeBounds ( ) ; scope . checkParameterizedSuperTypeCollisions ( ) ; } } public char [ ] computeConstantPoolName ( LocalTypeBinding localType ) { if ( localType . constantPoolName != null ) { return localType . constantPoolName ; } if ( this . constantPoolNameUsage == null ) this . constantPoolNameUsage = new HashtableOfType ( ) ; ReferenceBinding outerMostEnclosingType = localType . scope . outerMostClassScope ( ) . enclosingSourceType ( ) ; int index = <NUM_LIT:0> ; char [ ] candidateName ; boolean isCompliant15 = compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_5 ; while ( true ) { if ( localType . isMemberType ( ) ) { if ( index == <NUM_LIT:0> ) { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , localType . sourceName , '<CHAR_LIT>' ) ; } else { candidateName = CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , '<CHAR_LIT>' , String . valueOf ( index ) . toCharArray ( ) , '<CHAR_LIT>' , localType . sourceName ) ; } } else if ( localType . isAnonymousType ( ) ) { if ( isCompliant15 ) { candidateName = CharOperation . concat ( localType . enclosingType . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) ; } } else { if ( isCompliant15 ) { candidateName = CharOperation . concat ( CharOperation . concat ( localType . enclosingType ( ) . constantPoolName ( ) , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' ) , localType . sourceName ) ; } else { candidateName = CharOperation . concat ( outerMostEnclosingType . constantPoolName ( ) , '<CHAR_LIT>' , String . valueOf ( index + <NUM_LIT:1> ) . toCharArray ( ) , '<CHAR_LIT>' , localType . sourceName ) ; } } if ( this . constantPoolNameUsage . get ( candidateName ) != null ) { index ++ ; } else { this . constantPoolNameUsage . put ( candidateName , localType ) ; break ; } } return candidateName ; } void connectTypeHierarchy ( ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . scope . connectTypeHierarchy ( ) ; } protected void faultInImports ( ) { if ( this . typeOrPackageCache != null ) return ; if ( this . referenceContext . imports == null ) { this . typeOrPackageCache = new HashtableOfObject ( <NUM_LIT:1> ) ; return ; } int numberOfStatements = this . referenceContext . imports . length ; HashtableOfType typesBySimpleNames = null ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { if ( ( this . referenceContext . imports [ i ] . bits & ASTNode . OnDemand ) == <NUM_LIT:0> ) { typesBySimpleNames = new HashtableOfType ( this . topLevelTypes . length + numberOfStatements ) ; for ( int j = <NUM_LIT:0> , length = this . topLevelTypes . length ; j < length ; j ++ ) typesBySimpleNames . put ( this . topLevelTypes [ j ] . sourceName , this . topLevelTypes [ j ] ) ; break ; } } int numberOfImports = numberOfStatements + <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; if ( ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && CharOperation . equals ( TypeConstants . JAVA_LANG , importReference . tokens ) && ! importReference . isStatic ( ) ) { numberOfImports -- ; break ; } } this . tempImports = null ; this . importPtr = - <NUM_LIT:1> ; ImportBinding [ ] defaultImportBindings = getDefaultImports ( ) ; if ( defaultImportBindings . length == <NUM_LIT:1> ) { this . tempImports = new ImportBinding [ numberOfImports ] ; this . tempImports [ <NUM_LIT:0> ] = getDefaultImports ( ) [ <NUM_LIT:0> ] ; this . importPtr = <NUM_LIT:1> ; } else { this . tempImports = new ImportBinding [ numberOfImports + defaultImportBindings . length - <NUM_LIT:1> ] ; this . importPtr = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < defaultImportBindings . length ; i ++ ) { this . tempImports [ this . importPtr ++ ] = defaultImportBindings [ i ] ; } } nextImport : for ( int i = <NUM_LIT:0> ; i < numberOfStatements ; i ++ ) { ImportReference importReference = this . referenceContext . imports [ i ] ; char [ ] [ ] compoundName = importReference . tokens ; for ( int j = <NUM_LIT:0> ; j < this . importPtr ; j ++ ) { ImportBinding resolved = this . tempImports [ j ] ; if ( resolved . onDemand == ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) && resolved . isStatic ( ) == importReference . isStatic ( ) ) { if ( CharOperation . equals ( compoundName , resolved . compoundName ) ) { problemReporter ( ) . unusedImport ( importReference ) ; continue nextImport ; } } } if ( ( importReference . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( compoundName , this . currentPackageName ) ) { problemReporter ( ) . unusedImport ( importReference ) ; continue nextImport ; } Binding importBinding = findImport ( compoundName , compoundName . length ) ; if ( ! importBinding . isValidBinding ( ) ) { reportImportProblem ( importReference , importBinding ) ; continue nextImport ; } if ( importReference . isStatic ( ) && importBinding instanceof PackageBinding ) { problemReporter ( ) . cannotImportPackage ( importReference ) ; continue nextImport ; } recordImportBinding ( new ImportBinding ( compoundName , true , importBinding , importReference ) ) ; } else { Binding importBinding = findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , importReference . isStatic ( ) ) ; if ( ! importBinding . isValidBinding ( ) ) { if ( importBinding . problemId ( ) == ProblemReasons . Ambiguous ) { } else { recordImportProblem ( importReference , importBinding ) ; continue nextImport ; } } if ( importBinding instanceof PackageBinding ) { problemReporter ( ) . cannotImportPackage ( importReference ) ; continue nextImport ; } if ( checkAndRecordImportBinding ( importBinding , typesBySimpleNames , importReference , compoundName ) == - <NUM_LIT:1> ) continue nextImport ; if ( importReference . isStatic ( ) ) { if ( importBinding . kind ( ) == Binding . FIELD ) { checkMoreStaticBindings ( compoundName , typesBySimpleNames , Binding . TYPE | Binding . METHOD , importReference ) ; } else if ( importBinding . kind ( ) == Binding . METHOD ) { checkMoreStaticBindings ( compoundName , typesBySimpleNames , Binding . TYPE , importReference ) ; } } } } if ( this . tempImports . length > this . importPtr ) System . arraycopy ( this . tempImports , <NUM_LIT:0> , this . tempImports = new ImportBinding [ this . importPtr ] , <NUM_LIT:0> , this . importPtr ) ; this . imports = this . tempImports ; int length = this . imports . length ; this . typeOrPackageCache = new HashtableOfObject ( length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ImportBinding binding = this . imports [ i ] ; if ( ! binding . onDemand && binding . resolvedImport instanceof ReferenceBinding || binding instanceof ImportConflictBinding ) this . typeOrPackageCache . put ( getSimpleName ( binding ) , binding ) ; } } public void faultInTypes ( ) { faultInImports ( ) ; for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . faultInTypesForFieldsAndMethods ( ) ; } protected void recordImportProblem ( ImportReference importReference , Binding importBinding ) { problemReporter ( ) . importProblem ( importReference , importBinding ) ; } public Binding findImport ( char [ ] [ ] compoundName , boolean findStaticImports , boolean onDemand ) { if ( onDemand ) { return findImport ( compoundName , compoundName . length ) ; } else { return findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , findStaticImports ) ; } } private Binding findImport ( char [ ] [ ] compoundName , int length ) { recordQualifiedReference ( compoundName ) ; Binding binding = this . environment . getTopLevelPackage ( compoundName [ <NUM_LIT:0> ] ) ; int i = <NUM_LIT:1> ; foundNothingOrType : if ( binding != null ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( i < length ) { binding = packageBinding . getTypeOrPackage ( compoundName [ i ++ ] ) ; if ( binding == null || ! binding . isValidBinding ( ) ) { binding = null ; break foundNothingOrType ; } if ( ! ( binding instanceof PackageBinding ) ) break foundNothingOrType ; packageBinding = ( PackageBinding ) binding ; } return packageBinding ; } ReferenceBinding type ; if ( binding == null ) { if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; type = findType ( compoundName [ <NUM_LIT:0> ] , this . environment . defaultPackage , this . environment . defaultPackage ) ; if ( type == null || ! type . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; i = <NUM_LIT:1> ; } else { type = ( ReferenceBinding ) binding ; } while ( i < length ) { type = ( ReferenceBinding ) this . environment . convertToRawType ( type , false ) ; if ( ! type . canBeSeenBy ( this . fPackage ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , type , ProblemReasons . NotVisible ) ; char [ ] name = compoundName [ i ++ ] ; type = type . getMemberType ( name ) ; if ( type == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i ) , null , ProblemReasons . NotFound ) ; } if ( ! canBeSeenBy ( type , this . fPackage ) ) return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotVisible ) ; return type ; } protected boolean canBeSeenBy ( ReferenceBinding type , PackageBinding pkg ) { return type . canBeSeenBy ( pkg ) ; } protected Binding findSingleImport ( char [ ] [ ] compoundName , int mask , boolean findStaticImports ) { if ( compoundName . length == <NUM_LIT:1> ) { if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; ReferenceBinding typeBinding = findType ( compoundName [ <NUM_LIT:0> ] , this . environment . defaultPackage , this . fPackage ) ; if ( typeBinding == null ) return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; return typeBinding ; } if ( findStaticImports ) return findSingleStaticImport ( compoundName , mask ) ; return findImport ( compoundName , compoundName . length ) ; } private Binding findSingleStaticImport ( char [ ] [ ] compoundName , int mask ) { Binding binding = findImport ( compoundName , compoundName . length - <NUM_LIT:1> ) ; if ( ! binding . isValidBinding ( ) ) return binding ; char [ ] name = compoundName [ compoundName . length - <NUM_LIT:1> ] ; if ( binding instanceof PackageBinding ) { Binding temp = ( ( PackageBinding ) binding ) . getTypeOrPackage ( name ) ; if ( temp != null && temp instanceof ReferenceBinding ) return new ProblemReferenceBinding ( compoundName , ( ReferenceBinding ) temp , ProblemReasons . InvalidTypeForStaticImport ) ; return binding ; } ReferenceBinding type = ( ReferenceBinding ) binding ; FieldBinding field = ( mask & Binding . FIELD ) != <NUM_LIT:0> ? findField ( type , name , null , true ) : null ; if ( field != null ) { if ( field . problemId ( ) == ProblemReasons . Ambiguous && ( ( ProblemFieldBinding ) field ) . closestMatch . isStatic ( ) ) return field ; if ( field . isValidBinding ( ) && field . isStatic ( ) && field . canBeSeenBy ( type , null , this ) ) return field ; } MethodBinding method = ( mask & Binding . METHOD ) != <NUM_LIT:0> ? findStaticMethod ( type , name ) : null ; if ( method != null ) return method ; type = findMemberType ( name , type ) ; if ( type == null || ! type . isStatic ( ) ) { if ( field != null && ! field . isValidBinding ( ) && field . problemId ( ) != ProblemReasons . NotFound ) return field ; return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotFound ) ; } if ( type . isValidBinding ( ) && ! type . canBeSeenBy ( this . fPackage ) ) return new ProblemReferenceBinding ( compoundName , type , ProblemReasons . NotVisible ) ; if ( type . problemId ( ) == ProblemReasons . NotVisible ) return new ProblemReferenceBinding ( compoundName , ( ( ProblemReferenceBinding ) type ) . closestMatch , ProblemReasons . NotVisible ) ; return type ; } private MethodBinding findStaticMethod ( ReferenceBinding currentType , char [ ] selector ) { if ( ! currentType . canBeSeenBy ( this ) ) return null ; do { currentType . initializeForStaticImports ( ) ; MethodBinding [ ] methods = currentType . getMethods ( selector ) ; if ( methods != Binding . NO_METHODS ) { for ( int i = methods . length ; -- i >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ i ] ; if ( method . isStatic ( ) && method . canBeSeenBy ( this . fPackage ) ) return method ; } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return null ; } protected ImportBinding [ ] getDefaultImports ( ) { if ( this . environment . defaultImports != null ) return this . environment . defaultImports ; Binding importBinding = this . environment . getTopLevelPackage ( TypeConstants . JAVA ) ; if ( importBinding != null ) importBinding = ( ( PackageBinding ) importBinding ) . getTypeOrPackage ( TypeConstants . JAVA_LANG [ <NUM_LIT:1> ] ) ; if ( importBinding == null || ! importBinding . isValidBinding ( ) ) { problemReporter ( ) . isClassPathCorrect ( TypeConstants . JAVA_LANG_OBJECT , this . referenceContext , this . environment . missingClassFileLocation ) ; BinaryTypeBinding missingObject = this . environment . createMissingType ( null , TypeConstants . JAVA_LANG_OBJECT ) ; importBinding = missingObject . fPackage ; } return this . environment . defaultImports = new ImportBinding [ ] { new ImportBinding ( TypeConstants . JAVA_LANG , true , importBinding , null ) } ; } public final Binding getImport ( char [ ] [ ] compoundName , boolean onDemand , boolean isStaticImport ) { if ( onDemand ) return findImport ( compoundName , compoundName . length ) ; return findSingleImport ( compoundName , Binding . TYPE | Binding . FIELD | Binding . METHOD , isStaticImport ) ; } public int nextCaptureID ( ) { return this . captureID ++ ; } public ProblemReporter problemReporter ( ) { ProblemReporter problemReporter = this . referenceContext . problemReporter ; problemReporter . referenceContext = this . referenceContext ; return problemReporter ; } public void recordQualifiedReference ( char [ ] [ ] qualifiedName ) { if ( this . qualifiedReferences == null ) return ; int length = qualifiedName . length ; if ( length > <NUM_LIT:1> ) { recordRootReference ( qualifiedName [ <NUM_LIT:0> ] ) ; while ( ! this . qualifiedReferences . contains ( qualifiedName ) ) { this . qualifiedReferences . add ( qualifiedName ) ; if ( length == <NUM_LIT:2> ) { recordSimpleReference ( qualifiedName [ <NUM_LIT:0> ] ) ; recordSimpleReference ( qualifiedName [ <NUM_LIT:1> ] ) ; return ; } length -- ; recordSimpleReference ( qualifiedName [ length ] ) ; System . arraycopy ( qualifiedName , <NUM_LIT:0> , qualifiedName = new char [ length ] [ ] , <NUM_LIT:0> , length ) ; } } else if ( length == <NUM_LIT:1> ) { recordRootReference ( qualifiedName [ <NUM_LIT:0> ] ) ; recordSimpleReference ( qualifiedName [ <NUM_LIT:0> ] ) ; } } void recordReference ( char [ ] [ ] qualifiedEnclosingName , char [ ] simpleName ) { recordQualifiedReference ( qualifiedEnclosingName ) ; if ( qualifiedEnclosingName . length == <NUM_LIT:0> ) recordRootReference ( simpleName ) ; recordSimpleReference ( simpleName ) ; } void recordReference ( ReferenceBinding type , char [ ] simpleName ) { ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null ) recordReference ( actualType . compoundName , simpleName ) ; } void recordRootReference ( char [ ] simpleName ) { if ( this . rootReferences == null ) return ; if ( ! this . rootReferences . contains ( simpleName ) ) this . rootReferences . add ( simpleName ) ; } public void recordSimpleReference ( char [ ] simpleName ) { if ( this . simpleNameReferences == null ) return ; if ( ! this . simpleNameReferences . contains ( simpleName ) ) this . simpleNameReferences . add ( simpleName ) ; } void recordSuperTypeReference ( TypeBinding type ) { if ( this . referencedSuperTypes == null ) return ; ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null && ! this . referencedSuperTypes . containsIdentical ( actualType ) ) this . referencedSuperTypes . add ( actualType ) ; } public void recordTypeConversion ( TypeBinding superType , TypeBinding subType ) { recordSuperTypeReference ( subType ) ; } void recordTypeReference ( TypeBinding type ) { if ( this . referencedTypes == null ) return ; ReferenceBinding actualType = typeToRecord ( type ) ; if ( actualType != null && ! this . referencedTypes . containsIdentical ( actualType ) ) this . referencedTypes . add ( actualType ) ; } void recordTypeReferences ( TypeBinding [ ] types ) { if ( this . referencedTypes == null ) return ; if ( types == null || types . length == <NUM_LIT:0> ) return ; for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { ReferenceBinding actualType = typeToRecord ( types [ i ] ) ; if ( actualType != null && ! this . referencedTypes . containsIdentical ( actualType ) ) this . referencedTypes . add ( actualType ) ; } } Binding resolveSingleImport ( ImportBinding importBinding , int mask ) { if ( importBinding . resolvedImport == null ) { importBinding . resolvedImport = findSingleImport ( importBinding . compoundName , mask , importBinding . isStatic ( ) ) ; if ( ! importBinding . resolvedImport . isValidBinding ( ) || importBinding . resolvedImport instanceof PackageBinding ) { if ( importBinding . resolvedImport . problemId ( ) == ProblemReasons . Ambiguous ) return importBinding . resolvedImport ; if ( this . imports != null ) { ImportBinding [ ] newImports = new ImportBinding [ this . imports . length - <NUM_LIT:1> ] ; for ( int i = <NUM_LIT:0> , n = <NUM_LIT:0> , max = this . imports . length ; i < max ; i ++ ) if ( this . imports [ i ] != importBinding ) newImports [ n ++ ] = this . imports [ i ] ; this . imports = newImports ; } return null ; } } return importBinding . resolvedImport ; } public void storeDependencyInfo ( ) { for ( int i = <NUM_LIT:0> ; i < this . referencedSuperTypes . size ; i ++ ) { ReferenceBinding type = ( ReferenceBinding ) this . referencedSuperTypes . elementAt ( i ) ; if ( ! this . referencedTypes . containsIdentical ( type ) ) this . referencedTypes . add ( type ) ; if ( ! type . isLocalType ( ) ) { ReferenceBinding enclosing = type . enclosingType ( ) ; if ( enclosing != null ) recordSuperTypeReference ( enclosing ) ; } ReferenceBinding superclass = type . superclass ( ) ; if ( superclass != null ) recordSuperTypeReference ( superclass ) ; ReferenceBinding [ ] interfaces = type . superInterfaces ( ) ; if ( interfaces != null ) for ( int j = <NUM_LIT:0> , length = interfaces . length ; j < length ; j ++ ) recordSuperTypeReference ( interfaces [ j ] ) ; } for ( int i = <NUM_LIT:0> , l = this . referencedTypes . size ; i < l ; i ++ ) { ReferenceBinding type = ( ReferenceBinding ) this . referencedTypes . elementAt ( i ) ; if ( ! type . isLocalType ( ) ) recordQualifiedReference ( type . isMemberType ( ) ? CharOperation . splitOn ( '<CHAR_LIT:.>' , type . readableName ( ) ) : type . compoundName ) ; } int size = this . qualifiedReferences . size ; char [ ] [ ] [ ] qualifiedRefs = new char [ size ] [ ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) qualifiedRefs [ i ] = this . qualifiedReferences . elementAt ( i ) ; this . referenceContext . compilationResult . qualifiedReferences = qualifiedRefs ; size = this . simpleNameReferences . size ; char [ ] [ ] simpleRefs = new char [ size ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) simpleRefs [ i ] = this . simpleNameReferences . elementAt ( i ) ; this . referenceContext . compilationResult . simpleNameReferences = simpleRefs ; size = this . rootReferences . size ; char [ ] [ ] rootRefs = new char [ size ] [ ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) rootRefs [ i ] = this . rootReferences . elementAt ( i ) ; this . referenceContext . compilationResult . rootReferences = rootRefs ; } public String toString ( ) { return "<STR_LIT>" + new String ( this . referenceContext . getFileName ( ) ) ; } private ReferenceBinding typeToRecord ( TypeBinding type ) { if ( type . isArrayType ( ) ) type = ( ( ArrayBinding ) type ) . leafComponentType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return null ; case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : type = type . erasure ( ) ; } ReferenceBinding refType = ( ReferenceBinding ) type ; if ( refType . isLocalType ( ) ) return null ; return refType ; } public void verifyMethods ( MethodVerifier verifier ) { for ( int i = <NUM_LIT:0> , length = this . topLevelTypes . length ; i < length ; i ++ ) this . topLevelTypes [ i ] . verifyMethods ( verifier ) ; } private void recordImportBinding ( ImportBinding bindingToAdd ) { if ( this . tempImports . length == this . importPtr ) { System . arraycopy ( this . tempImports , <NUM_LIT:0> , ( this . tempImports = new ImportBinding [ this . importPtr + <NUM_LIT:1> ] ) , <NUM_LIT:0> , this . importPtr ) ; } this . tempImports [ this . importPtr ++ ] = bindingToAdd ; } private void checkMoreStaticBindings ( char [ ] [ ] compoundName , HashtableOfType typesBySimpleNames , int mask , ImportReference importReference ) { Binding importBinding = findSingleStaticImport ( compoundName , mask ) ; if ( ! importBinding . isValidBinding ( ) ) { if ( importBinding . problemId ( ) == ProblemReasons . Ambiguous ) { checkAndRecordImportBinding ( importBinding , typesBySimpleNames , importReference , compoundName ) ; } } else { checkAndRecordImportBinding ( importBinding , typesBySimpleNames , importReference , compoundName ) ; } if ( ( ( mask & Binding . METHOD ) != <NUM_LIT:0> ) && ( importBinding . kind ( ) == Binding . METHOD ) ) { mask &= ~ Binding . METHOD ; checkMoreStaticBindings ( compoundName , typesBySimpleNames , mask , importReference ) ; } } private int checkAndRecordImportBinding ( Binding importBinding , HashtableOfType typesBySimpleNames , ImportReference importReference , char [ ] [ ] compoundName ) { ReferenceBinding conflictingType = null ; if ( importBinding instanceof MethodBinding ) { conflictingType = ( ReferenceBinding ) getType ( compoundName , compoundName . length ) ; if ( ! conflictingType . isValidBinding ( ) || ( importReference . isStatic ( ) && ! conflictingType . isStatic ( ) ) ) conflictingType = null ; } if ( importBinding instanceof ReferenceBinding || conflictingType != null ) { ReferenceBinding referenceBinding = conflictingType == null ? ( ReferenceBinding ) importBinding : conflictingType ; ReferenceBinding typeToCheck = referenceBinding . problemId ( ) == ProblemReasons . Ambiguous ? ( ( ProblemReferenceBinding ) referenceBinding ) . closestMatch : referenceBinding ; if ( importReference . isTypeUseDeprecated ( typeToCheck , this ) ) problemReporter ( ) . deprecatedType ( typeToCheck , importReference ) ; ReferenceBinding existingType = typesBySimpleNames . get ( importReference . getSimpleName ( ) ) ; if ( existingType != null ) { if ( existingType == referenceBinding ) { for ( int j = <NUM_LIT:0> ; j < this . importPtr ; j ++ ) { ImportBinding resolved = this . tempImports [ j ] ; if ( resolved instanceof ImportConflictBinding ) { ImportConflictBinding importConflictBinding = ( ImportConflictBinding ) resolved ; if ( importConflictBinding . conflictingTypeBinding == referenceBinding ) { if ( ! importReference . isStatic ( ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; recordImportBinding ( new ImportBinding ( compoundName , false , importBinding , importReference ) ) ; } } } else if ( resolved . resolvedImport == referenceBinding ) { if ( importReference . isStatic ( ) != resolved . isStatic ( ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; recordImportBinding ( new ImportBinding ( compoundName , false , importBinding , importReference ) ) ; } } } return - <NUM_LIT:1> ; } for ( int j = <NUM_LIT:0> , length = this . topLevelTypes . length ; j < length ; j ++ ) { if ( CharOperation . equals ( this . topLevelTypes [ j ] . sourceName , existingType . sourceName ) ) { problemReporter ( ) . conflictingImport ( importReference ) ; return - <NUM_LIT:1> ; } } problemReporter ( ) . duplicateImport ( importReference ) ; return - <NUM_LIT:1> ; } typesBySimpleNames . put ( importReference . getSimpleName ( ) , referenceBinding ) ; } else if ( importBinding instanceof FieldBinding ) { for ( int j = <NUM_LIT:0> ; j < this . importPtr ; j ++ ) { ImportBinding resolved = this . tempImports [ j ] ; if ( resolved . isStatic ( ) && resolved . resolvedImport instanceof FieldBinding && importBinding != resolved . resolvedImport ) { if ( CharOperation . equals ( compoundName [ compoundName . length - <NUM_LIT:1> ] , resolved . compoundName [ resolved . compoundName . length - <NUM_LIT:1> ] ) ) { problemReporter ( ) . duplicateImport ( importReference ) ; return - <NUM_LIT:1> ; } } } } if ( conflictingType == null ) { recordImportBinding ( new ImportBinding ( compoundName , false , importBinding , importReference ) ) ; } else { recordImportBinding ( new ImportConflictBinding ( compoundName , importBinding , conflictingType , importReference ) ) ; } return this . importPtr ; } public void augmentTypeHierarchy ( ) { } public boolean checkTargetCompatibility ( ) { return true ; } public boolean scannerAvailable ( ) { return true ; } public boolean reportInvalidType ( TypeReference typeReference , TypeBinding resolvedType ) { return true ; } protected void reportImportProblem ( ImportReference importReference , Binding importBinding ) { problemReporter ( ) . importProblem ( importReference , importBinding ) ; } public boolean canSeeEverything ( ) { return false ; } public ReferenceBinding selectBinding ( ReferenceBinding temp , ReferenceBinding type , boolean isDeclaredImport ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class AnnotationHolder { AnnotationBinding [ ] annotations ; static AnnotationHolder storeAnnotations ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { if ( parameterAnnotations != null ) { boolean isEmpty = true ; for ( int i = parameterAnnotations . length ; isEmpty && -- i >= <NUM_LIT:0> ; ) if ( parameterAnnotations [ i ] != null && parameterAnnotations [ i ] . length > <NUM_LIT:0> ) isEmpty = false ; if ( isEmpty ) parameterAnnotations = null ; } if ( defaultValue != null ) return new AnnotationMethodHolder ( annotations , parameterAnnotations , defaultValue , optionalEnv ) ; if ( parameterAnnotations != null ) return new MethodHolder ( annotations , parameterAnnotations ) ; return new AnnotationHolder ( ) . setAnnotations ( annotations ) ; } AnnotationBinding [ ] getAnnotations ( ) { return this . annotations ; } Object getDefaultValue ( ) { return null ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { return null ; } AnnotationBinding [ ] getParameterAnnotations ( int paramIndex ) { return Binding . NO_ANNOTATIONS ; } AnnotationHolder setAnnotations ( AnnotationBinding [ ] annotations ) { if ( annotations == null || annotations . length == <NUM_LIT:0> ) return null ; this . annotations = annotations ; return this ; } static class MethodHolder extends AnnotationHolder { AnnotationBinding [ ] [ ] parameterAnnotations ; MethodHolder ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations ) { super ( ) ; setAnnotations ( annotations ) ; this . parameterAnnotations = parameterAnnotations ; } public AnnotationBinding [ ] [ ] getParameterAnnotations ( ) { return this . parameterAnnotations ; } AnnotationBinding [ ] getParameterAnnotations ( int paramIndex ) { AnnotationBinding [ ] result = this . parameterAnnotations == null ? null : this . parameterAnnotations [ paramIndex ] ; return result == null ? Binding . NO_ANNOTATIONS : result ; } AnnotationHolder setAnnotations ( AnnotationBinding [ ] annotations ) { this . annotations = annotations == null || annotations . length == <NUM_LIT:0> ? Binding . NO_ANNOTATIONS : annotations ; return this ; } } static class AnnotationMethodHolder extends MethodHolder { Object defaultValue ; LookupEnvironment env ; AnnotationMethodHolder ( AnnotationBinding [ ] annotations , AnnotationBinding [ ] [ ] parameterAnnotations , Object defaultValue , LookupEnvironment optionalEnv ) { super ( annotations , parameterAnnotations ) ; this . defaultValue = defaultValue ; this . env = optionalEnv ; } Object getDefaultValue ( ) { if ( this . defaultValue instanceof UnresolvedReferenceBinding ) { if ( this . env == null ) throw new IllegalStateException ( ) ; this . defaultValue = ( ( UnresolvedReferenceBinding ) this . defaultValue ) . resolve ( this . env , false ) ; } return this . defaultValue ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class MissingTypeBinding extends BinaryTypeBinding { public MissingTypeBinding ( PackageBinding packageBinding , char [ ] [ ] compoundName , LookupEnvironment environment ) { this . compoundName = compoundName ; computeId ( ) ; this . tagBits |= TagBits . IsBinaryBinding | TagBits . HierarchyHasProblems | TagBits . HasMissingType ; this . environment = environment ; this . fPackage = packageBinding ; this . fileName = CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ; this . sourceName = compoundName [ compoundName . length - <NUM_LIT:1> ] ; this . modifiers = ClassFileConstants . AccPublic ; this . superclass = null ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . typeVariables = Binding . NO_TYPE_VARIABLES ; this . memberTypes = Binding . NO_MEMBER_TYPES ; this . fields = Binding . NO_FIELDS ; this . methods = Binding . NO_METHODS ; } public List collectMissingTypes ( List missingTypes ) { if ( missingTypes == null ) { missingTypes = new ArrayList ( <NUM_LIT:5> ) ; } else if ( missingTypes . contains ( this ) ) { return missingTypes ; } missingTypes . add ( this ) ; return missingTypes ; } public int problemId ( ) { return ProblemReasons . NotFound ; } void setMissingSuperclass ( ReferenceBinding missingSuperclass ) { this . superclass = missingSuperclass ; } public String toString ( ) { return "<STR_LIT>" + new String ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ) + "<STR_LIT:]>" ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemBinding extends Binding { public char [ ] name ; public ReferenceBinding searchType ; private int problemId ; public ProblemBinding ( char [ ] [ ] compoundName , int problemId ) { this ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) , problemId ) ; } public ProblemBinding ( char [ ] [ ] compoundName , ReferenceBinding searchType , int problemId ) { this ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:.>' ) , searchType , problemId ) ; } ProblemBinding ( char [ ] name , int problemId ) { this . name = name ; this . problemId = problemId ; } ProblemBinding ( char [ ] name , ReferenceBinding searchType , int problemId ) { this ( name , problemId ) ; this . searchType = searchType ; } public final int kind ( ) { return VARIABLE | TYPE ; } public final int problemId ( ) { return this . problemId ; } public char [ ] readableName ( ) { return this . name ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public interface TagBits { long IsArrayType = ASTNode . Bit1 ; long IsBaseType = ASTNode . Bit2 ; long IsNestedType = ASTNode . Bit3 ; long IsMemberType = ASTNode . Bit4 ; long ContainsNestedTypeReferences = ASTNode . Bit12 ; long MemberTypeMask = IsNestedType | IsMemberType | ContainsNestedTypeReferences ; long IsLocalType = ASTNode . Bit5 ; long LocalTypeMask = IsNestedType | IsLocalType | ContainsNestedTypeReferences ; long IsAnonymousType = ASTNode . Bit6 ; long AnonymousTypeMask = LocalTypeMask | IsAnonymousType | ContainsNestedTypeReferences ; long IsBinaryBinding = ASTNode . Bit7 ; long HasMissingType = ASTNode . Bit8 ; long HasUncheckedTypeArgumentForBoundCheck = ASTNode . Bit9 ; long NotInitialized = ASTNode . Bit9 ; long ForcedToBeRawType = ASTNode . Bit10 ; long HasUnresolvedArguments = ASTNode . Bit10 ; long BeginHierarchyCheck = ASTNode . Bit9 ; long EndHierarchyCheck = ASTNode . Bit10 ; long PauseHierarchyCheck = ASTNode . Bit20 ; long HasParameterAnnotations = ASTNode . Bit11 ; long KnowsDefaultAbstractMethods = ASTNode . Bit11 ; long IsArgument = ASTNode . Bit11 ; long ClearPrivateModifier = ASTNode . Bit10 ; long IsEffectivelyFinal = ASTNode . Bit12 ; long MultiCatchParameter = ASTNode . Bit13 ; long IsResource = ASTNode . Bit14 ; long AreFieldsSorted = ASTNode . Bit13 ; long AreFieldsComplete = ASTNode . Bit14 ; long AreMethodsSorted = ASTNode . Bit15 ; long AreMethodsComplete = ASTNode . Bit16 ; long HasNoMemberTypes = ASTNode . Bit17 ; long HierarchyHasProblems = ASTNode . Bit18 ; long TypeVariablesAreConnected = ASTNode . Bit19 ; long PassedBoundCheck = ASTNode . Bit23 ; long IsBoundParameterizedType = ASTNode . Bit24 ; long HasUnresolvedTypeVariables = ASTNode . Bit25 ; long HasUnresolvedSuperclass = ASTNode . Bit26 ; long HasUnresolvedSuperinterfaces = ASTNode . Bit27 ; long HasUnresolvedEnclosingType = ASTNode . Bit28 ; long HasUnresolvedMemberTypes = ASTNode . Bit29 ; long HasTypeVariable = ASTNode . Bit30 ; long HasDirectWildcard = ASTNode . Bit31 ; long BeginAnnotationCheck = ASTNode . Bit32L ; long EndAnnotationCheck = ASTNode . Bit33L ; long AnnotationResolved = ASTNode . Bit34L ; long DeprecatedAnnotationResolved = ASTNode . Bit35L ; long AnnotationTarget = ASTNode . Bit36L ; long AnnotationForType = ASTNode . Bit37L ; long AnnotationForField = ASTNode . Bit38L ; long AnnotationForMethod = ASTNode . Bit39L ; long AnnotationForParameter = ASTNode . Bit40L ; long AnnotationForConstructor = ASTNode . Bit41L ; long AnnotationForLocalVariable = ASTNode . Bit42L ; long AnnotationForAnnotationType = ASTNode . Bit43L ; long AnnotationForPackage = ASTNode . Bit44L ; long AnnotationTargetMASK = AnnotationTarget | AnnotationForType | AnnotationForField | AnnotationForMethod | AnnotationForParameter | AnnotationForConstructor | AnnotationForLocalVariable | AnnotationForAnnotationType | AnnotationForPackage ; long AnnotationSourceRetention = ASTNode . Bit45L ; long AnnotationClassRetention = ASTNode . Bit46L ; long AnnotationRuntimeRetention = AnnotationSourceRetention | AnnotationClassRetention ; long AnnotationRetentionMASK = AnnotationSourceRetention | AnnotationClassRetention | AnnotationRuntimeRetention ; long AnnotationDeprecated = ASTNode . Bit47L ; long AnnotationDocumented = ASTNode . Bit48L ; long AnnotationInherited = ASTNode . Bit49L ; long AnnotationOverride = ASTNode . Bit50L ; long AnnotationSuppressWarnings = ASTNode . Bit51L ; long AnnotationSafeVarargs = ASTNode . Bit52L ; long AnnotationPolymorphicSignature = ASTNode . Bit53L ; long AnnotationNullable = ASTNode . Bit56L ; long AnnotationNonNull = ASTNode . Bit57L ; long AnnotationNonNullByDefault = ASTNode . Bit58L ; long AnnotationNullUnspecifiedByDefault = ASTNode . Bit59L ; long AllStandardAnnotationsMask = AnnotationTargetMASK | AnnotationRetentionMASK | AnnotationDeprecated | AnnotationDocumented | AnnotationInherited | AnnotationOverride | AnnotationSuppressWarnings | AnnotationSafeVarargs | AnnotationPolymorphicSignature | AnnotationNullable | AnnotationNonNull | AnnotationNonNullByDefault | AnnotationNullUnspecifiedByDefault ; long DefaultValueResolved = ASTNode . Bit60L ; long HasNonPrivateConstructor = ASTNode . Bit61L ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . lang . reflect . Field ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemReferenceBinding extends ReferenceBinding { ReferenceBinding closestMatch ; private int problemReason ; public ProblemReferenceBinding ( char [ ] [ ] compoundName , ReferenceBinding closestMatch , int problemReason ) { this . compoundName = compoundName ; this . closestMatch = closestMatch ; this . problemReason = problemReason ; } public TypeBinding closestMatch ( ) { return this . closestMatch ; } public ReferenceBinding closestReferenceMatch ( ) { return this . closestMatch ; } public boolean hasTypeBit ( int bit ) { if ( this . closestMatch != null ) return this . closestMatch . hasTypeBit ( bit ) ; return false ; } public int problemId ( ) { return this . problemReason ; } public static String problemReasonString ( int problemReason ) { try { Class reasons = ProblemReasons . class ; String simpleName = reasons . getName ( ) ; int lastDot = simpleName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( lastDot >= <NUM_LIT:0> ) { simpleName = simpleName . substring ( lastDot + <NUM_LIT:1> ) ; } Field [ ] fields = reasons . getFields ( ) ; for ( int i = <NUM_LIT:0> , length = fields . length ; i < length ; i ++ ) { Field field = fields [ i ] ; if ( ! field . getType ( ) . equals ( int . class ) ) continue ; if ( field . getInt ( reasons ) == problemReason ) { return simpleName + '<CHAR_LIT:.>' + field . getName ( ) ; } } } catch ( IllegalAccessException e ) { } return "<STR_LIT:unknown>" ; } public char [ ] shortReadableName ( ) { return readableName ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . compoundName == null ? "<STR_LIT>" : new String ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ) ) ; buffer . append ( "<STR_LIT>" ) . append ( problemReasonString ( this . problemReason ) ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . closestMatch == null ? "<STR_LIT>" : this . closestMatch . toString ( ) ) ; buffer . append ( "<STR_LIT:]>" ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; public class AnnotationBinding { ReferenceBinding type ; ElementValuePair [ ] pairs ; public static AnnotationBinding [ ] addStandardAnnotations ( AnnotationBinding [ ] recordedAnnotations , long annotationTagBits , LookupEnvironment env ) { if ( ( annotationTagBits & TagBits . AllStandardAnnotationsMask ) == <NUM_LIT:0> ) { return recordedAnnotations ; } int count = <NUM_LIT:0> ; if ( ( annotationTagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) count ++ ; if ( ( annotationTagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) count ++ ; if ( count == <NUM_LIT:0> ) { return recordedAnnotations ; } int index = recordedAnnotations . length ; AnnotationBinding [ ] result = new AnnotationBinding [ index + count ] ; System . arraycopy ( recordedAnnotations , <NUM_LIT:0> , result , <NUM_LIT:0> , index ) ; if ( ( annotationTagBits & TagBits . AnnotationTargetMASK ) != <NUM_LIT:0> ) result [ index ++ ] = buildTargetAnnotation ( annotationTagBits , env ) ; if ( ( annotationTagBits & TagBits . AnnotationRetentionMASK ) != <NUM_LIT:0> ) result [ index ++ ] = buildRetentionAnnotation ( annotationTagBits , env ) ; if ( ( annotationTagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_DEPRECATED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationDocumented ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_DOCUMENTED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationInherited ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_ANNOTATION_INHERITED , env ) ; if ( ( annotationTagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_OVERRIDE , env ) ; if ( ( annotationTagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_SUPPRESSWARNINGS , env ) ; if ( ( annotationTagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotationForMemberType ( TypeConstants . JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE , env ) ; if ( ( annotationTagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) result [ index ++ ] = buildMarkerAnnotation ( TypeConstants . JAVA_LANG_SAFEVARARGS , env ) ; return result ; } private static AnnotationBinding buildMarkerAnnotationForMemberType ( char [ ] [ ] compoundName , LookupEnvironment env ) { ReferenceBinding type = env . getResolvedType ( compoundName , null ) ; if ( ! type . isValidBinding ( ) ) { type = ( ( ProblemReferenceBinding ) type ) . closestMatch ; } return env . createAnnotation ( type , Binding . NO_ELEMENT_VALUE_PAIRS ) ; } private static AnnotationBinding buildMarkerAnnotation ( char [ ] [ ] compoundName , LookupEnvironment env ) { ReferenceBinding type = env . getResolvedType ( compoundName , null ) ; return env . createAnnotation ( type , Binding . NO_ELEMENT_VALUE_PAIRS ) ; } private static AnnotationBinding buildRetentionAnnotation ( long bits , LookupEnvironment env ) { ReferenceBinding retentionPolicy = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTIONPOLICY , null ) ; Object value = null ; if ( ( bits & TagBits . AnnotationRuntimeRetention ) == TagBits . AnnotationRuntimeRetention ) { value = retentionPolicy . getField ( TypeConstants . UPPER_RUNTIME , true ) ; } else if ( ( bits & TagBits . AnnotationClassRetention ) != <NUM_LIT:0> ) { value = retentionPolicy . getField ( TypeConstants . UPPER_CLASS , true ) ; } else if ( ( bits & TagBits . AnnotationSourceRetention ) != <NUM_LIT:0> ) { value = retentionPolicy . getField ( TypeConstants . UPPER_SOURCE , true ) ; } return env . createAnnotation ( env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_RETENTION , null ) , new ElementValuePair [ ] { new ElementValuePair ( TypeConstants . VALUE , value , null ) } ) ; } private static AnnotationBinding buildTargetAnnotation ( long bits , LookupEnvironment env ) { ReferenceBinding target = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_TARGET , null ) ; if ( ( bits & TagBits . AnnotationTarget ) != <NUM_LIT:0> ) return new AnnotationBinding ( target , Binding . NO_ELEMENT_VALUE_PAIRS ) ; int arraysize = <NUM_LIT:0> ; if ( ( bits & TagBits . AnnotationForAnnotationType ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) arraysize ++ ; if ( ( bits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) arraysize ++ ; Object [ ] value = new Object [ arraysize ] ; if ( arraysize > <NUM_LIT:0> ) { ReferenceBinding elementType = env . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_ELEMENTTYPE , null ) ; int index = <NUM_LIT:0> ; if ( ( bits & TagBits . AnnotationForAnnotationType ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_ANNOTATION_TYPE , true ) ; if ( ( bits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_CONSTRUCTOR , true ) ; if ( ( bits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_FIELD , true ) ; if ( ( bits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_LOCAL_VARIABLE , true ) ; if ( ( bits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_METHOD , true ) ; if ( ( bits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_PACKAGE , true ) ; if ( ( bits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . UPPER_PARAMETER , true ) ; if ( ( bits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) value [ index ++ ] = elementType . getField ( TypeConstants . TYPE , true ) ; } return env . createAnnotation ( target , new ElementValuePair [ ] { new ElementValuePair ( TypeConstants . VALUE , value , null ) } ) ; } AnnotationBinding ( ReferenceBinding type , ElementValuePair [ ] pairs ) { this . type = type ; this . pairs = pairs ; } AnnotationBinding ( Annotation astAnnotation ) { this ( ( ReferenceBinding ) astAnnotation . resolvedType , astAnnotation . computeElementValuePairs ( ) ) ; } public char [ ] computeUniqueKey ( char [ ] recipientKey ) { char [ ] typeKey = this . type . computeUniqueKey ( false ) ; int recipientKeyLength = recipientKey . length ; char [ ] uniqueKey = new char [ recipientKeyLength + <NUM_LIT:1> + typeKey . length ] ; System . arraycopy ( recipientKey , <NUM_LIT:0> , uniqueKey , <NUM_LIT:0> , recipientKeyLength ) ; uniqueKey [ recipientKeyLength ] = '<CHAR_LIT>' ; System . arraycopy ( typeKey , <NUM_LIT:0> , uniqueKey , recipientKeyLength + <NUM_LIT:1> , typeKey . length ) ; return uniqueKey ; } public ReferenceBinding getAnnotationType ( ) { return this . type ; } public ElementValuePair [ ] getElementValuePairs ( ) { return this . pairs ; } public static void setMethodBindings ( ReferenceBinding type , ElementValuePair [ ] pairs ) { for ( int i = pairs . length ; -- i >= <NUM_LIT:0> ; ) { ElementValuePair pair = pairs [ i ] ; MethodBinding [ ] methods = type . getMethods ( pair . getName ( ) ) ; if ( methods != null && methods . length == <NUM_LIT:1> ) pair . setMethodBinding ( methods [ <NUM_LIT:0> ] ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( '<CHAR_LIT>' ) . append ( this . type . sourceName ) ; if ( this . pairs != null && this . pairs . length > <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , max = this . pairs . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( this . pairs [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemMethodBinding extends MethodBinding { private int problemReason ; public MethodBinding closestMatch ; public ProblemMethodBinding ( char [ ] selector , TypeBinding [ ] args , int problemReason ) { this . selector = selector ; this . parameters = ( args == null || args . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : args ; this . problemReason = problemReason ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; } public ProblemMethodBinding ( char [ ] selector , TypeBinding [ ] args , ReferenceBinding declaringClass , int problemReason ) { this . selector = selector ; this . parameters = ( args == null || args . length == <NUM_LIT:0> ) ? Binding . NO_PARAMETERS : args ; this . declaringClass = declaringClass ; this . problemReason = problemReason ; this . thrownExceptions = Binding . NO_EXCEPTIONS ; } public ProblemMethodBinding ( MethodBinding closestMatch , char [ ] selector , TypeBinding [ ] args , int problemReason ) { this ( selector , args , problemReason ) ; this . closestMatch = closestMatch ; if ( closestMatch != null && problemReason != ProblemReasons . Ambiguous ) this . declaringClass = closestMatch . declaringClass ; } public final int problemId ( ) { return this . problemReason ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class InnerEmulationDependency { public BlockScope scope ; public boolean wasEnclosingInstanceSupplied ; public InnerEmulationDependency ( BlockScope scope , boolean wasEnclosingInstanceSupplied ) { this . scope = scope ; this . wasEnclosingInstanceSupplied = wasEnclosingInstanceSupplied ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public final class ArrayBinding extends TypeBinding { public static final FieldBinding ArrayLength = new FieldBinding ( TypeConstants . LENGTH , TypeBinding . INT , ClassFileConstants . AccPublic | ClassFileConstants . AccFinal , null , Constant . NotAConstant ) ; public TypeBinding leafComponentType ; public int dimensions ; LookupEnvironment environment ; char [ ] constantPoolName ; char [ ] genericTypeSignature ; public ArrayBinding ( TypeBinding type , int dimensions , LookupEnvironment environment ) { this . tagBits |= TagBits . IsArrayType ; this . leafComponentType = type ; this . dimensions = dimensions ; this . environment = environment ; if ( type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) type ) . addWrapper ( this , environment ) ; else this . tagBits |= type . tagBits & ( TagBits . HasTypeVariable | TagBits . HasDirectWildcard | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } public TypeBinding closestMatch ( ) { if ( isValidBinding ( ) ) { return this ; } TypeBinding leafClosestMatch = this . leafComponentType . closestMatch ( ) ; if ( leafClosestMatch == null ) { return null ; } return this . environment . createArrayType ( this . leafComponentType . closestMatch ( ) , this . dimensions ) ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypes = this . leafComponentType . collectMissingTypes ( missingTypes ) ; } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) return ; if ( actualType == TypeBinding . NULL ) return ; switch ( actualType . kind ( ) ) { case Binding . ARRAY_TYPE : int actualDim = actualType . dimensions ( ) ; if ( actualDim == this . dimensions ) { this . leafComponentType . collectSubstitutes ( scope , actualType . leafComponentType ( ) , inferenceContext , constraint ) ; } else if ( actualDim > this . dimensions ) { ArrayBinding actualReducedType = this . environment . createArrayType ( actualType . leafComponentType ( ) , actualDim - this . dimensions ) ; this . leafComponentType . collectSubstitutes ( scope , actualReducedType , inferenceContext , constraint ) ; } break ; case Binding . TYPE_PARAMETER : break ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; return CharOperation . concat ( brackets , this . leafComponentType . computeUniqueKey ( isLeaf ) ) ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName != null ) return this . constantPoolName ; char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; return this . constantPoolName = CharOperation . concat ( brackets , this . leafComponentType . signature ( ) ) ; } public String debugName ( ) { StringBuffer brackets = new StringBuffer ( this . dimensions * <NUM_LIT:2> ) ; for ( int i = this . dimensions ; -- i >= <NUM_LIT:0> ; ) brackets . append ( "<STR_LIT:[]>" ) ; return this . leafComponentType . debugName ( ) + brackets . toString ( ) ; } public int dimensions ( ) { return this . dimensions ; } public TypeBinding elementsType ( ) { if ( this . dimensions == <NUM_LIT:1> ) return this . leafComponentType ; return this . environment . createArrayType ( this . leafComponentType , this . dimensions - <NUM_LIT:1> ) ; } public TypeBinding erasure ( ) { TypeBinding erasedType = this . leafComponentType . erasure ( ) ; if ( this . leafComponentType != erasedType ) return this . environment . createArrayType ( erasedType , this . dimensions ) ; return this ; } public LookupEnvironment environment ( ) { return this . environment ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { char [ ] brackets = new char [ this . dimensions ] ; for ( int i = this . dimensions - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) brackets [ i ] = '<CHAR_LIT:[>' ; this . genericTypeSignature = CharOperation . concat ( brackets , this . leafComponentType . genericTypeSignature ( ) ) ; } return this . genericTypeSignature ; } public PackageBinding getPackage ( ) { return this . leafComponentType . getPackage ( ) ; } public int hashCode ( ) { return this . leafComponentType == null ? super . hashCode ( ) : this . leafComponentType . hashCode ( ) ; } public boolean isCompatibleWith ( TypeBinding otherType ) { if ( this == otherType ) return true ; switch ( otherType . kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding otherArray = ( ArrayBinding ) otherType ; if ( otherArray . leafComponentType . isBaseType ( ) ) return false ; if ( this . dimensions == otherArray . dimensions ) return this . leafComponentType . isCompatibleWith ( otherArray . leafComponentType ) ; if ( this . dimensions < otherArray . dimensions ) return false ; break ; case Binding . BASE_TYPE : return false ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; case Binding . TYPE_PARAMETER : if ( otherType . isCapture ( ) ) { CaptureBinding otherCapture = ( CaptureBinding ) otherType ; TypeBinding otherLowerBound ; if ( ( otherLowerBound = otherCapture . lowerBound ) != null ) { if ( ! otherLowerBound . isArrayType ( ) ) return false ; return isCompatibleWith ( otherLowerBound ) ; } } return false ; } switch ( otherType . leafComponentType ( ) . id ) { case TypeIds . T_JavaLangObject : case TypeIds . T_JavaLangCloneable : case TypeIds . T_JavaIoSerializable : return true ; } return false ; } public int kind ( ) { return ARRAY_TYPE ; } public TypeBinding leafComponentType ( ) { return this . leafComponentType ; } public int problemId ( ) { return this . leafComponentType . problemId ( ) ; } public char [ ] qualifiedSourceName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . qualifiedSourceName ( ) , brackets ) ; } public char [ ] readableName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . readableName ( ) , brackets ) ; } public char [ ] shortReadableName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . shortReadableName ( ) , brackets ) ; } public char [ ] sourceName ( ) { char [ ] brackets = new char [ this . dimensions * <NUM_LIT:2> ] ; for ( int i = this . dimensions * <NUM_LIT:2> - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -= <NUM_LIT:2> ) { brackets [ i ] = '<CHAR_LIT:]>' ; brackets [ i - <NUM_LIT:1> ] = '<CHAR_LIT:[>' ; } return CharOperation . concat ( this . leafComponentType . sourceName ( ) , brackets ) ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { if ( this . leafComponentType == unresolvedType ) { this . leafComponentType = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; this . tagBits |= this . leafComponentType . tagBits & ( TagBits . HasTypeVariable | TagBits . HasDirectWildcard | TagBits . HasMissingType ) ; } } public String toString ( ) { return this . leafComponentType != null ? debugName ( ) : "<STR_LIT>" ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; public class SignatureWrapper { public char [ ] signature ; public int start ; public int end ; public int bracket ; private boolean use15specifics ; public SignatureWrapper ( char [ ] signature , boolean use15specifics ) { this . signature = signature ; this . start = <NUM_LIT:0> ; this . end = this . bracket = - <NUM_LIT:1> ; this . use15specifics = use15specifics ; } public SignatureWrapper ( char [ ] signature ) { this ( signature , true ) ; } public boolean atEnd ( ) { return this . start < <NUM_LIT:0> || this . start >= this . signature . length ; } public int computeEnd ( ) { int index = this . start ; while ( this . signature [ index ] == '<CHAR_LIT:[>' ) index ++ ; switch ( this . signature [ index ] ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : this . end = CharOperation . indexOf ( '<CHAR_LIT:;>' , this . signature , this . start ) ; if ( this . bracket <= this . start ) this . bracket = CharOperation . indexOf ( '<CHAR_LIT>' , this . signature , this . start ) ; if ( this . bracket > this . start && this . bracket < this . end ) this . end = this . bracket ; else if ( this . end == - <NUM_LIT:1> ) this . end = this . signature . length + <NUM_LIT:1> ; break ; default : this . end = this . start ; } if ( this . use15specifics || this . end != this . bracket ) { this . start = this . end + <NUM_LIT:1> ; } else { this . start = skipAngleContents ( this . end ) + <NUM_LIT:1> ; this . bracket = - <NUM_LIT:1> ; } return this . end ; } public int skipAngleContents ( int i ) { if ( this . signature [ i ] != '<CHAR_LIT>' ) { return i ; } int depth = <NUM_LIT:0> , length = this . signature . length ; for ( ++ i ; i < length ; i ++ ) { switch ( this . signature [ i ] ) { case '<CHAR_LIT>' : depth ++ ; break ; case '<CHAR_LIT:>>' : if ( -- depth < <NUM_LIT:0> ) return i + <NUM_LIT:1> ; break ; } } return i ; } public char [ ] nextWord ( ) { this . end = CharOperation . indexOf ( '<CHAR_LIT:;>' , this . signature , this . start ) ; if ( this . bracket <= this . start ) this . bracket = CharOperation . indexOf ( '<CHAR_LIT>' , this . signature , this . start ) ; int dot = CharOperation . indexOf ( '<CHAR_LIT:.>' , this . signature , this . start ) ; if ( this . bracket > this . start && this . bracket < this . end ) this . end = this . bracket ; if ( dot > this . start && dot < this . end ) this . end = dot ; return CharOperation . subarray ( this . signature , this . start , this . start = this . end ) ; } public String toString ( ) { return new String ( this . signature ) + "<STR_LIT>" + this . start ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface ProblemReasons { final int NoError = <NUM_LIT:0> ; final int NotFound = <NUM_LIT:1> ; final int NotVisible = <NUM_LIT:2> ; final int Ambiguous = <NUM_LIT:3> ; final int InternalNameProvided = <NUM_LIT:4> ; final int InheritedNameHidesEnclosingName = <NUM_LIT:5> ; final int NonStaticReferenceInConstructorInvocation = <NUM_LIT:6> ; final int NonStaticReferenceInStaticContext = <NUM_LIT:7> ; final int ReceiverTypeNotVisible = <NUM_LIT:8> ; final int IllegalSuperTypeVariable = <NUM_LIT:9> ; final int ParameterBoundMismatch = <NUM_LIT:10> ; final int TypeParameterArityMismatch = <NUM_LIT:11> ; final int ParameterizedMethodTypeMismatch = <NUM_LIT:12> ; final int TypeArgumentsForRawGenericMethod = <NUM_LIT> ; final int InvalidTypeForStaticImport = <NUM_LIT> ; final int InvalidTypeForAutoManagedResource = <NUM_LIT:15> ; final int VarargsElementTypeNotVisible = <NUM_LIT:16> ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; public class NestedTypeBinding extends SourceTypeBinding { public SourceTypeBinding enclosingType ; public SyntheticArgumentBinding [ ] enclosingInstances ; private ReferenceBinding [ ] enclosingTypes = Binding . UNINITIALIZED_REFERENCE_TYPES ; public SyntheticArgumentBinding [ ] outerLocalVariables ; private int outerLocalVariablesSlotSize = - <NUM_LIT:1> ; public NestedTypeBinding ( char [ ] [ ] typeName , ClassScope scope , SourceTypeBinding enclosingType ) { super ( typeName , enclosingType . fPackage , scope ) ; this . tagBits |= ( TagBits . IsNestedType | TagBits . ContainsNestedTypeReferences ) ; this . enclosingType = enclosingType ; } public SyntheticArgumentBinding addSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { SyntheticArgumentBinding synthLocal = null ; if ( this . outerLocalVariables == null ) { synthLocal = new SyntheticArgumentBinding ( actualOuterLocalVariable ) ; this . outerLocalVariables = new SyntheticArgumentBinding [ ] { synthLocal } ; } else { int size = this . outerLocalVariables . length ; int newArgIndex = size ; for ( int i = size ; -- i >= <NUM_LIT:0> ; ) { if ( this . outerLocalVariables [ i ] . actualOuterLocalVariable == actualOuterLocalVariable ) return this . outerLocalVariables [ i ] ; if ( this . outerLocalVariables [ i ] . id > actualOuterLocalVariable . id ) newArgIndex = i ; } SyntheticArgumentBinding [ ] synthLocals = new SyntheticArgumentBinding [ size + <NUM_LIT:1> ] ; System . arraycopy ( this . outerLocalVariables , <NUM_LIT:0> , synthLocals , <NUM_LIT:0> , newArgIndex ) ; synthLocals [ newArgIndex ] = synthLocal = new SyntheticArgumentBinding ( actualOuterLocalVariable ) ; System . arraycopy ( this . outerLocalVariables , newArgIndex , synthLocals , newArgIndex + <NUM_LIT:1> , size - newArgIndex ) ; this . outerLocalVariables = synthLocals ; } if ( this . scope . referenceCompilationUnit ( ) . isPropagatingInnerClassEmulation ) updateInnerEmulationDependents ( ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgument ( ReferenceBinding targetEnclosingType ) { SyntheticArgumentBinding synthLocal = null ; if ( this . enclosingInstances == null ) { synthLocal = new SyntheticArgumentBinding ( targetEnclosingType ) ; this . enclosingInstances = new SyntheticArgumentBinding [ ] { synthLocal } ; } else { int size = this . enclosingInstances . length ; int newArgIndex = size ; for ( int i = size ; -- i >= <NUM_LIT:0> ; ) { if ( this . enclosingInstances [ i ] . type == targetEnclosingType ) return this . enclosingInstances [ i ] ; if ( enclosingType ( ) == targetEnclosingType ) newArgIndex = <NUM_LIT:0> ; } SyntheticArgumentBinding [ ] newInstances = new SyntheticArgumentBinding [ size + <NUM_LIT:1> ] ; System . arraycopy ( this . enclosingInstances , <NUM_LIT:0> , newInstances , newArgIndex == <NUM_LIT:0> ? <NUM_LIT:1> : <NUM_LIT:0> , size ) ; newInstances [ newArgIndex ] = synthLocal = new SyntheticArgumentBinding ( targetEnclosingType ) ; this . enclosingInstances = newInstances ; } if ( this . scope . referenceCompilationUnit ( ) . isPropagatingInnerClassEmulation ) updateInnerEmulationDependents ( ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgumentAndField ( LocalVariableBinding actualOuterLocalVariable ) { SyntheticArgumentBinding synthLocal = addSyntheticArgument ( actualOuterLocalVariable ) ; if ( synthLocal == null ) return null ; if ( synthLocal . matchingField == null ) synthLocal . matchingField = addSyntheticFieldForInnerclass ( actualOuterLocalVariable ) ; return synthLocal ; } public SyntheticArgumentBinding addSyntheticArgumentAndField ( ReferenceBinding targetEnclosingType ) { SyntheticArgumentBinding synthLocal = addSyntheticArgument ( targetEnclosingType ) ; if ( synthLocal == null ) return null ; if ( synthLocal . matchingField == null ) synthLocal . matchingField = addSyntheticFieldForInnerclass ( targetEnclosingType ) ; return synthLocal ; } protected void checkRedundantNullnessDefaultRecurse ( ASTNode location , Annotation [ ] annotations , long annotationTagBits ) { ReferenceBinding currentType = this . enclosingType ; do { if ( ! ( ( SourceTypeBinding ) currentType ) . checkRedundantNullnessDefaultOne ( location , annotations , annotationTagBits ) ) { return ; } currentType = currentType . enclosingType ( ) ; } while ( currentType instanceof SourceTypeBinding ) ; super . checkRedundantNullnessDefaultRecurse ( location , annotations , annotationTagBits ) ; } public ReferenceBinding enclosingType ( ) { return this . enclosingType ; } public int getEnclosingInstancesSlotSize ( ) { return this . enclosingInstances == null ? <NUM_LIT:0> : this . enclosingInstances . length ; } public int getOuterLocalVariablesSlotSize ( ) { if ( this . outerLocalVariablesSlotSize < <NUM_LIT:0> ) { this . outerLocalVariablesSlotSize = <NUM_LIT:0> ; int outerLocalsCount = this . outerLocalVariables == null ? <NUM_LIT:0> : this . outerLocalVariables . length ; for ( int i = <NUM_LIT:0> ; i < outerLocalsCount ; i ++ ) { SyntheticArgumentBinding argument = this . outerLocalVariables [ i ] ; switch ( argument . type . id ) { case TypeIds . T_long : case TypeIds . T_double : this . outerLocalVariablesSlotSize += <NUM_LIT:2> ; break ; default : this . outerLocalVariablesSlotSize ++ ; break ; } } } return this . outerLocalVariablesSlotSize ; } public SyntheticArgumentBinding getSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . outerLocalVariables == null ) return null ; for ( int i = this . outerLocalVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( this . outerLocalVariables [ i ] . actualOuterLocalVariable == actualOuterLocalVariable ) return this . outerLocalVariables [ i ] ; return null ; } public SyntheticArgumentBinding getSyntheticArgument ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch ) { if ( this . enclosingInstances == null ) return null ; for ( int i = this . enclosingInstances . length ; -- i >= <NUM_LIT:0> ; ) if ( this . enclosingInstances [ i ] . type == targetEnclosingType ) if ( this . enclosingInstances [ i ] . actualOuterLocalVariable == null ) return this . enclosingInstances [ i ] ; if ( ! onlyExactMatch ) { for ( int i = this . enclosingInstances . length ; -- i >= <NUM_LIT:0> ; ) if ( this . enclosingInstances [ i ] . actualOuterLocalVariable == null ) if ( this . enclosingInstances [ i ] . type . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) return this . enclosingInstances [ i ] ; } return null ; } public SyntheticArgumentBinding [ ] syntheticEnclosingInstances ( ) { return this . enclosingInstances ; } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { if ( this . enclosingTypes == UNINITIALIZED_REFERENCE_TYPES ) { if ( this . enclosingInstances == null ) { this . enclosingTypes = null ; } else { int length = this . enclosingInstances . length ; this . enclosingTypes = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . enclosingTypes [ i ] = ( ReferenceBinding ) this . enclosingInstances [ i ] . type ; } } } return this . enclosingTypes ; } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { return this . outerLocalVariables ; } public void updateInnerEmulationDependents ( ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public interface ExtraCompilerModifiers { final int AccJustFlag = <NUM_LIT> ; final int AccRestrictedAccess = ASTNode . Bit19 ; final int AccFromClassFile = ASTNode . Bit20 ; final int AccDefaultAbstract = ASTNode . Bit20 ; final int AccDeprecatedImplicitly = ASTNode . Bit22 ; final int AccAlternateModifierProblem = ASTNode . Bit23 ; final int AccModifierProblem = ASTNode . Bit24 ; final int AccSemicolonBody = ASTNode . Bit25 ; final int AccUnresolved = ASTNode . Bit26 ; final int AccBlankFinal = ASTNode . Bit27 ; final int AccIsDefaultConstructor = ASTNode . Bit27 ; final int AccLocallyUsed = ASTNode . Bit28 ; final int AccVisibilityMASK = ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ; final int AccOverriding = ASTNode . Bit29 ; final int AccImplementing = ASTNode . Bit30 ; final int AccGenericSignature = ASTNode . Bit31 ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class ParameterizedFieldBinding extends FieldBinding { public FieldBinding originalField ; public ParameterizedFieldBinding ( ParameterizedTypeBinding parameterizedDeclaringClass , FieldBinding originalField ) { super ( originalField . name , ( originalField . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ? parameterizedDeclaringClass : ( originalField . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ? originalField . type : Scope . substitute ( parameterizedDeclaringClass , originalField . type ) , originalField . modifiers , parameterizedDeclaringClass , null ) ; this . originalField = originalField ; this . tagBits = originalField . tagBits ; this . id = originalField . id ; } public Constant constant ( ) { return this . originalField . constant ( ) ; } public FieldBinding original ( ) { return this . originalField . original ( ) ; } public void setConstant ( Constant constant ) { this . originalField . setConstant ( constant ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface Substitution { TypeBinding substitute ( TypeVariableBinding typeVariable ) ; LookupEnvironment environment ( ) ; boolean isRawSubstitution ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class ImportConflictBinding extends ImportBinding { public ReferenceBinding conflictingTypeBinding ; public ImportConflictBinding ( char [ ] [ ] compoundName , Binding methodBinding , ReferenceBinding conflictingTypeBinding , ImportReference reference ) { super ( compoundName , false , methodBinding , reference ) ; this . conflictingTypeBinding = conflictingTypeBinding ; } public char [ ] readableName ( ) { return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } public String toString ( ) { return "<STR_LIT>" + new String ( readableName ( ) ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class SyntheticArgumentBinding extends LocalVariableBinding { { this . tagBits |= TagBits . IsArgument ; this . useFlag = USED ; } public LocalVariableBinding actualOuterLocalVariable ; public FieldBinding matchingField ; public SyntheticArgumentBinding ( LocalVariableBinding actualOuterLocalVariable ) { super ( CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name ) , actualOuterLocalVariable . type , ClassFileConstants . AccFinal , true ) ; this . actualOuterLocalVariable = actualOuterLocalVariable ; } public SyntheticArgumentBinding ( ReferenceBinding enclosingType ) { super ( CharOperation . concat ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , String . valueOf ( enclosingType . depth ( ) ) . toCharArray ( ) ) , enclosingType , ClassFileConstants . AccFinal , true ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; public class ClassScope extends Scope { public TypeDeclaration referenceContext ; public TypeReference superTypeReference ; java . util . ArrayList deferredBoundChecks ; public ClassScope ( Scope parent , TypeDeclaration context ) { super ( Scope . CLASS_SCOPE , parent ) ; this . referenceContext = context ; this . deferredBoundChecks = null ; } void buildAnonymousTypeBinding ( SourceTypeBinding enclosingType , ReferenceBinding supertype ) { LocalTypeBinding anonymousType = buildLocalType ( enclosingType , enclosingType . fPackage ) ; anonymousType . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; if ( supertype . isInterface ( ) ) { anonymousType . superclass = getJavaLangObject ( ) ; anonymousType . superInterfaces = new ReferenceBinding [ ] { supertype } ; TypeReference typeReference = this . referenceContext . allocation . type ; if ( typeReference != null ) { if ( ( supertype . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( anonymousType , typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superInterfaces = Binding . NO_SUPERINTERFACES ; } } } else { anonymousType . superclass = supertype ; anonymousType . superInterfaces = Binding . NO_SUPERINTERFACES ; TypeReference typeReference = this . referenceContext . allocation . type ; if ( typeReference != null ) { if ( supertype . erasure ( ) . id == TypeIds . T_JavaLangEnum ) { problemReporter ( ) . cannotExtendEnum ( anonymousType , typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superclass = getJavaLangObject ( ) ; } else if ( supertype . isFinal ( ) ) { problemReporter ( ) . anonymousClassCannotExtendFinalClass ( typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superclass = getJavaLangObject ( ) ; } else if ( ( supertype . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( anonymousType , typeReference , supertype ) ; anonymousType . tagBits |= TagBits . HierarchyHasProblems ; anonymousType . superclass = getJavaLangObject ( ) ; } } } connectMemberTypes ( ) ; buildFieldsAndMethods ( ) ; anonymousType . faultInTypesForFieldsAndMethods ( ) ; anonymousType . verifyMethods ( environment ( ) . methodVerifier ( ) ) ; } void buildFields ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . areFieldsInitialized ( ) ) return ; if ( this . referenceContext . fields == null ) { sourceType . setFields ( Binding . NO_FIELDS ) ; return ; } FieldDeclaration [ ] fields = this . referenceContext . fields ; int size = fields . length ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { switch ( fields [ i ] . getKind ( ) ) { case AbstractVariableDeclaration . FIELD : case AbstractVariableDeclaration . ENUM_CONSTANT : count ++ ; } } FieldBinding [ ] fieldBindings = new FieldBinding [ count ] ; HashtableOfObject knownFieldNames = new HashtableOfObject ( count ) ; count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( field . getKind ( ) == AbstractVariableDeclaration . INITIALIZER ) { } else { FieldBinding fieldBinding = new FieldBinding ( field , null , field . modifiers | ExtraCompilerModifiers . AccUnresolved , sourceType ) ; fieldBinding . id = count ; checkAndSetModifiersForField ( fieldBinding , field ) ; if ( knownFieldNames . containsKey ( field . name ) ) { FieldBinding previousBinding = ( FieldBinding ) knownFieldNames . get ( field . name ) ; if ( previousBinding != null ) { for ( int f = <NUM_LIT:0> ; f < i ; f ++ ) { FieldDeclaration previousField = fields [ f ] ; if ( previousField . binding == previousBinding ) { problemReporter ( ) . duplicateFieldInType ( sourceType , previousField ) ; break ; } } } knownFieldNames . put ( field . name , null ) ; problemReporter ( ) . duplicateFieldInType ( sourceType , field ) ; field . binding = null ; } else { knownFieldNames . put ( field . name , fieldBinding ) ; fieldBindings [ count ++ ] = fieldBinding ; } } } if ( count != fieldBindings . length ) System . arraycopy ( fieldBindings , <NUM_LIT:0> , fieldBindings = new FieldBinding [ count ] , <NUM_LIT:0> , count ) ; sourceType . tagBits &= ~ ( TagBits . AreFieldsSorted | TagBits . AreFieldsComplete ) ; sourceType . setFields ( fieldBindings ) ; } void buildFieldsAndMethods ( ) { buildFields ( ) ; buildMethods ( ) ; SourceTypeBinding sourceType = this . referenceContext . binding ; if ( ! sourceType . isPrivate ( ) && sourceType . superclass instanceof SourceTypeBinding && sourceType . superclass . isPrivate ( ) ) ( ( SourceTypeBinding ) sourceType . superclass ) . tagIndirectlyAccessibleMembers ( ) ; if ( sourceType . isMemberType ( ) && ! sourceType . isLocalType ( ) ) ( ( MemberTypeBinding ) sourceType ) . checkSyntheticArgsAndFields ( ) ; ReferenceBinding [ ] memberTypes = sourceType . memberTypes ; for ( int i = <NUM_LIT:0> , length = memberTypes . length ; i < length ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . buildFieldsAndMethods ( ) ; } private LocalTypeBinding buildLocalType ( SourceTypeBinding enclosingType , PackageBinding packageBinding ) { this . referenceContext . scope = this ; this . referenceContext . staticInitializerScope = new MethodScope ( this , this . referenceContext , true ) ; this . referenceContext . initializerScope = new MethodScope ( this , this . referenceContext , false ) ; LocalTypeBinding localType = new LocalTypeBinding ( this , enclosingType , innermostSwitchCase ( ) ) ; this . referenceContext . binding = localType ; checkAndSetModifiers ( ) ; buildTypeVariables ( ) ; ReferenceBinding [ ] memberTypeBindings = Binding . NO_MEMBER_TYPES ; if ( this . referenceContext . memberTypes != null ) { int size = this . referenceContext . memberTypes . length ; memberTypeBindings = new ReferenceBinding [ size ] ; int count = <NUM_LIT:0> ; nextMember : for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { TypeDeclaration memberContext = this . referenceContext . memberTypes [ i ] ; switch ( TypeDeclaration . kind ( memberContext . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : problemReporter ( ) . illegalLocalTypeDeclaration ( memberContext ) ; continue nextMember ; } ReferenceBinding type = localType ; do { if ( CharOperation . equals ( type . sourceName , memberContext . name ) ) { problemReporter ( ) . typeCollidesWithEnclosingType ( memberContext ) ; continue nextMember ; } type = type . enclosingType ( ) ; } while ( type != null ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( CharOperation . equals ( this . referenceContext . memberTypes [ j ] . name , memberContext . name ) ) { problemReporter ( ) . duplicateNestedType ( memberContext ) ; continue nextMember ; } } ClassScope memberScope = new ClassScope ( this , this . referenceContext . memberTypes [ i ] ) ; LocalTypeBinding memberBinding = memberScope . buildLocalType ( localType , packageBinding ) ; memberBinding . setAsMemberType ( ) ; memberTypeBindings [ count ++ ] = memberBinding ; } if ( count != size ) System . arraycopy ( memberTypeBindings , <NUM_LIT:0> , memberTypeBindings = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; } localType . memberTypes = memberTypeBindings ; return localType ; } void buildLocalTypeBinding ( SourceTypeBinding enclosingType ) { LocalTypeBinding localType = buildLocalType ( enclosingType , enclosingType . fPackage ) ; connectTypeHierarchy ( ) ; if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { checkParameterizedTypeBounds ( ) ; checkParameterizedSuperTypeCollisions ( ) ; } buildFieldsAndMethods ( ) ; localType . faultInTypesForFieldsAndMethods ( ) ; this . referenceContext . binding . verifyMethods ( environment ( ) . methodVerifier ( ) ) ; } private void buildMemberTypes ( AccessRestriction accessRestriction ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding [ ] memberTypeBindings = Binding . NO_MEMBER_TYPES ; if ( this . referenceContext . memberTypes != null ) { int length = this . referenceContext . memberTypes . length ; memberTypeBindings = new ReferenceBinding [ length ] ; int count = <NUM_LIT:0> ; nextMember : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeDeclaration memberContext = this . referenceContext . memberTypes [ i ] ; switch ( TypeDeclaration . kind ( memberContext . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : if ( sourceType . isNestedType ( ) && sourceType . isClass ( ) && ! sourceType . isStatic ( ) ) { problemReporter ( ) . illegalLocalTypeDeclaration ( memberContext ) ; continue nextMember ; } break ; } ReferenceBinding type = sourceType ; do { if ( CharOperation . equals ( type . sourceName , memberContext . name ) ) { problemReporter ( ) . typeCollidesWithEnclosingType ( memberContext ) ; continue nextMember ; } type = type . enclosingType ( ) ; } while ( type != null ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( CharOperation . equals ( this . referenceContext . memberTypes [ j ] . name , memberContext . name ) ) { problemReporter ( ) . duplicateNestedType ( memberContext ) ; continue nextMember ; } } ClassScope memberScope = buildClassScope ( this , memberContext ) ; memberTypeBindings [ count ++ ] = memberScope . buildType ( sourceType , sourceType . fPackage , accessRestriction ) ; } if ( count != length ) System . arraycopy ( memberTypeBindings , <NUM_LIT:0> , memberTypeBindings = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; } sourceType . memberTypes = memberTypeBindings ; } protected ClassScope buildClassScope ( Scope parent , TypeDeclaration typeDecl ) { return new ClassScope ( parent , typeDecl ) ; } void buildMethods ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . areMethodsInitialized ( ) ) return ; boolean isEnum = TypeDeclaration . kind ( this . referenceContext . modifiers ) == TypeDeclaration . ENUM_DECL ; if ( this . referenceContext . methods == null && ! isEnum ) { this . referenceContext . binding . setMethods ( Binding . NO_METHODS ) ; return ; } AbstractMethodDeclaration [ ] methods = this . referenceContext . methods ; int size = methods == null ? <NUM_LIT:0> : methods . length ; int clinitIndex = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( methods [ i ] . isClinit ( ) ) { clinitIndex = i ; break ; } } int count = isEnum ? <NUM_LIT:2> : <NUM_LIT:0> ; MethodBinding [ ] methodBindings = new MethodBinding [ ( clinitIndex == - <NUM_LIT:1> ? size : size - <NUM_LIT:1> ) + count ] ; if ( isEnum ) { methodBindings [ <NUM_LIT:0> ] = sourceType . addSyntheticEnumMethod ( TypeConstants . VALUES ) ; methodBindings [ <NUM_LIT:1> ] = sourceType . addSyntheticEnumMethod ( TypeConstants . VALUEOF ) ; } boolean hasNativeMethods = false ; if ( sourceType . isAbstract ( ) ) { for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( i != clinitIndex ) { MethodScope scope = new MethodScope ( this , methods [ i ] , false ) ; MethodBinding methodBinding = scope . createMethod ( methods [ i ] ) ; if ( methodBinding != null ) { methodBindings [ count ++ ] = methodBinding ; hasNativeMethods = hasNativeMethods || methodBinding . isNative ( ) ; } } } } else { boolean hasAbstractMethods = false ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { if ( i != clinitIndex ) { MethodScope scope = new MethodScope ( this , methods [ i ] , false ) ; MethodBinding methodBinding = scope . createMethod ( methods [ i ] ) ; if ( methodBinding != null ) { methodBindings [ count ++ ] = methodBinding ; hasAbstractMethods = hasAbstractMethods || methodBinding . isAbstract ( ) ; hasNativeMethods = hasNativeMethods || methodBinding . isNative ( ) ; } } } if ( hasAbstractMethods ) problemReporter ( ) . abstractMethodInConcreteClass ( sourceType ) ; } if ( count != methodBindings . length ) System . arraycopy ( methodBindings , <NUM_LIT:0> , methodBindings = new MethodBinding [ count ] , <NUM_LIT:0> , count ) ; methodBindings = augmentMethodBindings ( methodBindings ) ; sourceType . tagBits &= ~ ( TagBits . AreMethodsSorted | TagBits . AreMethodsComplete ) ; sourceType . setMethods ( methodBindings ) ; if ( hasNativeMethods ) { for ( int i = <NUM_LIT:0> ; i < methodBindings . length ; i ++ ) { methodBindings [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } FieldBinding [ ] fields = sourceType . unResolvedFields ( ) ; for ( int i = <NUM_LIT:0> ; i < fields . length ; i ++ ) { fields [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } } protected MethodBinding [ ] augmentMethodBindings ( MethodBinding [ ] methodBindings ) { return methodBindings ; } SourceTypeBinding buildType ( SourceTypeBinding enclosingType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { this . referenceContext . scope = this ; this . referenceContext . staticInitializerScope = new MethodScope ( this , this . referenceContext , true ) ; this . referenceContext . initializerScope = new MethodScope ( this , this . referenceContext , false ) ; if ( enclosingType == null ) { char [ ] [ ] className = CharOperation . arrayConcat ( packageBinding . compoundName , this . referenceContext . name ) ; this . referenceContext . binding = new SourceTypeBinding ( className , packageBinding , this ) ; } else { char [ ] [ ] className = CharOperation . deepCopy ( enclosingType . compoundName ) ; className [ className . length - <NUM_LIT:1> ] = CharOperation . concat ( className [ className . length - <NUM_LIT:1> ] , this . referenceContext . name , '<CHAR_LIT>' ) ; ReferenceBinding existingType = packageBinding . getType0 ( className [ className . length - <NUM_LIT:1> ] ) ; if ( existingType != null ) { if ( existingType instanceof UnresolvedReferenceBinding ) { } else { this . parent . problemReporter ( ) . duplicateNestedType ( this . referenceContext ) ; } } this . referenceContext . binding = new MemberTypeBinding ( className , this , enclosingType ) ; } SourceTypeBinding sourceType = this . referenceContext . binding ; environment ( ) . setAccessRestriction ( sourceType , accessRestriction ) ; sourceType . fPackage . addType ( sourceType ) ; checkAndSetModifiers ( ) ; buildTypeVariables ( ) ; buildMemberTypes ( accessRestriction ) ; return sourceType ; } private void buildTypeVariables ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; TypeParameter [ ] typeParameters = this . referenceContext . typeParameters ; if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) { sourceType . typeVariables = Binding . NO_TYPE_VARIABLES ; return ; } sourceType . typeVariables = Binding . NO_TYPE_VARIABLES ; if ( sourceType . id == TypeIds . T_JavaLangObject ) { problemReporter ( ) . objectCannotBeGeneric ( this . referenceContext ) ; return ; } sourceType . typeVariables = createTypeVariables ( typeParameters , sourceType ) ; sourceType . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } private void checkAndSetModifiers ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; int modifiers = sourceType . modifiers ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> ) problemReporter ( ) . duplicateModifierForType ( sourceType ) ; ReferenceBinding enclosingType = sourceType . enclosingType ( ) ; boolean isMemberType = sourceType . isMemberType ( ) ; if ( isMemberType ) { modifiers |= ( enclosingType . modifiers & ( ExtraCompilerModifiers . AccGenericSignature | ClassFileConstants . AccStrictfp ) ) ; if ( enclosingType . isInterface ( ) ) modifiers |= ClassFileConstants . AccPublic ; if ( sourceType . isEnum ( ) ) { if ( ! enclosingType . isStatic ( ) ) problemReporter ( ) . nonStaticContextForEnumMemberType ( sourceType ) ; else modifiers |= ClassFileConstants . AccStatic ; } } else if ( sourceType . isLocalType ( ) ) { if ( sourceType . isEnum ( ) ) { problemReporter ( ) . illegalLocalTypeDeclaration ( this . referenceContext ) ; sourceType . modifiers = <NUM_LIT:0> ; return ; } if ( sourceType . isAnonymousType ( ) ) { modifiers |= ClassFileConstants . AccFinal ; if ( this . referenceContext . allocation . type == null ) modifiers |= ClassFileConstants . AccEnum ; } Scope scope = this ; do { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; if ( methodScope . isInsideInitializer ( ) ) { SourceTypeBinding type = ( ( TypeDeclaration ) methodScope . referenceContext ) . binding ; if ( methodScope . initializedField != null ) { if ( methodScope . initializedField . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } else { if ( type . isStrictfp ( ) ) modifiers |= ClassFileConstants . AccStrictfp ; if ( type . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } else { MethodBinding method = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( method != null ) { if ( method . isStrictfp ( ) ) modifiers |= ClassFileConstants . AccStrictfp ; if ( method . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; } } break ; case CLASS_SCOPE : if ( enclosingType . isStrictfp ( ) ) modifiers |= ClassFileConstants . AccStrictfp ; if ( enclosingType . isViewedAsDeprecated ( ) && ! sourceType . isDeprecated ( ) ) modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; break ; } scope = scope . parent ; } while ( scope != null ) ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; if ( ( realModifiers & ClassFileConstants . AccInterface ) != <NUM_LIT:0> ) { if ( isMemberType ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStatic | ClassFileConstants . AccAbstract | ClassFileConstants . AccInterface | ClassFileConstants . AccStrictfp | ClassFileConstants . AccAnnotation ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { if ( ( realModifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationMemberType ( sourceType ) ; else problemReporter ( ) . illegalModifierForMemberInterface ( sourceType ) ; } } else { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract | ClassFileConstants . AccInterface | ClassFileConstants . AccStrictfp | ClassFileConstants . AccAnnotation ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { if ( ( realModifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationType ( sourceType ) ; else problemReporter ( ) . illegalModifierForInterface ( sourceType ) ; } } if ( sourceType . sourceName == TypeConstants . PACKAGE_INFO_NAME && compilerOptions ( ) . targetJDK > ClassFileConstants . JDK1_5 ) { modifiers |= ClassFileConstants . AccSynthetic ; } modifiers |= ClassFileConstants . AccAbstract ; } else if ( ( realModifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { if ( isMemberType ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStatic | ClassFileConstants . AccStrictfp | ClassFileConstants . AccEnum ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForMemberEnum ( sourceType ) ; modifiers &= ~ ClassFileConstants . AccAbstract ; realModifiers &= ~ ClassFileConstants . AccAbstract ; } } else if ( sourceType . isLocalType ( ) ) { } else { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccStrictfp | ClassFileConstants . AccEnum ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForEnum ( sourceType ) ; } if ( ! sourceType . isAnonymousType ( ) ) { checkAbstractEnum : { if ( ( this . referenceContext . bits & ASTNode . HasAbstractMethods ) != <NUM_LIT:0> ) { modifiers |= ClassFileConstants . AccAbstract ; break checkAbstractEnum ; } TypeDeclaration typeDeclaration = this . referenceContext ; FieldDeclaration [ ] fields = typeDeclaration . fields ; int fieldsLength = fields == null ? <NUM_LIT:0> : fields . length ; if ( fieldsLength == <NUM_LIT:0> ) break checkAbstractEnum ; AbstractMethodDeclaration [ ] methods = typeDeclaration . methods ; int methodsLength = methods == null ? <NUM_LIT:0> : methods . length ; boolean definesAbstractMethod = typeDeclaration . superInterfaces != null ; for ( int i = <NUM_LIT:0> ; i < methodsLength && ! definesAbstractMethod ; i ++ ) definesAbstractMethod = methods [ i ] . isAbstract ( ) ; if ( ! definesAbstractMethod ) break checkAbstractEnum ; boolean needAbstractBit = false ; for ( int i = <NUM_LIT:0> ; i < fieldsLength ; i ++ ) { FieldDeclaration fieldDecl = fields [ i ] ; if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { if ( fieldDecl . initialization instanceof QualifiedAllocationExpression ) { needAbstractBit = true ; } else { break checkAbstractEnum ; } } } if ( needAbstractBit ) { modifiers |= ClassFileConstants . AccAbstract ; } } checkFinalEnum : { TypeDeclaration typeDeclaration = this . referenceContext ; FieldDeclaration [ ] fields = typeDeclaration . fields ; if ( fields != null ) { for ( int i = <NUM_LIT:0> , fieldsLength = fields . length ; i < fieldsLength ; i ++ ) { FieldDeclaration fieldDecl = fields [ i ] ; if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { if ( fieldDecl . initialization instanceof QualifiedAllocationExpression ) { break checkFinalEnum ; } } } } modifiers |= ClassFileConstants . AccFinal ; } } } else { if ( isMemberType ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccStatic | ClassFileConstants . AccAbstract | ClassFileConstants . AccFinal | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForMemberClass ( sourceType ) ; } else if ( sourceType . isLocalType ( ) ) { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccAbstract | ClassFileConstants . AccFinal | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForLocalClass ( sourceType ) ; } else { final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract | ClassFileConstants . AccFinal | ClassFileConstants . AccStrictfp ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForClass ( sourceType ) ; } if ( ( realModifiers & ( ClassFileConstants . AccFinal | ClassFileConstants . AccAbstract ) ) == ( ClassFileConstants . AccFinal | ClassFileConstants . AccAbstract ) ) problemReporter ( ) . illegalModifierCombinationFinalAbstractForClass ( sourceType ) ; } if ( isMemberType ) { if ( enclosingType . isInterface ( ) ) { if ( ( realModifiers & ( ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalVisibilityModifierForInterfaceMemberType ( sourceType ) ; if ( ( realModifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( realModifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } } else { int accessorBits = realModifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ; if ( ( accessorBits & ( accessorBits - <NUM_LIT:1> ) ) > <NUM_LIT:1> ) { problemReporter ( ) . illegalVisibilityModifierCombinationForMemberType ( sourceType ) ; if ( ( accessorBits & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } else if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> && ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) { modifiers &= ~ ClassFileConstants . AccPrivate ; } } } if ( ( realModifiers & ClassFileConstants . AccStatic ) == <NUM_LIT:0> ) { if ( enclosingType . isInterface ( ) ) modifiers |= ClassFileConstants . AccStatic ; } else if ( ! enclosingType . isStatic ( ) ) { problemReporter ( ) . illegalStaticModifierForMemberType ( sourceType ) ; } } sourceType . modifiers = modifiers ; } private void checkAndSetModifiersForField ( FieldBinding fieldBinding , FieldDeclaration fieldDecl ) { int modifiers = fieldBinding . modifiers ; final ReferenceBinding declaringClass = fieldBinding . declaringClass ; if ( ( modifiers & ExtraCompilerModifiers . AccAlternateModifierProblem ) != <NUM_LIT:0> ) problemReporter ( ) . duplicateModifierForField ( declaringClass , fieldDecl ) ; if ( declaringClass . isInterface ( ) ) { final int IMPLICIT_MODIFIERS = ClassFileConstants . AccPublic | ClassFileConstants . AccStatic | ClassFileConstants . AccFinal ; modifiers |= IMPLICIT_MODIFIERS ; if ( ( modifiers & ExtraCompilerModifiers . AccJustFlag ) != IMPLICIT_MODIFIERS ) { if ( ( declaringClass . modifiers & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForAnnotationField ( fieldDecl ) ; else problemReporter ( ) . illegalModifierForInterfaceField ( fieldDecl ) ; } fieldBinding . modifiers = modifiers ; return ; } else if ( fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { if ( ( modifiers & ExtraCompilerModifiers . AccJustFlag ) != <NUM_LIT:0> ) problemReporter ( ) . illegalModifierForEnumConstant ( declaringClass , fieldDecl ) ; final int IMPLICIT_MODIFIERS = ClassFileConstants . AccPublic | ClassFileConstants . AccStatic | ClassFileConstants . AccFinal | ClassFileConstants . AccEnum | ExtraCompilerModifiers . AccLocallyUsed ; fieldBinding . modifiers |= IMPLICIT_MODIFIERS ; return ; } int realModifiers = modifiers & ExtraCompilerModifiers . AccJustFlag ; final int UNEXPECTED_MODIFIERS = ~ ( ClassFileConstants . AccPublic | ClassFileConstants . AccPrivate | ClassFileConstants . AccProtected | ClassFileConstants . AccFinal | ClassFileConstants . AccStatic | ClassFileConstants . AccTransient | ClassFileConstants . AccVolatile ) ; if ( ( realModifiers & UNEXPECTED_MODIFIERS ) != <NUM_LIT:0> ) { problemReporter ( ) . illegalModifierForField ( declaringClass , fieldDecl ) ; modifiers &= ~ ExtraCompilerModifiers . AccJustFlag | ~ UNEXPECTED_MODIFIERS ; } int accessorBits = realModifiers & ( ClassFileConstants . AccPublic | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate ) ; if ( ( accessorBits & ( accessorBits - <NUM_LIT:1> ) ) > <NUM_LIT:1> ) { problemReporter ( ) . illegalVisibilityModifierCombinationForField ( declaringClass , fieldDecl ) ; if ( ( accessorBits & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) { if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccProtected ; if ( ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) modifiers &= ~ ClassFileConstants . AccPrivate ; } else if ( ( accessorBits & ClassFileConstants . AccProtected ) != <NUM_LIT:0> && ( accessorBits & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) { modifiers &= ~ ClassFileConstants . AccPrivate ; } } if ( ( realModifiers & ( ClassFileConstants . AccFinal | ClassFileConstants . AccVolatile ) ) == ( ClassFileConstants . AccFinal | ClassFileConstants . AccVolatile ) ) problemReporter ( ) . illegalModifierCombinationFinalVolatileForField ( declaringClass , fieldDecl ) ; if ( fieldDecl . initialization == null && ( modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ) modifiers |= ExtraCompilerModifiers . AccBlankFinal ; fieldBinding . modifiers = modifiers ; } public void checkParameterizedSuperTypeCollisions ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding [ ] interfaces = sourceType . superInterfaces ; Map invocations = new HashMap ( <NUM_LIT:2> ) ; ReferenceBinding itsSuperclass = sourceType . isInterface ( ) ? null : sourceType . superclass ; nextInterface : for ( int i = <NUM_LIT:0> , length = interfaces . length ; i < length ; i ++ ) { ReferenceBinding one = interfaces [ i ] ; if ( one == null ) continue nextInterface ; if ( itsSuperclass != null && hasErasedCandidatesCollisions ( itsSuperclass , one , invocations , sourceType , this . referenceContext ) ) continue nextInterface ; nextOtherInterface : for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { ReferenceBinding two = interfaces [ j ] ; if ( two == null ) continue nextOtherInterface ; if ( hasErasedCandidatesCollisions ( one , two , invocations , sourceType , this . referenceContext ) ) continue nextInterface ; } } TypeParameter [ ] typeParameters = this . referenceContext . typeParameters ; nextVariable : for ( int i = <NUM_LIT:0> , paramLength = typeParameters == null ? <NUM_LIT:0> : typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; if ( typeVariable == null || ! typeVariable . isValidBinding ( ) ) continue nextVariable ; TypeReference [ ] boundRefs = typeParameter . bounds ; if ( boundRefs != null ) { boolean checkSuperclass = typeVariable . firstBound == typeVariable . superclass ; for ( int j = <NUM_LIT:0> , boundLength = boundRefs . length ; j < boundLength ; j ++ ) { TypeReference typeRef = boundRefs [ j ] ; TypeBinding superType = typeRef . resolvedType ; if ( superType == null || ! superType . isValidBinding ( ) ) continue ; if ( checkSuperclass ) if ( hasErasedCandidatesCollisions ( superType , typeVariable . superclass , invocations , typeVariable , typeRef ) ) continue nextVariable ; for ( int index = typeVariable . superInterfaces . length ; -- index >= <NUM_LIT:0> ; ) if ( hasErasedCandidatesCollisions ( superType , typeVariable . superInterfaces [ index ] , invocations , typeVariable , typeRef ) ) continue nextVariable ; } } } ReferenceBinding [ ] memberTypes = this . referenceContext . binding . memberTypes ; if ( memberTypes != null && memberTypes != Binding . NO_MEMBER_TYPES ) for ( int i = <NUM_LIT:0> , size = memberTypes . length ; i < size ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . checkParameterizedSuperTypeCollisions ( ) ; } private void checkForInheritedMemberTypes ( SourceTypeBinding sourceType ) { ReferenceBinding currentType = sourceType ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { if ( currentType . hasMemberTypes ( ) ) return ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null && ( currentType . tagBits & TagBits . HasNoMemberTypes ) == <NUM_LIT:0> ) ; if ( interfacesToVisit != null ) { boolean needToTag = false ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; if ( ( anInterface . tagBits & TagBits . HasNoMemberTypes ) == <NUM_LIT:0> ) { if ( anInterface . hasMemberTypes ( ) ) return ; needToTag = true ; ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( needToTag ) { for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) interfacesToVisit [ i ] . tagBits |= TagBits . HasNoMemberTypes ; } } currentType = sourceType ; do { currentType . tagBits |= TagBits . HasNoMemberTypes ; } while ( ( currentType = currentType . superclass ( ) ) != null && ( currentType . tagBits & TagBits . HasNoMemberTypes ) == <NUM_LIT:0> ) ; } public void checkParameterizedTypeBounds ( ) { for ( int i = <NUM_LIT:0> , l = this . deferredBoundChecks == null ? <NUM_LIT:0> : this . deferredBoundChecks . size ( ) ; i < l ; i ++ ) ( ( TypeReference ) this . deferredBoundChecks . get ( i ) ) . checkBounds ( this ) ; this . deferredBoundChecks = null ; ReferenceBinding [ ] memberTypes = this . referenceContext . binding . memberTypes ; if ( memberTypes != null && memberTypes != Binding . NO_MEMBER_TYPES ) for ( int i = <NUM_LIT:0> , size = memberTypes . length ; i < size ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . checkParameterizedTypeBounds ( ) ; } private void connectMemberTypes ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding [ ] memberTypes = sourceType . memberTypes ; if ( memberTypes != null && memberTypes != Binding . NO_MEMBER_TYPES ) { for ( int i = <NUM_LIT:0> , size = memberTypes . length ; i < size ; i ++ ) ( ( SourceTypeBinding ) memberTypes [ i ] ) . scope . connectTypeHierarchy ( ) ; } } private boolean connectSuperclass ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . id == TypeIds . T_JavaLangObject ) { sourceType . superclass = null ; sourceType . superInterfaces = Binding . NO_SUPERINTERFACES ; if ( ! sourceType . isClass ( ) ) problemReporter ( ) . objectMustBeClass ( sourceType ) ; if ( this . referenceContext . superclass != null || ( this . referenceContext . superInterfaces != null && this . referenceContext . superInterfaces . length > <NUM_LIT:0> ) ) problemReporter ( ) . objectCannotHaveSuperTypes ( sourceType ) ; return true ; } if ( this . referenceContext . superclass == null ) { if ( sourceType . isEnum ( ) && compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) return connectEnumSuperclass ( ) ; sourceType . superclass = getJavaLangObject ( ) ; return ! detectHierarchyCycle ( sourceType , sourceType . superclass , null ) ; } TypeReference superclassRef = this . referenceContext . superclass ; ReferenceBinding superclass = findSupertype ( superclassRef ) ; if ( superclass != null ) { if ( ! superclass . isClass ( ) && ( superclass . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( shouldReport ( IProblem . SuperclassMustBeAClass ) ) problemReporter ( ) . superclassMustBeAClass ( sourceType , superclassRef , superclass ) ; } else if ( superclass . isFinal ( ) ) { problemReporter ( ) . classExtendFinalClass ( sourceType , superclassRef , superclass ) ; } else if ( ( superclass . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( sourceType , superclassRef , superclass ) ; } else if ( superclass . erasure ( ) . id == TypeIds . T_JavaLangEnum ) { problemReporter ( ) . cannotExtendEnum ( sourceType , superclassRef , superclass ) ; } else if ( ( superclass . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> || ! superclassRef . resolvedType . isValidBinding ( ) ) { sourceType . superclass = superclass ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; return superclassRef . resolvedType . isValidBinding ( ) ; } else { sourceType . superclass = superclass ; sourceType . typeBits |= ( superclass . typeBits & TypeIds . InheritableBits ) ; if ( ( sourceType . typeBits & ( TypeIds . BitAutoCloseable | TypeIds . BitCloseable ) ) != <NUM_LIT:0> ) sourceType . typeBits |= sourceType . applyCloseableWhitelists ( ) ; return true ; } } sourceType . tagBits |= TagBits . HierarchyHasProblems ; sourceType . superclass = getJavaLangObject ( ) ; if ( ( sourceType . superclass . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> ) detectHierarchyCycle ( sourceType , sourceType . superclass , null ) ; return false ; } public boolean shouldReport ( int i ) { return true ; } private boolean connectEnumSuperclass ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; ReferenceBinding rootEnumType = getJavaLangEnum ( ) ; if ( ( rootEnumType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; sourceType . superclass = rootEnumType ; return false ; } boolean foundCycle = detectHierarchyCycle ( sourceType , rootEnumType , null ) ; TypeVariableBinding [ ] refTypeVariables = rootEnumType . typeVariables ( ) ; if ( refTypeVariables == Binding . NO_TYPE_VARIABLES ) { problemReporter ( ) . nonGenericTypeCannotBeParameterized ( <NUM_LIT:0> , null , rootEnumType , new TypeBinding [ ] { sourceType } ) ; return false ; } else if ( <NUM_LIT:1> != refTypeVariables . length ) { problemReporter ( ) . incorrectArityForParameterizedType ( null , rootEnumType , new TypeBinding [ ] { sourceType } ) ; return false ; } ParameterizedTypeBinding superType = environment ( ) . createParameterizedType ( rootEnumType , new TypeBinding [ ] { environment ( ) . convertToRawType ( sourceType , false ) , } , null ) ; sourceType . tagBits |= ( superType . tagBits & TagBits . HierarchyHasProblems ) ; sourceType . superclass = superType ; if ( refTypeVariables [ <NUM_LIT:0> ] . boundCheck ( superType , sourceType ) != TypeConstants . OK ) { problemReporter ( ) . typeMismatchError ( rootEnumType , refTypeVariables [ <NUM_LIT:0> ] , sourceType , null ) ; } return ! foundCycle ; } protected boolean connectSuperInterfaces ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; sourceType . superInterfaces = Binding . NO_SUPERINTERFACES ; if ( this . referenceContext . superInterfaces == null ) { if ( sourceType . isAnnotationType ( ) && compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { ReferenceBinding annotationType = getJavaLangAnnotationAnnotation ( ) ; boolean foundCycle = detectHierarchyCycle ( sourceType , annotationType , null ) ; sourceType . superInterfaces = new ReferenceBinding [ ] { annotationType } ; return ! foundCycle ; } return true ; } if ( sourceType . id == TypeIds . T_JavaLangObject ) return true ; boolean noProblems = true ; int length = this . referenceContext . superInterfaces . length ; ReferenceBinding [ ] interfaceBindings = new ReferenceBinding [ length ] ; int count = <NUM_LIT:0> ; nextInterface : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference superInterfaceRef = this . referenceContext . superInterfaces [ i ] ; ReferenceBinding superInterface = findSupertype ( superInterfaceRef ) ; if ( superInterface == null ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( interfaceBindings [ j ] == superInterface ) { problemReporter ( ) . duplicateSuperinterface ( sourceType , superInterfaceRef , superInterface ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } } if ( ! superInterface . isInterface ( ) && ( superInterface . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { problemReporter ( ) . superinterfaceMustBeAnInterface ( sourceType , superInterfaceRef , superInterface ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } else if ( superInterface . isAnnotationType ( ) ) { problemReporter ( ) . annotationTypeUsedAsSuperinterface ( sourceType , superInterfaceRef , superInterface ) ; } if ( ( superInterface . tagBits & TagBits . HasDirectWildcard ) != <NUM_LIT:0> ) { problemReporter ( ) . superTypeCannotUseWildcard ( sourceType , superInterfaceRef , superInterface ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems = false ; continue nextInterface ; } if ( ( superInterface . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> || ! superInterfaceRef . resolvedType . isValidBinding ( ) ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; noProblems &= superInterfaceRef . resolvedType . isValidBinding ( ) ; } sourceType . typeBits |= ( superInterface . typeBits & TypeIds . InheritableBits ) ; interfaceBindings [ count ++ ] = superInterface ; } if ( count > <NUM_LIT:0> ) { if ( count != length ) System . arraycopy ( interfaceBindings , <NUM_LIT:0> , interfaceBindings = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; sourceType . superInterfaces = interfaceBindings ; } return noProblems ; } void connectTypeHierarchy ( ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( ( sourceType . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . BeginHierarchyCheck ; environment ( ) . typesBeingConnected . add ( sourceType ) ; boolean noProblems = connectSuperclass ( ) ; noProblems &= connectSuperInterfaces ( ) ; environment ( ) . typesBeingConnected . remove ( sourceType ) ; sourceType . tagBits |= TagBits . EndHierarchyCheck ; noProblems &= connectTypeVariables ( this . referenceContext . typeParameters , false ) ; sourceType . tagBits |= TagBits . TypeVariablesAreConnected ; if ( noProblems && sourceType . isHierarchyInconsistent ( ) ) problemReporter ( ) . hierarchyHasProblems ( sourceType ) ; } connectMemberTypes ( ) ; LookupEnvironment env = environment ( ) ; try { env . missingClassFileLocation = this . referenceContext ; checkForInheritedMemberTypes ( sourceType ) ; } catch ( AbortCompilation e ) { e . updateContext ( this . referenceContext , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } private void connectTypeHierarchyWithoutMembers ( ) { if ( this . parent instanceof CompilationUnitScope ) { if ( ( ( CompilationUnitScope ) this . parent ) . imports == null ) ( ( CompilationUnitScope ) this . parent ) . checkAndSetImports ( ) ; } else if ( this . parent instanceof ClassScope ) { ( ( ClassScope ) this . parent ) . connectTypeHierarchyWithoutMembers ( ) ; } SourceTypeBinding sourceType = this . referenceContext . binding ; if ( ( sourceType . tagBits & TagBits . BeginHierarchyCheck ) != <NUM_LIT:0> ) return ; sourceType . tagBits |= TagBits . BeginHierarchyCheck ; environment ( ) . typesBeingConnected . add ( sourceType ) ; boolean noProblems = connectSuperclass ( ) ; noProblems &= connectSuperInterfaces ( ) ; environment ( ) . typesBeingConnected . remove ( sourceType ) ; sourceType . tagBits |= TagBits . EndHierarchyCheck ; noProblems &= connectTypeVariables ( this . referenceContext . typeParameters , false ) ; sourceType . tagBits |= TagBits . TypeVariablesAreConnected ; if ( noProblems && sourceType . isHierarchyInconsistent ( ) ) problemReporter ( ) . hierarchyHasProblems ( sourceType ) ; } public boolean detectHierarchyCycle ( TypeBinding superType , TypeReference reference ) { if ( ! ( superType instanceof ReferenceBinding ) ) return false ; if ( reference == this . superTypeReference ) { if ( superType . isTypeVariable ( ) ) return false ; if ( superType . isParameterizedType ( ) ) superType = ( ( ParameterizedTypeBinding ) superType ) . genericType ( ) ; compilationUnitScope ( ) . recordSuperTypeReference ( superType ) ; return detectHierarchyCycle ( this . referenceContext . binding , ( ReferenceBinding ) superType , reference ) ; } if ( ( superType . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> && superType instanceof SourceTypeBinding ) ( ( SourceTypeBinding ) superType ) . scope . connectTypeHierarchyWithoutMembers ( ) ; return false ; } private boolean detectHierarchyCycle ( SourceTypeBinding sourceType , ReferenceBinding superType , TypeReference reference ) { if ( superType . isRawType ( ) ) superType = ( ( RawTypeBinding ) superType ) . genericType ( ) ; if ( sourceType == superType ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( superType . isMemberType ( ) ) { ReferenceBinding current = superType . enclosingType ( ) ; do { if ( current . isHierarchyBeingActivelyConnected ( ) && current == sourceType ) { problemReporter ( ) . hierarchyCircularity ( sourceType , current , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; current . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } while ( ( current = current . enclosingType ( ) ) != null ) ; } if ( superType . isBinaryBinding ( ) ) { boolean hasCycle = false ; ReferenceBinding parentType = superType . superclass ( ) ; if ( parentType != null ) { if ( sourceType == parentType ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( parentType . isParameterizedType ( ) ) parentType = ( ( ParameterizedTypeBinding ) parentType ) . genericType ( ) ; hasCycle |= detectHierarchyCycle ( sourceType , parentType , reference ) ; if ( ( parentType . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; parentType . tagBits |= TagBits . HierarchyHasProblems ; } } ReferenceBinding [ ] itsInterfaces = superType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { for ( int i = <NUM_LIT:0> , length = itsInterfaces . length ; i < length ; i ++ ) { ReferenceBinding anInterface = itsInterfaces [ i ] ; if ( sourceType == anInterface ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( anInterface . isParameterizedType ( ) ) anInterface = ( ( ParameterizedTypeBinding ) anInterface ) . genericType ( ) ; hasCycle |= detectHierarchyCycle ( sourceType , anInterface , reference ) ; if ( ( anInterface . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) { sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; } } } return hasCycle ; } if ( superType . isHierarchyBeingActivelyConnected ( ) ) { org . eclipse . jdt . internal . compiler . ast . TypeReference ref = ( ( SourceTypeBinding ) superType ) . scope . superTypeReference ; if ( ref != null && ref . resolvedType != null && ( ( ReferenceBinding ) ref . resolvedType ) . isHierarchyBeingActivelyConnected ( ) ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } if ( ref != null && ref . resolvedType == null ) { char [ ] referredName = ref . getLastToken ( ) ; for ( Iterator iter = environment ( ) . typesBeingConnected . iterator ( ) ; iter . hasNext ( ) ; ) { SourceTypeBinding type = ( SourceTypeBinding ) iter . next ( ) ; if ( CharOperation . equals ( referredName , type . sourceName ( ) ) ) { problemReporter ( ) . hierarchyCircularity ( sourceType , superType , reference ) ; sourceType . tagBits |= TagBits . HierarchyHasProblems ; superType . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } } } if ( ( superType . tagBits & TagBits . BeginHierarchyCheck ) == <NUM_LIT:0> ) ( ( SourceTypeBinding ) superType ) . scope . connectTypeHierarchyWithoutMembers ( ) ; if ( ( superType . tagBits & TagBits . HierarchyHasProblems ) != <NUM_LIT:0> ) sourceType . tagBits |= TagBits . HierarchyHasProblems ; return false ; } private ReferenceBinding findSupertype ( TypeReference typeReference ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = typeReference ; typeReference . aboutToResolve ( this ) ; unitScope . recordQualifiedReference ( typeReference . getTypeName ( ) ) ; this . superTypeReference = typeReference ; ReferenceBinding superType = ( ReferenceBinding ) typeReference . resolveSuperType ( this ) ; return superType ; } catch ( AbortCompilation e ) { SourceTypeBinding sourceType = this . referenceContext . binding ; if ( sourceType . superInterfaces == null ) sourceType . superInterfaces = Binding . NO_SUPERINTERFACES ; e . updateContext ( typeReference , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; this . superTypeReference = null ; } } public ProblemReporter problemReporter ( ) { MethodScope outerMethodScope ; if ( ( outerMethodScope = outerMostMethodScope ( ) ) == null ) { ProblemReporter problemReporter = referenceCompilationUnit ( ) . problemReporter ; problemReporter . referenceContext = this . referenceContext ; return problemReporter ; } return outerMethodScope . problemReporter ( ) ; } public TypeDeclaration referenceType ( ) { return this . referenceContext ; } public String toString ( ) { if ( this . referenceContext != null ) return "<STR_LIT>" + this . referenceContext . binding . toString ( ) ; return "<STR_LIT>" ; } public MethodBinding [ ] getAnyExtraMethods ( char [ ] selector ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class ProblemFieldBinding extends FieldBinding { private int problemId ; public FieldBinding closestMatch ; public ProblemFieldBinding ( ReferenceBinding declaringClass , char [ ] name , int problemId ) { this ( null , declaringClass , name , problemId ) ; } public ProblemFieldBinding ( FieldBinding closestMatch , ReferenceBinding declaringClass , char [ ] name , int problemId ) { this . closestMatch = closestMatch ; this . declaringClass = declaringClass ; this . name = name ; this . problemId = problemId ; } public final int problemId ( ) { return this . problemId ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public abstract class VariableBinding extends Binding { public int modifiers ; public TypeBinding type ; public char [ ] name ; protected Constant constant ; public int id ; public long tagBits ; public VariableBinding ( char [ ] name , TypeBinding type , int modifiers , Constant constant ) { this . name = name ; this . type = type ; this . modifiers = modifiers ; this . constant = constant ; if ( type != null ) { this . tagBits |= ( type . tagBits & TagBits . HasMissingType ) ; } } public Constant constant ( ) { return this . constant ; } public abstract AnnotationBinding [ ] getAnnotations ( ) ; public final boolean isBlankFinal ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccBlankFinal ) != <NUM_LIT:0> ; } public final boolean isFinal ( ) { return ( this . modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ; } public final boolean isEffectivelyFinal ( ) { return ( this . tagBits & TagBits . IsEffectivelyFinal ) != <NUM_LIT:0> ; } public char [ ] readableName ( ) { return this . name ; } public void setConstant ( Constant constant ) { this . constant = constant ; } public String toString ( ) { StringBuffer output = new StringBuffer ( <NUM_LIT:10> ) ; ASTNode . printModifiers ( this . modifiers , output ) ; if ( ( this . modifiers & ExtraCompilerModifiers . AccUnresolved ) != <NUM_LIT:0> ) { output . append ( "<STR_LIT>" ) ; } output . append ( this . type != null ? this . type . debugName ( ) : "<STR_LIT>" ) ; output . append ( "<STR_LIT:U+0020>" ) ; output . append ( ( this . name != null ) ? new String ( this . name ) : "<STR_LIT>" ) ; return output . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class ElementValuePair { char [ ] name ; public Object value ; public MethodBinding binding ; public static Object getValue ( Expression expression ) { if ( expression == null ) return null ; Constant constant = expression . constant ; if ( constant != null && constant != Constant . NotAConstant ) return constant ; if ( expression instanceof Annotation ) return ( ( Annotation ) expression ) . getCompilerAnnotation ( ) ; if ( expression instanceof ArrayInitializer ) { Expression [ ] exprs = ( ( ArrayInitializer ) expression ) . expressions ; int length = exprs == null ? <NUM_LIT:0> : exprs . length ; Object [ ] values = new Object [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) values [ i ] = getValue ( exprs [ i ] ) ; return values ; } if ( expression instanceof ClassLiteralAccess ) return ( ( ClassLiteralAccess ) expression ) . targetType ; if ( expression instanceof Reference ) { FieldBinding fieldBinding = null ; if ( expression instanceof FieldReference ) { fieldBinding = ( ( FieldReference ) expression ) . fieldBinding ( ) ; } else if ( expression instanceof NameReference ) { Binding binding = ( ( NameReference ) expression ) . binding ; if ( binding != null && binding . kind ( ) == Binding . FIELD ) fieldBinding = ( FieldBinding ) binding ; } if ( fieldBinding != null && ( fieldBinding . modifiers & ClassFileConstants . AccEnum ) > <NUM_LIT:0> ) return fieldBinding ; } return null ; } public ElementValuePair ( char [ ] name , Expression expression , MethodBinding binding ) { this ( name , ElementValuePair . getValue ( expression ) , binding ) ; } public ElementValuePair ( char [ ] name , Object value , MethodBinding binding ) { this . name = name ; this . value = value ; this . binding = binding ; } public char [ ] getName ( ) { return this . name ; } public MethodBinding getMethodBinding ( ) { return this . binding ; } public Object getValue ( ) { return this . value ; } void setMethodBinding ( MethodBinding binding ) { this . binding = binding ; } void setValue ( Object value ) { this . value = value ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( this . name ) . append ( "<STR_LIT:U+0020=U+0020>" ) ; buffer . append ( this . value ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Map ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFilePool ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ITypeRequestor ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfPackage ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; public class LookupEnvironment implements ProblemReasons , TypeConstants { private Map accessRestrictions ; ImportBinding [ ] defaultImports ; public PackageBinding defaultPackage ; HashtableOfPackage knownPackages ; private int lastCompletedUnitIndex = - <NUM_LIT:1> ; private int lastUnitIndex = - <NUM_LIT:1> ; public INameEnvironment nameEnvironment ; public CompilerOptions globalOptions ; public ProblemReporter problemReporter ; public ClassFilePool classFilePool ; private int stepCompleted ; public ITypeRequestor typeRequestor ; private ArrayBinding [ ] [ ] uniqueArrayBindings ; private SimpleLookupTable uniqueParameterizedTypeBindings ; private SimpleLookupTable uniqueRawTypeBindings ; private SimpleLookupTable uniqueWildcardBindings ; private SimpleLookupTable uniqueParameterizedGenericMethodBindings ; private SimpleLookupTable uniquePolymorphicMethodBindings ; private SimpleLookupTable uniqueGetClassMethodBinding ; public CompilationUnitDeclaration unitBeingCompleted = null ; public Object missingClassFileLocation = null ; private CompilationUnitDeclaration [ ] units = new CompilationUnitDeclaration [ <NUM_LIT:4> ] ; private MethodVerifier verifier ; public MethodBinding arrayClone ; private ArrayList missingTypes ; Set typesBeingConnected ; public boolean isProcessingAnnotations = false ; public boolean mayTolerateMissingType = false ; PackageBinding nullableAnnotationPackage ; PackageBinding nonnullAnnotationPackage ; PackageBinding nonnullByDefaultAnnotationPackage ; final static int BUILD_FIELDS_AND_METHODS = <NUM_LIT:4> ; final static int BUILD_TYPE_HIERARCHY = <NUM_LIT:1> ; final static int CHECK_AND_SET_IMPORTS = <NUM_LIT:2> ; final static int CONNECT_TYPE_HIERARCHY = <NUM_LIT:3> ; static final ProblemPackageBinding TheNotFoundPackage = new ProblemPackageBinding ( CharOperation . NO_CHAR , NotFound ) ; static final ProblemReferenceBinding TheNotFoundType = new ProblemReferenceBinding ( CharOperation . NO_CHAR_CHAR , null , NotFound ) ; public LookupEnvironment ( ITypeRequestor typeRequestor , CompilerOptions globalOptions , ProblemReporter problemReporter , INameEnvironment nameEnvironment ) { this . typeRequestor = typeRequestor ; this . globalOptions = globalOptions ; this . problemReporter = problemReporter ; this . defaultPackage = new PackageBinding ( this ) ; this . defaultImports = null ; this . nameEnvironment = nameEnvironment ; this . knownPackages = new HashtableOfPackage ( ) ; this . uniqueArrayBindings = new ArrayBinding [ <NUM_LIT:5> ] [ ] ; this . uniqueArrayBindings [ <NUM_LIT:0> ] = new ArrayBinding [ <NUM_LIT> ] ; this . uniqueParameterizedTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueRawTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueWildcardBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueParameterizedGenericMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniquePolymorphicMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . missingTypes = null ; this . accessRestrictions = new HashMap ( <NUM_LIT:3> ) ; this . classFilePool = ClassFilePool . newInstance ( ) ; this . typesBeingConnected = new HashSet ( ) ; } public ReferenceBinding askForType ( char [ ] [ ] compoundName ) { NameEnvironmentAnswer answer = this . nameEnvironment . findType ( compoundName ) ; if ( answer == null ) return null ; if ( answer . isBinaryType ( ) ) { this . typeRequestor . accept ( answer . getBinaryType ( ) , computePackageFrom ( compoundName , false ) , answer . getAccessRestriction ( ) ) ; } else if ( answer . isCompilationUnit ( ) ) { this . typeRequestor . accept ( answer . getCompilationUnit ( ) , answer . getAccessRestriction ( ) ) ; } else if ( answer . isSourceType ( ) ) { this . typeRequestor . accept ( answer . getSourceTypes ( ) , computePackageFrom ( compoundName , false ) , answer . getAccessRestriction ( ) ) ; } return getCachedType ( compoundName ) ; } ReferenceBinding askForType ( PackageBinding packageBinding , char [ ] name ) { if ( packageBinding == null ) { packageBinding = this . defaultPackage ; } NameEnvironmentAnswer answer = this . nameEnvironment . findType ( name , packageBinding . compoundName ) ; if ( answer == null ) return null ; if ( answer . isBinaryType ( ) ) { this . typeRequestor . accept ( answer . getBinaryType ( ) , packageBinding , answer . getAccessRestriction ( ) ) ; } else if ( answer . isCompilationUnit ( ) ) { try { this . typeRequestor . accept ( answer . getCompilationUnit ( ) , answer . getAccessRestriction ( ) ) ; } catch ( AbortCompilation abort ) { if ( CharOperation . equals ( name , TypeConstants . PACKAGE_INFO_NAME ) ) return null ; throw abort ; } } else if ( answer . isSourceType ( ) ) { this . typeRequestor . accept ( answer . getSourceTypes ( ) , packageBinding , answer . getAccessRestriction ( ) ) ; } return packageBinding . getType0 ( name ) ; } public void buildTypeBindings ( CompilationUnitDeclaration unit , AccessRestriction accessRestriction ) { CompilationUnitScope scope = unit . buildCompilationUnitScope ( this ) ; scope . buildTypeBindings ( accessRestriction ) ; int unitsLength = this . units . length ; if ( ++ this . lastUnitIndex >= unitsLength ) System . arraycopy ( this . units , <NUM_LIT:0> , this . units = new CompilationUnitDeclaration [ <NUM_LIT:2> * unitsLength ] , <NUM_LIT:0> , unitsLength ) ; this . units [ this . lastUnitIndex ] = unit ; } public BinaryTypeBinding cacheBinaryType ( IBinaryType binaryType , AccessRestriction accessRestriction ) { return cacheBinaryType ( binaryType , true , accessRestriction ) ; } public BinaryTypeBinding cacheBinaryType ( IBinaryType binaryType , boolean needFieldsAndMethods , AccessRestriction accessRestriction ) { char [ ] [ ] compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , binaryType . getName ( ) ) ; ReferenceBinding existingType = getCachedType ( compoundName ) ; if ( existingType == null || existingType instanceof UnresolvedReferenceBinding ) return createBinaryTypeFrom ( binaryType , computePackageFrom ( compoundName , false ) , needFieldsAndMethods , accessRestriction ) ; return null ; } public void completeTypeBindings ( ) { this . stepCompleted = BUILD_TYPE_HIERARCHY ; for ( int i = this . lastCompletedUnitIndex + <NUM_LIT:1> ; i <= this . lastUnitIndex ; i ++ ) { ( this . unitBeingCompleted = this . units [ i ] ) . scope . checkAndSetImports ( ) ; } this . stepCompleted = CHECK_AND_SET_IMPORTS ; for ( int i = this . lastCompletedUnitIndex + <NUM_LIT:1> ; i <= this . lastUnitIndex ; i ++ ) { ( this . unitBeingCompleted = this . units [ i ] ) . scope . connectTypeHierarchy ( ) ; ( this . unitBeingCompleted = this . units [ i ] ) . scope . augmentTypeHierarchy ( ) ; } this . stepCompleted = CONNECT_TYPE_HIERARCHY ; for ( int i = this . lastCompletedUnitIndex + <NUM_LIT:1> ; i <= this . lastUnitIndex ; i ++ ) { CompilationUnitScope unitScope = ( this . unitBeingCompleted = this . units [ i ] ) . scope ; unitScope . checkParameterizedTypes ( ) ; unitScope . buildFieldsAndMethods ( ) ; this . units [ i ] = null ; } this . stepCompleted = BUILD_FIELDS_AND_METHODS ; this . lastCompletedUnitIndex = this . lastUnitIndex ; this . unitBeingCompleted = null ; } public void completeTypeBindings ( CompilationUnitDeclaration parsedUnit ) { if ( this . stepCompleted == BUILD_FIELDS_AND_METHODS ) { completeTypeBindings ( ) ; } else { if ( parsedUnit . scope == null ) return ; if ( this . stepCompleted >= CHECK_AND_SET_IMPORTS ) ( this . unitBeingCompleted = parsedUnit ) . scope . checkAndSetImports ( ) ; if ( this . stepCompleted >= CONNECT_TYPE_HIERARCHY ) ( this . unitBeingCompleted = parsedUnit ) . scope . connectTypeHierarchy ( ) ; this . unitBeingCompleted = null ; } } public void completeTypeBindings ( CompilationUnitDeclaration parsedUnit , boolean buildFieldsAndMethods ) { if ( parsedUnit . scope == null ) return ; ( this . unitBeingCompleted = parsedUnit ) . scope . checkAndSetImports ( ) ; parsedUnit . scope . connectTypeHierarchy ( ) ; parsedUnit . scope . checkParameterizedTypes ( ) ; if ( buildFieldsAndMethods ) parsedUnit . scope . buildFieldsAndMethods ( ) ; this . unitBeingCompleted = null ; } public void completeTypeBindings ( CompilationUnitDeclaration [ ] parsedUnits , boolean [ ] buildFieldsAndMethods , int unitCount ) { for ( int i = <NUM_LIT:0> ; i < unitCount ; i ++ ) { CompilationUnitDeclaration parsedUnit = parsedUnits [ i ] ; if ( parsedUnit . scope != null ) ( this . unitBeingCompleted = parsedUnit ) . scope . checkAndSetImports ( ) ; } for ( int i = <NUM_LIT:0> ; i < unitCount ; i ++ ) { CompilationUnitDeclaration parsedUnit = parsedUnits [ i ] ; if ( parsedUnit . scope != null ) ( this . unitBeingCompleted = parsedUnit ) . scope . connectTypeHierarchy ( ) ; } for ( int i = <NUM_LIT:0> ; i < unitCount ; i ++ ) { CompilationUnitDeclaration parsedUnit = parsedUnits [ i ] ; if ( parsedUnit . scope != null ) { ( this . unitBeingCompleted = parsedUnit ) . scope . checkParameterizedTypes ( ) ; if ( buildFieldsAndMethods [ i ] ) parsedUnit . scope . buildFieldsAndMethods ( ) ; } } this . unitBeingCompleted = null ; } public MethodBinding computeArrayClone ( MethodBinding objectClone ) { if ( this . arrayClone == null ) { this . arrayClone = new MethodBinding ( ( objectClone . modifiers & ~ ClassFileConstants . AccProtected ) | ClassFileConstants . AccPublic , TypeConstants . CLONE , objectClone . returnType , Binding . NO_PARAMETERS , Binding . NO_EXCEPTIONS , ( ReferenceBinding ) objectClone . returnType ) ; } return this . arrayClone ; } public TypeBinding computeBoxingType ( TypeBinding type ) { TypeBinding boxedType ; switch ( type . id ) { case TypeIds . T_JavaLangBoolean : return TypeBinding . BOOLEAN ; case TypeIds . T_JavaLangByte : return TypeBinding . BYTE ; case TypeIds . T_JavaLangCharacter : return TypeBinding . CHAR ; case TypeIds . T_JavaLangShort : return TypeBinding . SHORT ; case TypeIds . T_JavaLangDouble : return TypeBinding . DOUBLE ; case TypeIds . T_JavaLangFloat : return TypeBinding . FLOAT ; case TypeIds . T_JavaLangInteger : return TypeBinding . INT ; case TypeIds . T_JavaLangLong : return TypeBinding . LONG ; case TypeIds . T_int : boxedType = getType ( JAVA_LANG_INTEGER ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_INTEGER , null , NotFound ) ; case TypeIds . T_byte : boxedType = getType ( JAVA_LANG_BYTE ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_BYTE , null , NotFound ) ; case TypeIds . T_short : boxedType = getType ( JAVA_LANG_SHORT ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_SHORT , null , NotFound ) ; case TypeIds . T_char : boxedType = getType ( JAVA_LANG_CHARACTER ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_CHARACTER , null , NotFound ) ; case TypeIds . T_long : boxedType = getType ( JAVA_LANG_LONG ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_LONG , null , NotFound ) ; case TypeIds . T_float : boxedType = getType ( JAVA_LANG_FLOAT ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_FLOAT , null , NotFound ) ; case TypeIds . T_double : boxedType = getType ( JAVA_LANG_DOUBLE ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_DOUBLE , null , NotFound ) ; case TypeIds . T_boolean : boxedType = getType ( JAVA_LANG_BOOLEAN ) ; if ( boxedType != null ) return boxedType ; return new ProblemReferenceBinding ( JAVA_LANG_BOOLEAN , null , NotFound ) ; } switch ( type . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . TYPE_PARAMETER : switch ( type . erasure ( ) . id ) { case TypeIds . T_JavaLangBoolean : return TypeBinding . BOOLEAN ; case TypeIds . T_JavaLangByte : return TypeBinding . BYTE ; case TypeIds . T_JavaLangCharacter : return TypeBinding . CHAR ; case TypeIds . T_JavaLangShort : return TypeBinding . SHORT ; case TypeIds . T_JavaLangDouble : return TypeBinding . DOUBLE ; case TypeIds . T_JavaLangFloat : return TypeBinding . FLOAT ; case TypeIds . T_JavaLangInteger : return TypeBinding . INT ; case TypeIds . T_JavaLangLong : return TypeBinding . LONG ; } } return type ; } private PackageBinding computePackageFrom ( char [ ] [ ] constantPoolName , boolean isMissing ) { if ( constantPoolName . length == <NUM_LIT:1> ) return this . defaultPackage ; PackageBinding packageBinding = getPackage0 ( constantPoolName [ <NUM_LIT:0> ] ) ; if ( packageBinding == null || packageBinding == TheNotFoundPackage ) { packageBinding = new PackageBinding ( constantPoolName [ <NUM_LIT:0> ] , this ) ; if ( isMissing ) packageBinding . tagBits |= TagBits . HasMissingType ; this . knownPackages . put ( constantPoolName [ <NUM_LIT:0> ] , packageBinding ) ; } for ( int i = <NUM_LIT:1> , length = constantPoolName . length - <NUM_LIT:1> ; i < length ; i ++ ) { PackageBinding parent = packageBinding ; if ( ( packageBinding = parent . getPackage0 ( constantPoolName [ i ] ) ) == null || packageBinding == TheNotFoundPackage ) { packageBinding = new PackageBinding ( CharOperation . subarray ( constantPoolName , <NUM_LIT:0> , i + <NUM_LIT:1> ) , parent , this ) ; if ( isMissing ) { packageBinding . tagBits |= TagBits . HasMissingType ; } parent . addPackage ( packageBinding ) ; } } return packageBinding ; } public ReferenceBinding convertToParameterizedType ( ReferenceBinding originalType ) { if ( originalType != null ) { boolean isGeneric = originalType . isGenericType ( ) ; ReferenceBinding originalEnclosingType = originalType . enclosingType ( ) ; ReferenceBinding convertedEnclosingType = originalEnclosingType ; boolean needToConvert = isGeneric ; if ( originalEnclosingType != null ) { convertedEnclosingType = originalType . isStatic ( ) ? ( ReferenceBinding ) convertToRawType ( originalEnclosingType , false ) : convertToParameterizedType ( originalEnclosingType ) ; needToConvert |= originalEnclosingType != convertedEnclosingType ; } if ( needToConvert ) { return createParameterizedType ( originalType , isGeneric ? originalType . typeVariables ( ) : null , convertedEnclosingType ) ; } } return originalType ; } public TypeBinding convertToRawType ( TypeBinding type , boolean forceRawEnclosingType ) { int dimension ; TypeBinding originalType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . RAW_TYPE : return type ; case Binding . ARRAY_TYPE : dimension = type . dimensions ( ) ; originalType = type . leafComponentType ( ) ; break ; default : if ( type . id == TypeIds . T_JavaLangObject ) return type ; dimension = <NUM_LIT:0> ; originalType = type ; } boolean needToConvert ; switch ( originalType . kind ( ) ) { case Binding . BASE_TYPE : return type ; case Binding . GENERIC_TYPE : needToConvert = true ; break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; needToConvert = paramType . genericType ( ) . isGenericType ( ) ; break ; default : needToConvert = false ; break ; } ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; TypeBinding convertedType ; if ( originalEnclosing == null ) { convertedType = needToConvert ? createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , null ) : originalType ; } else { ReferenceBinding convertedEnclosing ; if ( originalEnclosing . kind ( ) == Binding . RAW_TYPE ) { needToConvert |= ! ( ( ReferenceBinding ) originalType ) . isStatic ( ) ; convertedEnclosing = originalEnclosing ; } else if ( forceRawEnclosingType && ! needToConvert ) { convertedEnclosing = ( ReferenceBinding ) convertToRawType ( originalEnclosing , forceRawEnclosingType ) ; needToConvert = originalEnclosing != convertedEnclosing ; } else if ( needToConvert || ( ( ReferenceBinding ) originalType ) . isStatic ( ) ) { convertedEnclosing = ( ReferenceBinding ) convertToRawType ( originalEnclosing , false ) ; } else { convertedEnclosing = convertToParameterizedType ( originalEnclosing ) ; } if ( needToConvert ) { convertedType = createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , convertedEnclosing ) ; } else if ( originalEnclosing != convertedEnclosing ) { convertedType = createParameterizedType ( ( ReferenceBinding ) originalType . erasure ( ) , null , convertedEnclosing ) ; } else { convertedType = originalType ; } } if ( originalType != convertedType ) { return dimension > <NUM_LIT:0> ? ( TypeBinding ) createArrayType ( convertedType , dimension ) : convertedType ; } return type ; } public ReferenceBinding [ ] convertToRawTypes ( ReferenceBinding [ ] originalTypes , boolean forceErasure , boolean forceRawEnclosingType ) { if ( originalTypes == null ) return null ; ReferenceBinding [ ] convertedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { ReferenceBinding originalType = originalTypes [ i ] ; ReferenceBinding convertedType = ( ReferenceBinding ) convertToRawType ( forceErasure ? originalType . erasure ( ) : originalType , forceRawEnclosingType ) ; if ( convertedType != originalType ) { if ( convertedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , convertedTypes = new ReferenceBinding [ length ] , <NUM_LIT:0> , i ) ; } convertedTypes [ i ] = convertedType ; } else if ( convertedTypes != originalTypes ) { convertedTypes [ i ] = originalType ; } } return convertedTypes ; } public TypeBinding convertUnresolvedBinaryToRawType ( TypeBinding type ) { int dimension ; TypeBinding originalType ; switch ( type . kind ( ) ) { case Binding . BASE_TYPE : case Binding . TYPE_PARAMETER : case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . RAW_TYPE : return type ; case Binding . ARRAY_TYPE : dimension = type . dimensions ( ) ; originalType = type . leafComponentType ( ) ; break ; default : if ( type . id == TypeIds . T_JavaLangObject ) return type ; dimension = <NUM_LIT:0> ; originalType = type ; } boolean needToConvert ; switch ( originalType . kind ( ) ) { case Binding . BASE_TYPE : return type ; case Binding . GENERIC_TYPE : needToConvert = true ; break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; needToConvert = paramType . genericType ( ) . isGenericType ( ) ; break ; default : needToConvert = false ; break ; } ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; TypeBinding convertedType ; if ( originalEnclosing == null ) { convertedType = needToConvert ? createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , null ) : originalType ; } else { ReferenceBinding convertedEnclosing = ( ReferenceBinding ) convertUnresolvedBinaryToRawType ( originalEnclosing ) ; if ( convertedEnclosing != originalEnclosing ) { needToConvert |= ! ( ( ReferenceBinding ) originalType ) . isStatic ( ) ; } if ( needToConvert ) { convertedType = createRawType ( ( ReferenceBinding ) originalType . erasure ( ) , convertedEnclosing ) ; } else if ( originalEnclosing != convertedEnclosing ) { convertedType = createParameterizedType ( ( ReferenceBinding ) originalType . erasure ( ) , null , convertedEnclosing ) ; } else { convertedType = originalType ; } } if ( originalType != convertedType ) { return dimension > <NUM_LIT:0> ? ( TypeBinding ) createArrayType ( convertedType , dimension ) : convertedType ; } return type ; } public AnnotationBinding createAnnotation ( ReferenceBinding annotationType , ElementValuePair [ ] pairs ) { if ( pairs . length != <NUM_LIT:0> ) { AnnotationBinding . setMethodBindings ( annotationType , pairs ) ; } return new AnnotationBinding ( annotationType , pairs ) ; } public ArrayBinding createArrayType ( TypeBinding leafComponentType , int dimensionCount ) { if ( leafComponentType instanceof LocalTypeBinding ) return ( ( LocalTypeBinding ) leafComponentType ) . createArrayType ( dimensionCount , this ) ; int dimIndex = dimensionCount - <NUM_LIT:1> ; int length = this . uniqueArrayBindings . length ; ArrayBinding [ ] arrayBindings ; if ( dimIndex < length ) { if ( ( arrayBindings = this . uniqueArrayBindings [ dimIndex ] ) == null ) this . uniqueArrayBindings [ dimIndex ] = arrayBindings = new ArrayBinding [ <NUM_LIT:10> ] ; } else { System . arraycopy ( this . uniqueArrayBindings , <NUM_LIT:0> , this . uniqueArrayBindings = new ArrayBinding [ dimensionCount ] [ ] , <NUM_LIT:0> , length ) ; this . uniqueArrayBindings [ dimIndex ] = arrayBindings = new ArrayBinding [ <NUM_LIT:10> ] ; } int index = - <NUM_LIT:1> ; length = arrayBindings . length ; while ( ++ index < length ) { ArrayBinding currentBinding = arrayBindings [ index ] ; if ( currentBinding == null ) return arrayBindings [ index ] = new ArrayBinding ( leafComponentType , dimensionCount , this ) ; if ( currentBinding . leafComponentType == leafComponentType ) return currentBinding ; } System . arraycopy ( arrayBindings , <NUM_LIT:0> , ( arrayBindings = new ArrayBinding [ length * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; this . uniqueArrayBindings [ dimIndex ] = arrayBindings ; return arrayBindings [ length ] = new ArrayBinding ( leafComponentType , dimensionCount , this ) ; } public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { return createBinaryTypeFrom ( binaryType , packageBinding , true , accessRestriction ) ; } public BinaryTypeBinding createBinaryTypeFrom ( IBinaryType binaryType , PackageBinding packageBinding , boolean needFieldsAndMethods , AccessRestriction accessRestriction ) { BinaryTypeBinding binaryBinding = new BinaryTypeBinding ( packageBinding , binaryType , this ) ; ReferenceBinding cachedType = packageBinding . getType0 ( binaryBinding . compoundName [ binaryBinding . compoundName . length - <NUM_LIT:1> ] ) ; if ( cachedType != null ) { if ( cachedType instanceof UnresolvedReferenceBinding ) { ( ( UnresolvedReferenceBinding ) cachedType ) . setResolvedType ( binaryBinding , this ) ; } else { if ( cachedType . isBinaryBinding ( ) ) return ( BinaryTypeBinding ) cachedType ; return null ; } } packageBinding . addType ( binaryBinding ) ; setAccessRestriction ( binaryBinding , accessRestriction ) ; if ( this . globalOptions . isAnnotationBasedNullAnalysisEnabled ) binaryBinding . scanTypeForNullDefaultAnnotation ( binaryType , packageBinding , binaryBinding ) ; binaryBinding . cachePartsFrom ( binaryType , needFieldsAndMethods ) ; return binaryBinding ; } public MissingTypeBinding createMissingType ( PackageBinding packageBinding , char [ ] [ ] compoundName ) { if ( packageBinding == null ) { packageBinding = computePackageFrom ( compoundName , true ) ; if ( packageBinding == TheNotFoundPackage ) packageBinding = this . defaultPackage ; } MissingTypeBinding missingType = new MissingTypeBinding ( packageBinding , compoundName , this ) ; if ( missingType . id != TypeIds . T_JavaLangObject ) { ReferenceBinding objectType = getType ( TypeConstants . JAVA_LANG_OBJECT ) ; if ( objectType == null ) { objectType = createMissingType ( null , TypeConstants . JAVA_LANG_OBJECT ) ; } missingType . setMissingSuperclass ( objectType ) ; } packageBinding . addType ( missingType ) ; if ( this . missingTypes == null ) this . missingTypes = new ArrayList ( <NUM_LIT:3> ) ; this . missingTypes . add ( missingType ) ; return missingType ; } public PackageBinding createPackage ( char [ ] [ ] compoundName ) { PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding == null || packageBinding == TheNotFoundPackage ) { packageBinding = new PackageBinding ( compoundName [ <NUM_LIT:0> ] , this ) ; this . knownPackages . put ( compoundName [ <NUM_LIT:0> ] , packageBinding ) ; } for ( int i = <NUM_LIT:1> , length = compoundName . length ; i < length ; i ++ ) { ReferenceBinding type = packageBinding . getType0 ( compoundName [ i ] ) ; if ( type != null && type != TheNotFoundType && ! ( type instanceof UnresolvedReferenceBinding ) ) return null ; PackageBinding parent = packageBinding ; if ( ( packageBinding = parent . getPackage0 ( compoundName [ i ] ) ) == null || packageBinding == TheNotFoundPackage ) { if ( this . nameEnvironment . findType ( compoundName [ i ] , parent . compoundName ) != null ) return null ; packageBinding = new PackageBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , i + <NUM_LIT:1> ) , parent , this ) ; parent . addPackage ( packageBinding ) ; } } return packageBinding ; } public ParameterizedGenericMethodBinding createParameterizedGenericMethod ( MethodBinding genericMethod , RawTypeBinding rawType ) { ParameterizedGenericMethodBinding [ ] cachedInfo = ( ParameterizedGenericMethodBinding [ ] ) this . uniqueParameterizedGenericMethodBindings . get ( genericMethod ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { ParameterizedGenericMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) break nextCachedMethod ; if ( ! cachedMethod . isRaw ) continue nextCachedMethod ; if ( cachedMethod . declaringClass != ( rawType == null ? genericMethod . declaringClass : rawType ) ) continue nextCachedMethod ; return cachedMethod ; } needToGrow = true ; } else { cachedInfo = new ParameterizedGenericMethodBinding [ <NUM_LIT:5> ] ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new ParameterizedGenericMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } ParameterizedGenericMethodBinding parameterizedGenericMethod = new ParameterizedGenericMethodBinding ( genericMethod , rawType , this ) ; cachedInfo [ index ] = parameterizedGenericMethod ; return parameterizedGenericMethod ; } public ParameterizedGenericMethodBinding createParameterizedGenericMethod ( MethodBinding genericMethod , TypeBinding [ ] typeArguments ) { ParameterizedGenericMethodBinding [ ] cachedInfo = ( ParameterizedGenericMethodBinding [ ] ) this . uniqueParameterizedGenericMethodBindings . get ( genericMethod ) ; int argLength = typeArguments == null ? <NUM_LIT:0> : typeArguments . length ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { ParameterizedGenericMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) break nextCachedMethod ; if ( cachedMethod . isRaw ) continue nextCachedMethod ; TypeBinding [ ] cachedArguments = cachedMethod . typeArguments ; int cachedArgLength = cachedArguments == null ? <NUM_LIT:0> : cachedArguments . length ; if ( argLength != cachedArgLength ) continue nextCachedMethod ; for ( int j = <NUM_LIT:0> ; j < cachedArgLength ; j ++ ) { if ( typeArguments [ j ] != cachedArguments [ j ] ) continue nextCachedMethod ; } return cachedMethod ; } needToGrow = true ; } else { cachedInfo = new ParameterizedGenericMethodBinding [ <NUM_LIT:5> ] ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new ParameterizedGenericMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueParameterizedGenericMethodBindings . put ( genericMethod , cachedInfo ) ; } ParameterizedGenericMethodBinding parameterizedGenericMethod = new ParameterizedGenericMethodBinding ( genericMethod , typeArguments , this ) ; cachedInfo [ index ] = parameterizedGenericMethod ; return parameterizedGenericMethod ; } public PolymorphicMethodBinding createPolymorphicMethod ( MethodBinding originalPolymorphicMethod , TypeBinding [ ] parameters ) { String key = new String ( originalPolymorphicMethod . selector ) ; PolymorphicMethodBinding [ ] cachedInfo = ( PolymorphicMethodBinding [ ] ) this . uniquePolymorphicMethodBindings . get ( key ) ; int parametersLength = parameters == null ? <NUM_LIT:0> : parameters . length ; TypeBinding [ ] parametersTypeBinding = new TypeBinding [ parametersLength ] ; for ( int i = <NUM_LIT:0> ; i < parametersLength ; i ++ ) { TypeBinding parameterTypeBinding = parameters [ i ] ; if ( parameterTypeBinding . id == TypeIds . T_null ) { parametersTypeBinding [ i ] = getType ( JAVA_LANG_VOID ) ; } else { parametersTypeBinding [ i ] = parameterTypeBinding . erasure ( ) ; } } boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { PolymorphicMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) { break nextCachedMethod ; } if ( cachedMethod . matches ( parametersTypeBinding , originalPolymorphicMethod . returnType ) ) { return cachedMethod ; } } needToGrow = true ; } else { cachedInfo = new PolymorphicMethodBinding [ <NUM_LIT:5> ] ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new PolymorphicMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } PolymorphicMethodBinding polymorphicMethod = new PolymorphicMethodBinding ( originalPolymorphicMethod , parametersTypeBinding ) ; cachedInfo [ index ] = polymorphicMethod ; return polymorphicMethod ; } public MethodBinding updatePolymorphicMethodReturnType ( PolymorphicMethodBinding binding , TypeBinding typeBinding ) { String key = new String ( binding . selector ) ; PolymorphicMethodBinding [ ] cachedInfo = ( PolymorphicMethodBinding [ ] ) this . uniquePolymorphicMethodBindings . get ( key ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; TypeBinding [ ] parameters = binding . parameters ; if ( cachedInfo != null ) { nextCachedMethod : for ( int max = cachedInfo . length ; index < max ; index ++ ) { PolymorphicMethodBinding cachedMethod = cachedInfo [ index ] ; if ( cachedMethod == null ) { break nextCachedMethod ; } if ( cachedMethod . matches ( parameters , typeBinding ) ) { return cachedMethod ; } } needToGrow = true ; } else { cachedInfo = new PolymorphicMethodBinding [ <NUM_LIT:5> ] ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new PolymorphicMethodBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniquePolymorphicMethodBindings . put ( key , cachedInfo ) ; } PolymorphicMethodBinding polymorphicMethod = new PolymorphicMethodBinding ( binding . original ( ) , typeBinding , parameters ) ; cachedInfo [ index ] = polymorphicMethod ; return polymorphicMethod ; } public ParameterizedMethodBinding createGetClassMethod ( TypeBinding receiverType , MethodBinding originalMethod , Scope scope ) { ParameterizedMethodBinding retVal = null ; if ( this . uniqueGetClassMethodBinding == null ) { this . uniqueGetClassMethodBinding = new SimpleLookupTable ( <NUM_LIT:3> ) ; } else { retVal = ( ParameterizedMethodBinding ) this . uniqueGetClassMethodBinding . get ( receiverType ) ; } if ( retVal == null ) { retVal = ParameterizedMethodBinding . instantiateGetClass ( receiverType , originalMethod , scope ) ; this . uniqueGetClassMethodBinding . put ( receiverType , retVal ) ; } return retVal ; } public ParameterizedTypeBinding createParameterizedType ( ReferenceBinding genericType , TypeBinding [ ] typeArguments , ReferenceBinding enclosingType ) { ParameterizedTypeBinding [ ] cachedInfo = ( ParameterizedTypeBinding [ ] ) this . uniqueParameterizedTypeBindings . get ( genericType ) ; int argLength = typeArguments == null ? <NUM_LIT:0> : typeArguments . length ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedType : for ( int max = cachedInfo . length ; index < max ; index ++ ) { ParameterizedTypeBinding cachedType = cachedInfo [ index ] ; if ( cachedType == null ) break nextCachedType ; if ( cachedType . actualType ( ) != genericType ) continue nextCachedType ; if ( cachedType . enclosingType ( ) != enclosingType ) continue nextCachedType ; TypeBinding [ ] cachedArguments = cachedType . arguments ; int cachedArgLength = cachedArguments == null ? <NUM_LIT:0> : cachedArguments . length ; if ( argLength != cachedArgLength ) continue nextCachedType ; for ( int j = <NUM_LIT:0> ; j < cachedArgLength ; j ++ ) { if ( typeArguments [ j ] != cachedArguments [ j ] ) continue nextCachedType ; } return cachedType ; } needToGrow = true ; } else { cachedInfo = new ParameterizedTypeBinding [ <NUM_LIT:5> ] ; this . uniqueParameterizedTypeBindings . put ( genericType , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new ParameterizedTypeBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueParameterizedTypeBindings . put ( genericType , cachedInfo ) ; } ParameterizedTypeBinding parameterizedType = new ParameterizedTypeBinding ( genericType , typeArguments , enclosingType , this ) ; cachedInfo [ index ] = parameterizedType ; return parameterizedType ; } public RawTypeBinding createRawType ( ReferenceBinding genericType , ReferenceBinding enclosingType ) { RawTypeBinding [ ] cachedInfo = ( RawTypeBinding [ ] ) this . uniqueRawTypeBindings . get ( genericType ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedType : for ( int max = cachedInfo . length ; index < max ; index ++ ) { RawTypeBinding cachedType = cachedInfo [ index ] ; if ( cachedType == null ) break nextCachedType ; if ( cachedType . actualType ( ) != genericType ) continue nextCachedType ; if ( cachedType . enclosingType ( ) != enclosingType ) continue nextCachedType ; return cachedType ; } needToGrow = true ; } else { cachedInfo = new RawTypeBinding [ <NUM_LIT:1> ] ; this . uniqueRawTypeBindings . put ( genericType , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new RawTypeBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueRawTypeBindings . put ( genericType , cachedInfo ) ; } RawTypeBinding rawType = new RawTypeBinding ( genericType , enclosingType , this ) ; cachedInfo [ index ] = rawType ; return rawType ; } public WildcardBinding createWildcard ( ReferenceBinding genericType , int rank , TypeBinding bound , TypeBinding [ ] otherBounds , int boundKind ) { if ( genericType == null ) genericType = ReferenceBinding . LUB_GENERIC ; WildcardBinding [ ] cachedInfo = ( WildcardBinding [ ] ) this . uniqueWildcardBindings . get ( genericType ) ; boolean needToGrow = false ; int index = <NUM_LIT:0> ; if ( cachedInfo != null ) { nextCachedType : for ( int max = cachedInfo . length ; index < max ; index ++ ) { WildcardBinding cachedType = cachedInfo [ index ] ; if ( cachedType == null ) break nextCachedType ; if ( cachedType . genericType != genericType ) continue nextCachedType ; if ( cachedType . rank != rank ) continue nextCachedType ; if ( cachedType . boundKind != boundKind ) continue nextCachedType ; if ( cachedType . bound != bound ) continue nextCachedType ; if ( cachedType . otherBounds != otherBounds ) { int cachedLength = cachedType . otherBounds == null ? <NUM_LIT:0> : cachedType . otherBounds . length ; int length = otherBounds == null ? <NUM_LIT:0> : otherBounds . length ; if ( cachedLength != length ) continue nextCachedType ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( cachedType . otherBounds [ j ] != otherBounds [ j ] ) continue nextCachedType ; } } return cachedType ; } needToGrow = true ; } else { cachedInfo = new WildcardBinding [ <NUM_LIT:10> ] ; this . uniqueWildcardBindings . put ( genericType , cachedInfo ) ; } int length = cachedInfo . length ; if ( needToGrow && index == length ) { System . arraycopy ( cachedInfo , <NUM_LIT:0> , cachedInfo = new WildcardBinding [ length * <NUM_LIT:2> ] , <NUM_LIT:0> , length ) ; this . uniqueWildcardBindings . put ( genericType , cachedInfo ) ; } WildcardBinding wildcard = new WildcardBinding ( genericType , rank , bound , otherBounds , boundKind , this ) ; cachedInfo [ index ] = wildcard ; return wildcard ; } public AccessRestriction getAccessRestriction ( TypeBinding type ) { return ( AccessRestriction ) this . accessRestrictions . get ( type ) ; } public ReferenceBinding getCachedType ( char [ ] [ ] compoundName ) { if ( compoundName . length == <NUM_LIT:1> ) { return this . defaultPackage . getType0 ( compoundName [ <NUM_LIT:0> ] ) ; } PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding == null || packageBinding == TheNotFoundPackage ) return null ; for ( int i = <NUM_LIT:1> , packageLength = compoundName . length - <NUM_LIT:1> ; i < packageLength ; i ++ ) if ( ( packageBinding = packageBinding . getPackage0 ( compoundName [ i ] ) ) == null || packageBinding == TheNotFoundPackage ) return null ; return packageBinding . getType0 ( compoundName [ compoundName . length - <NUM_LIT:1> ] ) ; } public char [ ] [ ] getNullableAnnotationName ( ) { return this . globalOptions . nullableAnnotationName ; } public char [ ] [ ] getNonNullAnnotationName ( ) { return this . globalOptions . nonNullAnnotationName ; } public char [ ] [ ] getNonNullByDefaultAnnotationName ( ) { return this . globalOptions . nonNullByDefaultAnnotationName ; } PackageBinding getPackage0 ( char [ ] name ) { return this . knownPackages . get ( name ) ; } public ReferenceBinding getResolvedType ( char [ ] [ ] compoundName , Scope scope ) { ReferenceBinding type = getType ( compoundName ) ; if ( type != null ) return type ; this . problemReporter . isClassPathCorrect ( compoundName , scope == null ? this . unitBeingCompleted : scope . referenceCompilationUnit ( ) , this . missingClassFileLocation ) ; return createMissingType ( null , compoundName ) ; } PackageBinding getTopLevelPackage ( char [ ] name ) { PackageBinding packageBinding = getPackage0 ( name ) ; if ( packageBinding != null ) { if ( packageBinding == TheNotFoundPackage ) return null ; return packageBinding ; } if ( this . nameEnvironment . isPackage ( null , name ) ) { this . knownPackages . put ( name , packageBinding = new PackageBinding ( name , this ) ) ; return packageBinding ; } this . knownPackages . put ( name , TheNotFoundPackage ) ; return null ; } public ReferenceBinding getType ( char [ ] [ ] compoundName ) { ReferenceBinding referenceBinding ; if ( compoundName . length == <NUM_LIT:1> ) { if ( ( referenceBinding = this . defaultPackage . getType0 ( compoundName [ <NUM_LIT:0> ] ) ) == null ) { PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding != null && packageBinding != TheNotFoundPackage ) return null ; referenceBinding = askForType ( this . defaultPackage , compoundName [ <NUM_LIT:0> ] ) ; } } else { PackageBinding packageBinding = getPackage0 ( compoundName [ <NUM_LIT:0> ] ) ; if ( packageBinding == TheNotFoundPackage ) return null ; if ( packageBinding != null ) { for ( int i = <NUM_LIT:1> , packageLength = compoundName . length - <NUM_LIT:1> ; i < packageLength ; i ++ ) { if ( ( packageBinding = packageBinding . getPackage0 ( compoundName [ i ] ) ) == null ) break ; if ( packageBinding == TheNotFoundPackage ) return null ; } } if ( packageBinding == null ) referenceBinding = askForType ( compoundName ) ; else if ( ( referenceBinding = packageBinding . getType0 ( compoundName [ compoundName . length - <NUM_LIT:1> ] ) ) == null ) referenceBinding = askForType ( packageBinding , compoundName [ compoundName . length - <NUM_LIT:1> ] ) ; } if ( referenceBinding == null || referenceBinding == TheNotFoundType ) return null ; referenceBinding = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( referenceBinding , this , false ) ; if ( referenceBinding . isNestedType ( ) ) return new ProblemReferenceBinding ( compoundName , referenceBinding , InternalNameProvided ) ; return referenceBinding ; } private TypeBinding [ ] getTypeArgumentsFromSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , ReferenceBinding genericType , char [ ] [ ] [ ] missingTypeNames ) { java . util . ArrayList args = new java . util . ArrayList ( <NUM_LIT:2> ) ; int rank = <NUM_LIT:0> ; do { args . add ( getTypeFromVariantTypeSignature ( wrapper , staticVariables , enclosingType , genericType , rank ++ , missingTypeNames ) ) ; } while ( wrapper . signature [ wrapper . start ] != '<CHAR_LIT:>>' ) ; wrapper . start ++ ; TypeBinding [ ] typeArguments = new TypeBinding [ args . size ( ) ] ; args . toArray ( typeArguments ) ; return typeArguments ; } private ReferenceBinding getTypeFromCompoundName ( char [ ] [ ] compoundName , boolean isParameterized , boolean wasMissingType ) { ReferenceBinding binding = getCachedType ( compoundName ) ; if ( binding == null ) { PackageBinding packageBinding = computePackageFrom ( compoundName , false ) ; binding = new UnresolvedReferenceBinding ( compoundName , packageBinding ) ; if ( wasMissingType ) { binding . tagBits |= TagBits . HasMissingType ; } packageBinding . addType ( binding ) ; } else if ( binding == TheNotFoundType ) { if ( ! wasMissingType ) { this . problemReporter . isClassPathCorrect ( compoundName , this . unitBeingCompleted , this . missingClassFileLocation ) ; } binding = createMissingType ( null , compoundName ) ; } else if ( ! isParameterized ) { binding = ( ReferenceBinding ) convertUnresolvedBinaryToRawType ( binding ) ; } return binding ; } ReferenceBinding getTypeFromConstantPoolName ( char [ ] signature , int start , int end , boolean isParameterized , char [ ] [ ] [ ] missingTypeNames ) { if ( end == - <NUM_LIT:1> ) end = signature . length ; char [ ] [ ] compoundName = CharOperation . splitOn ( '<CHAR_LIT:/>' , signature , start , end ) ; boolean wasMissingType = false ; if ( missingTypeNames != null ) { for ( int i = <NUM_LIT:0> , max = missingTypeNames . length ; i < max ; i ++ ) { if ( CharOperation . equals ( compoundName , missingTypeNames [ i ] ) ) { wasMissingType = true ; break ; } } } return getTypeFromCompoundName ( compoundName , isParameterized , wasMissingType ) ; } TypeBinding getTypeFromSignature ( char [ ] signature , int start , int end , boolean isParameterized , TypeBinding enclosingType , char [ ] [ ] [ ] missingTypeNames ) { int dimension = <NUM_LIT:0> ; while ( signature [ start ] == '<CHAR_LIT:[>' ) { start ++ ; dimension ++ ; } if ( end == - <NUM_LIT:1> ) end = signature . length - <NUM_LIT:1> ; TypeBinding binding = null ; if ( start == end ) { switch ( signature [ start ] ) { case '<CHAR_LIT>' : binding = TypeBinding . INT ; break ; case '<CHAR_LIT:Z>' : binding = TypeBinding . BOOLEAN ; break ; case '<CHAR_LIT>' : binding = TypeBinding . VOID ; break ; case '<CHAR_LIT>' : binding = TypeBinding . CHAR ; break ; case '<CHAR_LIT>' : binding = TypeBinding . DOUBLE ; break ; case '<CHAR_LIT>' : binding = TypeBinding . BYTE ; break ; case '<CHAR_LIT>' : binding = TypeBinding . FLOAT ; break ; case '<CHAR_LIT>' : binding = TypeBinding . LONG ; break ; case '<CHAR_LIT>' : binding = TypeBinding . SHORT ; break ; default : this . problemReporter . corruptedSignature ( enclosingType , signature , start ) ; } } else { binding = getTypeFromConstantPoolName ( signature , start + <NUM_LIT:1> , end , isParameterized , missingTypeNames ) ; } if ( dimension == <NUM_LIT:0> ) return binding ; return createArrayType ( binding , dimension ) ; } public TypeBinding getTypeFromTypeSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , char [ ] [ ] [ ] missingTypeNames ) { int dimension = <NUM_LIT:0> ; while ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT:[>' ) { wrapper . start ++ ; dimension ++ ; } if ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT>' ) { int varStart = wrapper . start + <NUM_LIT:1> ; int varEnd = wrapper . computeEnd ( ) ; for ( int i = staticVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( staticVariables [ i ] . sourceName , wrapper . signature , varStart , varEnd ) ) return dimension == <NUM_LIT:0> ? ( TypeBinding ) staticVariables [ i ] : createArrayType ( staticVariables [ i ] , dimension ) ; ReferenceBinding initialType = enclosingType ; do { TypeVariableBinding [ ] enclosingTypeVariables ; if ( enclosingType instanceof BinaryTypeBinding ) { enclosingTypeVariables = ( ( BinaryTypeBinding ) enclosingType ) . typeVariables ; } else { enclosingTypeVariables = enclosingType . typeVariables ( ) ; } for ( int i = enclosingTypeVariables . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( enclosingTypeVariables [ i ] . sourceName , wrapper . signature , varStart , varEnd ) ) return dimension == <NUM_LIT:0> ? ( TypeBinding ) enclosingTypeVariables [ i ] : createArrayType ( enclosingTypeVariables [ i ] , dimension ) ; } while ( ( enclosingType = enclosingType . enclosingType ( ) ) != null ) ; this . problemReporter . undefinedTypeVariableSignature ( CharOperation . subarray ( wrapper . signature , varStart , varEnd ) , initialType ) ; return null ; } boolean isParameterized ; TypeBinding type = getTypeFromSignature ( wrapper . signature , wrapper . start , wrapper . computeEnd ( ) , isParameterized = ( wrapper . end == wrapper . bracket ) , enclosingType , missingTypeNames ) ; if ( ! isParameterized ) return dimension == <NUM_LIT:0> ? type : createArrayType ( type , dimension ) ; ReferenceBinding actualType = ( ReferenceBinding ) type ; if ( actualType instanceof UnresolvedReferenceBinding ) if ( CharOperation . indexOf ( '<CHAR_LIT>' , actualType . compoundName [ actualType . compoundName . length - <NUM_LIT:1> ] ) > <NUM_LIT:0> ) actualType = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( actualType , this , false ) ; ReferenceBinding actualEnclosing = actualType . enclosingType ( ) ; if ( actualEnclosing != null ) { actualEnclosing = ( ReferenceBinding ) convertToRawType ( actualEnclosing , false ) ; } TypeBinding [ ] typeArguments = getTypeArgumentsFromSignature ( wrapper , staticVariables , enclosingType , actualType , missingTypeNames ) ; ParameterizedTypeBinding parameterizedType = createParameterizedType ( actualType , typeArguments , actualEnclosing ) ; while ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT:.>' ) { wrapper . start ++ ; int memberStart = wrapper . start ; char [ ] memberName = wrapper . nextWord ( ) ; BinaryTypeBinding . resolveType ( parameterizedType , this , false ) ; ReferenceBinding memberType = parameterizedType . genericType ( ) . getMemberType ( memberName ) ; if ( memberType == null ) this . problemReporter . corruptedSignature ( parameterizedType , wrapper . signature , memberStart ) ; if ( wrapper . signature [ wrapper . start ] == '<CHAR_LIT>' ) { wrapper . start ++ ; typeArguments = getTypeArgumentsFromSignature ( wrapper , staticVariables , enclosingType , memberType , missingTypeNames ) ; } else { typeArguments = null ; } parameterizedType = createParameterizedType ( memberType , typeArguments , parameterizedType ) ; } wrapper . start ++ ; return dimension == <NUM_LIT:0> ? ( TypeBinding ) parameterizedType : createArrayType ( parameterizedType , dimension ) ; } TypeBinding getTypeFromVariantTypeSignature ( SignatureWrapper wrapper , TypeVariableBinding [ ] staticVariables , ReferenceBinding enclosingType , ReferenceBinding genericType , int rank , char [ ] [ ] [ ] missingTypeNames ) { switch ( wrapper . signature [ wrapper . start ] ) { case '<CHAR_LIT:->' : wrapper . start ++ ; TypeBinding bound = getTypeFromTypeSignature ( wrapper , staticVariables , enclosingType , missingTypeNames ) ; return createWildcard ( genericType , rank , bound , null , Wildcard . SUPER ) ; case '<CHAR_LIT>' : wrapper . start ++ ; bound = getTypeFromTypeSignature ( wrapper , staticVariables , enclosingType , missingTypeNames ) ; return createWildcard ( genericType , rank , bound , null , Wildcard . EXTENDS ) ; case '<CHAR_LIT>' : wrapper . start ++ ; return createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; default : return getTypeFromTypeSignature ( wrapper , staticVariables , enclosingType , missingTypeNames ) ; } } boolean isMissingType ( char [ ] typeName ) { for ( int i = this . missingTypes == null ? <NUM_LIT:0> : this . missingTypes . size ( ) ; -- i >= <NUM_LIT:0> ; ) { MissingTypeBinding missingType = ( MissingTypeBinding ) this . missingTypes . get ( i ) ; if ( CharOperation . equals ( missingType . sourceName , typeName ) ) return true ; } return false ; } boolean isPackage ( char [ ] [ ] compoundName , char [ ] name ) { if ( compoundName == null || compoundName . length == <NUM_LIT:0> ) return this . nameEnvironment . isPackage ( null , name ) ; return this . nameEnvironment . isPackage ( compoundName , name ) ; } public MethodVerifier methodVerifier ( ) { if ( this . verifier == null ) this . verifier = newMethodVerifier ( ) ; return this . verifier ; } public MethodVerifier newMethodVerifier ( ) { return new MethodVerifier15 ( this ) ; } public void releaseClassFiles ( org . eclipse . jdt . internal . compiler . ClassFile [ ] classFiles ) { for ( int i = <NUM_LIT:0> , fileCount = classFiles . length ; i < fileCount ; i ++ ) this . classFilePool . release ( classFiles [ i ] ) ; } public void reset ( ) { this . defaultPackage = new PackageBinding ( this ) ; this . defaultImports = null ; this . knownPackages = new HashtableOfPackage ( ) ; this . accessRestrictions = new HashMap ( <NUM_LIT:3> ) ; this . verifier = null ; for ( int i = this . uniqueArrayBindings . length ; -- i >= <NUM_LIT:0> ; ) { ArrayBinding [ ] arrayBindings = this . uniqueArrayBindings [ i ] ; if ( arrayBindings != null ) for ( int j = arrayBindings . length ; -- j >= <NUM_LIT:0> ; ) arrayBindings [ j ] = null ; } this . uniqueParameterizedTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueRawTypeBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueWildcardBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueParameterizedGenericMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniquePolymorphicMethodBindings = new SimpleLookupTable ( <NUM_LIT:3> ) ; this . uniqueGetClassMethodBinding = null ; this . missingTypes = null ; this . typesBeingConnected = new HashSet ( ) ; for ( int i = this . units . length ; -- i >= <NUM_LIT:0> ; ) this . units [ i ] = null ; this . lastUnitIndex = - <NUM_LIT:1> ; this . lastCompletedUnitIndex = - <NUM_LIT:1> ; this . unitBeingCompleted = null ; this . classFilePool . reset ( ) ; } public void setAccessRestriction ( ReferenceBinding type , AccessRestriction accessRestriction ) { if ( accessRestriction == null ) return ; type . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; this . accessRestrictions . put ( type , accessRestriction ) ; } void updateCaches ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType ) { if ( this . uniqueParameterizedTypeBindings . get ( unresolvedType ) != null ) { Object [ ] keys = this . uniqueParameterizedTypeBindings . keyTable ; for ( int i = <NUM_LIT:0> , l = keys . length ; i < l ; i ++ ) { if ( keys [ i ] == unresolvedType ) { keys [ i ] = resolvedType ; break ; } } } if ( this . uniqueRawTypeBindings . get ( unresolvedType ) != null ) { Object [ ] keys = this . uniqueRawTypeBindings . keyTable ; for ( int i = <NUM_LIT:0> , l = keys . length ; i < l ; i ++ ) { if ( keys [ i ] == unresolvedType ) { keys [ i ] = resolvedType ; break ; } } } if ( this . uniqueWildcardBindings . get ( unresolvedType ) != null ) { Object [ ] keys = this . uniqueWildcardBindings . keyTable ; for ( int i = <NUM_LIT:0> , l = keys . length ; i < l ; i ++ ) { if ( keys [ i ] == unresolvedType ) { keys [ i ] = resolvedType ; break ; } } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public class FieldBinding extends VariableBinding { public ReferenceBinding declaringClass ; public int compoundUseFlag = <NUM_LIT:0> ; protected FieldBinding ( ) { super ( null , null , <NUM_LIT:0> , null ) ; } public FieldBinding ( char [ ] name , TypeBinding type , int modifiers , ReferenceBinding declaringClass , Constant constant ) { super ( name , type , modifiers , constant ) ; this . declaringClass = declaringClass ; } public FieldBinding ( FieldBinding initialFieldBinding , ReferenceBinding declaringClass ) { super ( initialFieldBinding . name , initialFieldBinding . type , initialFieldBinding . modifiers , initialFieldBinding . constant ( ) ) ; this . declaringClass = declaringClass ; this . id = initialFieldBinding . id ; setAnnotations ( initialFieldBinding . getAnnotations ( ) ) ; } public FieldBinding ( FieldDeclaration field , TypeBinding type , int modifiers , ReferenceBinding declaringClass ) { this ( field . name , type , modifiers , declaringClass , null ) ; field . binding = this ; } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { if ( isPublic ( ) ) return true ; if ( isPrivate ( ) ) return false ; return invocationPackage == this . declaringClass . getPackage ( ) ; } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( invocationType == this . declaringClass && invocationType == receiverType ) return true ; if ( invocationType == null ) return ! isPrivate ( ) && scope . getCurrentPackage ( ) == this . declaringClass . fPackage ; if ( isProtected ( ) ) { if ( invocationType == this . declaringClass ) return true ; if ( invocationType . fPackage == this . declaringClass . fPackage ) return true ; ReferenceBinding currentType = invocationType ; int depth = <NUM_LIT:0> ; ReferenceBinding receiverErasure = ( ReferenceBinding ) receiverType . erasure ( ) ; ReferenceBinding declaringErasure = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; do { if ( currentType . findSuperTypeOriginatingFrom ( declaringErasure ) != null ) { if ( invocationSite . isSuperAccess ( ) ) return true ; if ( receiverType instanceof ArrayBinding ) return false ; if ( isStatic ( ) ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } if ( currentType == receiverErasure || receiverErasure . findSuperTypeOriginatingFrom ( currentType ) != null ) { if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return true ; } } depth ++ ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { receiverCheck : { if ( receiverType != this . declaringClass ) { if ( scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_6 && receiverType . isTypeVariable ( ) && ( ( TypeVariableBinding ) receiverType ) . isErasureBoundTo ( this . declaringClass . erasure ( ) ) ) break receiverCheck ; return false ; } } if ( invocationType != this . declaringClass ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ReferenceBinding ) this . declaringClass . erasure ( ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } PackageBinding declaringPackage = this . declaringClass . fPackage ; if ( invocationType . fPackage != declaringPackage ) return false ; if ( receiverType instanceof ArrayBinding ) return false ; TypeBinding originalDeclaringClass = this . declaringClass . original ( ) ; ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; do { if ( currentType . isCapture ( ) ) { if ( originalDeclaringClass == currentType . erasure ( ) . original ( ) ) return true ; } else { if ( originalDeclaringClass == currentType . original ( ) ) return true ; } PackageBinding currentPackage = currentType . fPackage ; if ( currentPackage != null && currentPackage != declaringPackage ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] declaringKey = this . declaringClass == null ? CharOperation . NO_CHAR : this . declaringClass . computeUniqueKey ( false ) ; int declaringLength = declaringKey . length ; int nameLength = this . name . length ; char [ ] returnTypeKey = this . type == null ? new char [ ] { '<CHAR_LIT>' } : this . type . computeUniqueKey ( false ) ; int returnTypeLength = returnTypeKey . length ; char [ ] uniqueKey = new char [ declaringLength + <NUM_LIT:1> + nameLength + <NUM_LIT:1> + returnTypeLength ] ; int index = <NUM_LIT:0> ; System . arraycopy ( declaringKey , <NUM_LIT:0> , uniqueKey , index , declaringLength ) ; index += declaringLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:.>' ; System . arraycopy ( this . name , <NUM_LIT:0> , uniqueKey , index , nameLength ) ; index += nameLength ; uniqueKey [ index ++ ] = '<CHAR_LIT:)>' ; System . arraycopy ( returnTypeKey , <NUM_LIT:0> , uniqueKey , index , returnTypeLength ) ; return uniqueKey ; } public Constant constant ( ) { Constant fieldConstant = this . constant ; if ( fieldConstant == null ) { if ( isFinal ( ) ) { FieldBinding originalField = original ( ) ; if ( originalField . declaringClass instanceof SourceTypeBinding ) { SourceTypeBinding sourceType = ( SourceTypeBinding ) originalField . declaringClass ; if ( sourceType . scope != null ) { TypeDeclaration typeDecl = sourceType . scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; MethodScope initScope = originalField . isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ; boolean old = initScope . insideTypeAnnotation ; try { initScope . insideTypeAnnotation = false ; fieldDecl . resolve ( initScope ) ; } finally { initScope . insideTypeAnnotation = old ; } fieldConstant = originalField . constant == null ? Constant . NotAConstant : originalField . constant ; } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } this . constant = fieldConstant ; } return fieldConstant ; } public char [ ] genericSignature ( ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) return null ; return this . type . genericTypeSignature ( ) ; } public final int getAccessFlags ( ) { return this . modifiers & ExtraCompilerModifiers . AccJustFlag ; } public AnnotationBinding [ ] getAnnotations ( ) { FieldBinding originalField = original ( ) ; ReferenceBinding declaringClassBinding = originalField . declaringClass ; if ( declaringClassBinding == null ) { return Binding . NO_ANNOTATIONS ; } return declaringClassBinding . retrieveAnnotations ( originalField ) ; } public long getAnnotationTagBits ( ) { FieldBinding originalField = original ( ) ; if ( ( originalField . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> && originalField . declaringClass instanceof SourceTypeBinding ) { ClassScope scope = ( ( SourceTypeBinding ) originalField . declaringClass ) . scope ; if ( scope == null ) { this . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; return <NUM_LIT:0> ; } TypeDeclaration typeDecl = scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; if ( fieldDecl != null ) { MethodScope initializationScope = isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ; FieldBinding previousField = initializationScope . initializedField ; int previousFieldID = initializationScope . lastVisibleFieldID ; try { initializationScope . initializedField = originalField ; initializationScope . lastVisibleFieldID = originalField . id ; ASTNode . resolveAnnotations ( initializationScope , fieldDecl . annotations , originalField ) ; } finally { initializationScope . initializedField = previousField ; initializationScope . lastVisibleFieldID = previousFieldID ; } } } return originalField . tagBits ; } public final boolean isDefault ( ) { return ! isPublic ( ) && ! isProtected ( ) && ! isPrivate ( ) ; } public final boolean isDeprecated ( ) { return ( this . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ; } public final boolean isPrivate ( ) { return ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ; } public final boolean isOrEnclosedByPrivateType ( ) { if ( ( this . modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) return true ; return this . declaringClass != null && this . declaringClass . isOrEnclosedByPrivateType ( ) ; } public final boolean isProtected ( ) { return ( this . modifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ; } public final boolean isPublic ( ) { return ( this . modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ; } public final boolean isStatic ( ) { return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public final boolean isSynthetic ( ) { return ( this . modifiers & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } public final boolean isTransient ( ) { return ( this . modifiers & ClassFileConstants . AccTransient ) != <NUM_LIT:0> ; } public final boolean isUsed ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) != <NUM_LIT:0> || this . compoundUseFlag > <NUM_LIT:0> ; } public final boolean isUsedOnlyInCompound ( ) { return ( this . modifiers & ExtraCompilerModifiers . AccLocallyUsed ) == <NUM_LIT:0> && this . compoundUseFlag > <NUM_LIT:0> ; } public final boolean isViewedAsDeprecated ( ) { return ( this . modifiers & ( ClassFileConstants . AccDeprecated | ExtraCompilerModifiers . AccDeprecatedImplicitly ) ) != <NUM_LIT:0> ; } public final boolean isVolatile ( ) { return ( this . modifiers & ClassFileConstants . AccVolatile ) != <NUM_LIT:0> ; } public final int kind ( ) { return FIELD ; } public FieldBinding original ( ) { return this ; } public void setAnnotations ( AnnotationBinding [ ] annotations ) { this . declaringClass . storeAnnotations ( this , annotations ) ; } public FieldDeclaration sourceField ( ) { SourceTypeBinding sourceType ; try { sourceType = ( SourceTypeBinding ) this . declaringClass ; } catch ( ClassCastException e ) { return null ; } FieldDeclaration [ ] fields = sourceType . scope . referenceContext . fields ; if ( fields != null ) { for ( int i = fields . length ; -- i >= <NUM_LIT:0> ; ) if ( this == fields [ i ] . binding ) return fields [ i ] ; } return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class WildcardBinding extends ReferenceBinding { public ReferenceBinding genericType ; public int rank ; public TypeBinding bound ; public TypeBinding [ ] otherBounds ; char [ ] genericSignature ; public int boundKind ; ReferenceBinding superclass ; ReferenceBinding [ ] superInterfaces ; TypeVariableBinding typeVariable ; LookupEnvironment environment ; public WildcardBinding ( ReferenceBinding genericType , int rank , TypeBinding bound , TypeBinding [ ] otherBounds , int boundKind , LookupEnvironment environment ) { this . rank = rank ; this . boundKind = boundKind ; this . modifiers = ClassFileConstants . AccPublic | ExtraCompilerModifiers . AccGenericSignature ; this . environment = environment ; initialize ( genericType , bound , otherBounds ) ; if ( genericType instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) genericType ) . addWrapper ( this , environment ) ; if ( bound instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) bound ) . addWrapper ( this , environment ) ; this . tagBits |= TagBits . HasUnresolvedTypeVariables ; this . typeBits = TypeIds . BitUninitialized ; } public int kind ( ) { return this . otherBounds == null ? Binding . WILDCARD_TYPE : Binding . INTERSECTION_TYPE ; } public boolean boundCheck ( TypeBinding argumentType ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return true ; case Wildcard . EXTENDS : if ( ! argumentType . isCompatibleWith ( this . bound ) ) return false ; for ( int i = <NUM_LIT:0> , length = this . otherBounds == null ? <NUM_LIT:0> : this . otherBounds . length ; i < length ; i ++ ) { if ( ! argumentType . isCompatibleWith ( this . otherBounds [ i ] ) ) return false ; } return true ; default : return argumentType . isCompatibleWith ( this . bound ) ; } } public boolean canBeInstantiated ( ) { return false ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { missingTypes = this . bound . collectMissingTypes ( missingTypes ) ; } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) return ; if ( actualType == TypeBinding . NULL ) return ; if ( actualType . isCapture ( ) ) { CaptureBinding capture = ( CaptureBinding ) actualType ; actualType = capture . wildcard ; } switch ( constraint ) { case TypeConstants . CONSTRAINT_EXTENDS : switch ( this . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; break ; case Wildcard . SUPER : break ; } break ; case Binding . INTERSECTION_TYPE : WildcardBinding actualIntersection = ( WildcardBinding ) actualType ; this . bound . collectSubstitutes ( scope , actualIntersection . bound , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; for ( int i = <NUM_LIT:0> , length = actualIntersection . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualIntersection . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; } break ; default : this . bound . collectSubstitutes ( scope , actualType , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; break ; } break ; case Wildcard . SUPER : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : break ; case Wildcard . SUPER : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; } break ; case Binding . INTERSECTION_TYPE : break ; default : this . bound . collectSubstitutes ( scope , actualType , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; break ; } break ; } break ; case TypeConstants . CONSTRAINT_EQUAL : switch ( this . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } break ; case Wildcard . SUPER : break ; } break ; case Binding . INTERSECTION_TYPE : WildcardBinding actuaIntersection = ( WildcardBinding ) actualType ; this . bound . collectSubstitutes ( scope , actuaIntersection . bound , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; for ( int i = <NUM_LIT:0> , length = actuaIntersection . otherBounds == null ? <NUM_LIT:0> : actuaIntersection . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actuaIntersection . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } break ; default : break ; } break ; case Wildcard . SUPER : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : break ; case Wildcard . SUPER : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } break ; } break ; case Binding . INTERSECTION_TYPE : break ; default : break ; } break ; } break ; case TypeConstants . CONSTRAINT_SUPER : switch ( this . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; case Wildcard . SUPER : break ; } break ; case Binding . INTERSECTION_TYPE : WildcardBinding actualIntersection = ( WildcardBinding ) actualType ; this . bound . collectSubstitutes ( scope , actualIntersection . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualIntersection . otherBounds == null ? <NUM_LIT:0> : actualIntersection . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualIntersection . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; default : break ; } break ; case Wildcard . SUPER : switch ( actualType . kind ( ) ) { case Binding . WILDCARD_TYPE : WildcardBinding actualWildcard = ( WildcardBinding ) actualType ; switch ( actualWildcard . boundKind ) { case Wildcard . UNBOUND : break ; case Wildcard . EXTENDS : break ; case Wildcard . SUPER : this . bound . collectSubstitutes ( scope , actualWildcard . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; for ( int i = <NUM_LIT:0> , length = actualWildcard . otherBounds == null ? <NUM_LIT:0> : actualWildcard . otherBounds . length ; i < length ; i ++ ) { this . bound . collectSubstitutes ( scope , actualWildcard . otherBounds [ i ] , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; } break ; } break ; case Binding . INTERSECTION_TYPE : break ; default : break ; } break ; } break ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] genericTypeKey = this . genericType . computeUniqueKey ( false ) ; char [ ] wildCardKey ; char [ ] rankComponent = ( '<CHAR_LIT>' + String . valueOf ( this . rank ) + '<CHAR_LIT:}>' ) . toCharArray ( ) ; switch ( this . boundKind ) { case Wildcard . UNBOUND : wildCardKey = TypeConstants . WILDCARD_STAR ; break ; case Wildcard . EXTENDS : wildCardKey = CharOperation . concat ( TypeConstants . WILDCARD_PLUS , this . bound . computeUniqueKey ( false ) ) ; break ; default : wildCardKey = CharOperation . concat ( TypeConstants . WILDCARD_MINUS , this . bound . computeUniqueKey ( false ) ) ; break ; } return CharOperation . concat ( genericTypeKey , rankComponent , wildCardKey ) ; } public char [ ] constantPoolName ( ) { return erasure ( ) . constantPoolName ( ) ; } public String debugName ( ) { return toString ( ) ; } public TypeBinding erasure ( ) { if ( this . otherBounds == null ) { if ( this . boundKind == Wildcard . EXTENDS ) return this . bound . erasure ( ) ; TypeVariableBinding var = typeVariable ( ) ; if ( var != null ) return var . erasure ( ) ; return this . genericType ; } return this . bound . id == TypeIds . T_JavaLangObject ? this . otherBounds [ <NUM_LIT:0> ] . erasure ( ) : this . bound . erasure ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericSignature == null ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : this . genericSignature = TypeConstants . WILDCARD_STAR ; break ; case Wildcard . EXTENDS : this . genericSignature = CharOperation . concat ( TypeConstants . WILDCARD_PLUS , this . bound . genericTypeSignature ( ) ) ; break ; default : this . genericSignature = CharOperation . concat ( TypeConstants . WILDCARD_MINUS , this . bound . genericTypeSignature ( ) ) ; } } return this . genericSignature ; } public int hashCode ( ) { return this . genericType . hashCode ( ) ; } public boolean hasTypeBit ( int bit ) { if ( this . typeBits == TypeIds . BitUninitialized ) { this . typeBits = <NUM_LIT:0> ; if ( this . superclass != null && this . superclass . hasTypeBit ( ~ TypeIds . BitUninitialized ) ) this . typeBits |= ( this . superclass . typeBits & TypeIds . InheritableBits ) ; if ( this . superInterfaces != null ) for ( int i = <NUM_LIT:0> , l = this . superInterfaces . length ; i < l ; i ++ ) if ( this . superInterfaces [ i ] . hasTypeBit ( ~ TypeIds . BitUninitialized ) ) this . typeBits |= ( this . superInterfaces [ i ] . typeBits & TypeIds . InheritableBits ) ; } return ( this . typeBits & bit ) != <NUM_LIT:0> ; } void initialize ( ReferenceBinding someGenericType , TypeBinding someBound , TypeBinding [ ] someOtherBounds ) { this . genericType = someGenericType ; this . bound = someBound ; this . otherBounds = someOtherBounds ; if ( someGenericType != null ) { this . fPackage = someGenericType . getPackage ( ) ; } if ( someBound != null ) { this . tagBits |= someBound . tagBits & ( TagBits . HasTypeVariable | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } if ( someOtherBounds != null ) { for ( int i = <NUM_LIT:0> , max = someOtherBounds . length ; i < max ; i ++ ) { TypeBinding someOtherBound = someOtherBounds [ i ] ; this . tagBits |= someOtherBound . tagBits & TagBits . ContainsNestedTypeReferences ; } } } public boolean isSuperclassOf ( ReferenceBinding otherType ) { if ( this . boundKind == Wildcard . SUPER ) { if ( this . bound instanceof ReferenceBinding ) { return ( ( ReferenceBinding ) this . bound ) . isSuperclassOf ( otherType ) ; } else { return otherType . id == TypeIds . T_JavaLangObject ; } } return false ; } public boolean isIntersectionType ( ) { return this . otherBounds != null ; } public boolean isHierarchyConnected ( ) { return this . superclass != null && this . superInterfaces != null ; } public boolean isUnboundWildcard ( ) { return this . boundKind == Wildcard . UNBOUND ; } public boolean isWildcard ( ) { return true ; } public char [ ] readableName ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return TypeConstants . WILDCARD_NAME ; case Wildcard . EXTENDS : if ( this . otherBounds == null ) return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . readableName ( ) ) ; StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( this . bound . readableName ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT>' ) . append ( this . otherBounds [ i ] . readableName ( ) ) ; } int length ; char [ ] result = new char [ length = buffer . length ( ) ] ; buffer . getChars ( <NUM_LIT:0> , length , result , <NUM_LIT:0> ) ; return result ; default : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . readableName ( ) ) ; } } ReferenceBinding resolve ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedTypeVariables ) == <NUM_LIT:0> ) return this ; this . tagBits &= ~ TagBits . HasUnresolvedTypeVariables ; BinaryTypeBinding . resolveType ( this . genericType , this . environment , false ) ; switch ( this . boundKind ) { case Wildcard . EXTENDS : TypeBinding resolveType = BinaryTypeBinding . resolveType ( this . bound , this . environment , true ) ; this . bound = resolveType ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; for ( int i = <NUM_LIT:0> , length = this . otherBounds == null ? <NUM_LIT:0> : this . otherBounds . length ; i < length ; i ++ ) { resolveType = BinaryTypeBinding . resolveType ( this . otherBounds [ i ] , this . environment , true ) ; this . otherBounds [ i ] = resolveType ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; } break ; case Wildcard . SUPER : resolveType = BinaryTypeBinding . resolveType ( this . bound , this . environment , true ) ; this . bound = resolveType ; this . tagBits |= resolveType . tagBits & TagBits . ContainsNestedTypeReferences ; break ; case Wildcard . UNBOUND : } return this ; } public char [ ] shortReadableName ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return TypeConstants . WILDCARD_NAME ; case Wildcard . EXTENDS : if ( this . otherBounds == null ) return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . shortReadableName ( ) ) ; StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( this . bound . shortReadableName ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT>' ) . append ( this . otherBounds [ i ] . shortReadableName ( ) ) ; } int length ; char [ ] result = new char [ length = buffer . length ( ) ] ; buffer . getChars ( <NUM_LIT:0> , length , result , <NUM_LIT:0> ) ; return result ; default : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . shortReadableName ( ) ) ; } } public char [ ] signature ( ) { if ( this . signature == null ) { switch ( this . boundKind ) { case Wildcard . EXTENDS : return this . bound . signature ( ) ; default : return typeVariable ( ) . signature ( ) ; } } return this . signature ; } public char [ ] sourceName ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return TypeConstants . WILDCARD_NAME ; case Wildcard . EXTENDS : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . sourceName ( ) ) ; default : return CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . sourceName ( ) ) ; } } public ReferenceBinding superclass ( ) { if ( this . superclass == null ) { TypeBinding superType = null ; if ( this . boundKind == Wildcard . EXTENDS && ! this . bound . isInterface ( ) ) { superType = this . bound ; } else { TypeVariableBinding variable = typeVariable ( ) ; if ( variable != null ) superType = variable . firstBound ; } this . superclass = superType instanceof ReferenceBinding && ! superType . isInterface ( ) ? ( ReferenceBinding ) superType : this . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; } return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { if ( this . superInterfaces == null ) { if ( typeVariable ( ) != null ) { this . superInterfaces = this . typeVariable . superInterfaces ( ) ; } else { this . superInterfaces = Binding . NO_SUPERINTERFACES ; } if ( this . boundKind == Wildcard . EXTENDS ) { if ( this . bound . isInterface ( ) ) { int length = this . superInterfaces . length ; System . arraycopy ( this . superInterfaces , <NUM_LIT:0> , this . superInterfaces = new ReferenceBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:1> , length ) ; this . superInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) this . bound ; } if ( this . otherBounds != null ) { int length = this . superInterfaces . length ; int otherLength = this . otherBounds . length ; System . arraycopy ( this . superInterfaces , <NUM_LIT:0> , this . superInterfaces = new ReferenceBinding [ length + otherLength ] , <NUM_LIT:0> , length ) ; for ( int i = <NUM_LIT:0> ; i < otherLength ; i ++ ) { this . superInterfaces [ length + i ] = ( ReferenceBinding ) this . otherBounds [ i ] ; } } } } return this . superInterfaces ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { boolean affected = false ; if ( this . genericType == unresolvedType ) { this . genericType = resolvedType ; affected = true ; } if ( this . bound == unresolvedType ) { this . bound = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; affected = true ; } if ( this . otherBounds != null ) { for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { if ( this . otherBounds [ i ] == unresolvedType ) { this . otherBounds [ i ] = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; affected = true ; } } } if ( affected ) initialize ( this . genericType , this . bound , this . otherBounds ) ; } public String toString ( ) { switch ( this . boundKind ) { case Wildcard . UNBOUND : return new String ( TypeConstants . WILDCARD_NAME ) ; case Wildcard . EXTENDS : if ( this . otherBounds == null ) return new String ( CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_EXTENDS , this . bound . debugName ( ) . toCharArray ( ) ) ) ; StringBuffer buffer = new StringBuffer ( this . bound . debugName ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . otherBounds . length ; i < length ; i ++ ) { buffer . append ( '<CHAR_LIT>' ) . append ( this . otherBounds [ i ] . debugName ( ) ) ; } return buffer . toString ( ) ; default : return new String ( CharOperation . concat ( TypeConstants . WILDCARD_NAME , TypeConstants . WILDCARD_SUPER , this . bound . debugName ( ) . toCharArray ( ) ) ) ; } } public TypeVariableBinding typeVariable ( ) { if ( this . typeVariable == null ) { TypeVariableBinding [ ] typeVariables = this . genericType . typeVariables ( ) ; if ( this . rank < typeVariables . length ) this . typeVariable = typeVariables [ this . rank ] ; } return this . typeVariable ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . CaseStatement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; public final class LocalTypeBinding extends NestedTypeBinding { final static char [ ] LocalTypePrefix = { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:c>' , '<CHAR_LIT:a>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; private InnerEmulationDependency [ ] dependents ; public ArrayBinding [ ] localArrayBindings ; public CaseStatement enclosingCase ; public int sourceStart ; public MethodBinding enclosingMethod ; public LocalTypeBinding ( ClassScope scope , SourceTypeBinding enclosingType , CaseStatement switchCase ) { super ( new char [ ] [ ] { CharOperation . concat ( LocalTypeBinding . LocalTypePrefix , scope . referenceContext . name ) } , scope , enclosingType ) ; TypeDeclaration typeDeclaration = scope . referenceContext ; if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { this . tagBits |= TagBits . AnonymousTypeMask ; } else { this . tagBits |= TagBits . LocalTypeMask ; } this . enclosingCase = switchCase ; this . sourceStart = typeDeclaration . sourceStart ; MethodScope methodScope = scope . enclosingMethodScope ( ) ; AbstractMethodDeclaration methodDeclaration = methodScope . referenceMethod ( ) ; if ( methodDeclaration != null ) { this . enclosingMethod = methodDeclaration . binding ; } } public void addInnerEmulationDependent ( BlockScope dependentScope , boolean wasEnclosingInstanceSupplied ) { int index ; if ( this . dependents == null ) { index = <NUM_LIT:0> ; this . dependents = new InnerEmulationDependency [ <NUM_LIT:1> ] ; } else { index = this . dependents . length ; for ( int i = <NUM_LIT:0> ; i < index ; i ++ ) if ( this . dependents [ i ] . scope == dependentScope ) return ; System . arraycopy ( this . dependents , <NUM_LIT:0> , ( this . dependents = new InnerEmulationDependency [ index + <NUM_LIT:1> ] ) , <NUM_LIT:0> , index ) ; } this . dependents [ index ] = new InnerEmulationDependency ( dependentScope , wasEnclosingInstanceSupplied ) ; } public ReferenceBinding anonymousOriginalSuperType ( ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { return this . superInterfaces [ <NUM_LIT:0> ] ; } if ( ( this . tagBits & TagBits . HierarchyHasProblems ) == <NUM_LIT:0> ) { return this . superclass ; } if ( this . scope != null ) { TypeReference typeReference = this . scope . referenceContext . allocation . type ; if ( typeReference != null ) { return ( ReferenceBinding ) typeReference . resolvedType ; } } return this . superclass ; } protected void checkRedundantNullnessDefaultRecurse ( ASTNode location , Annotation [ ] annotations , long annotationTagBits ) { long outerDefault = this . enclosingMethod != null ? this . enclosingMethod . tagBits & ( ( TagBits . AnnotationNonNullByDefault | TagBits . AnnotationNullUnspecifiedByDefault ) ) : <NUM_LIT:0> ; if ( outerDefault != <NUM_LIT:0> ) { if ( outerDefault == annotationTagBits ) { this . scope . problemReporter ( ) . nullDefaultAnnotationIsRedundant ( location , annotations , this . enclosingMethod ) ; } return ; } super . checkRedundantNullnessDefaultRecurse ( location , annotations , annotationTagBits ) ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] outerKey = outermostEnclosingType ( ) . computeUniqueKey ( isLeaf ) ; int semicolon = CharOperation . lastIndexOf ( '<CHAR_LIT:;>' , outerKey ) ; StringBuffer sig = new StringBuffer ( ) ; sig . append ( outerKey , <NUM_LIT:0> , semicolon ) ; sig . append ( '<CHAR_LIT>' ) ; sig . append ( String . valueOf ( this . sourceStart ) ) ; if ( ! isAnonymousType ( ) ) { sig . append ( '<CHAR_LIT>' ) ; sig . append ( this . sourceName ) ; } sig . append ( outerKey , semicolon , outerKey . length - semicolon ) ; int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public char [ ] constantPoolName ( ) { if ( this . constantPoolName == null && this . scope != null ) { this . constantPoolName = this . scope . compilationUnitScope ( ) . computeConstantPoolName ( this ) ; } return this . constantPoolName ; } ArrayBinding createArrayType ( int dimensionCount , LookupEnvironment lookupEnvironment ) { if ( this . localArrayBindings == null ) { this . localArrayBindings = new ArrayBinding [ ] { new ArrayBinding ( this , dimensionCount , lookupEnvironment ) } ; return this . localArrayBindings [ <NUM_LIT:0> ] ; } int length = this . localArrayBindings . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( this . localArrayBindings [ i ] . dimensions == dimensionCount ) return this . localArrayBindings [ i ] ; System . arraycopy ( this . localArrayBindings , <NUM_LIT:0> , this . localArrayBindings = new ArrayBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; return this . localArrayBindings [ length ] = new ArrayBinding ( this , dimensionCount , lookupEnvironment ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericReferenceTypeSignature == null && this . constantPoolName == null ) { if ( isAnonymousType ( ) ) setConstantPoolName ( superclass ( ) . sourceName ( ) ) ; else setConstantPoolName ( sourceName ( ) ) ; } return super . genericTypeSignature ( ) ; } public char [ ] readableName ( ) { char [ ] readableName ; if ( isAnonymousType ( ) ) { readableName = CharOperation . concat ( TypeConstants . ANONYM_PREFIX , anonymousOriginalSuperType ( ) . readableName ( ) , TypeConstants . ANONYM_SUFFIX ) ; } else if ( isMemberType ( ) ) { readableName = CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { readableName = this . sourceName ; } TypeVariableBinding [ ] typeVars ; if ( ( typeVars = typeVariables ( ) ) != Binding . NO_TYPE_VARIABLES ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( readableName ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( typeVars [ i ] . readableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = nameBuffer . length ( ) ; readableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , readableName , <NUM_LIT:0> ) ; } return readableName ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isAnonymousType ( ) ) { shortReadableName = CharOperation . concat ( TypeConstants . ANONYM_PREFIX , anonymousOriginalSuperType ( ) . shortReadableName ( ) , TypeConstants . ANONYM_SUFFIX ) ; } else if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { shortReadableName = this . sourceName ; } TypeVariableBinding [ ] typeVars ; if ( ( typeVars = typeVariables ( ) ) != Binding . NO_TYPE_VARIABLES ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; nameBuffer . append ( shortReadableName ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = typeVars . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( typeVars [ i ] . shortReadableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = nameBuffer . length ( ) ; shortReadableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , shortReadableName , <NUM_LIT:0> ) ; } return shortReadableName ; } public void setAsMemberType ( ) { this . tagBits |= TagBits . MemberTypeMask ; } public void setConstantPoolName ( char [ ] computedConstantPoolName ) { this . constantPoolName = computedConstantPoolName ; } public char [ ] signature ( ) { if ( this . signature == null && this . constantPoolName == null ) { if ( isAnonymousType ( ) ) setConstantPoolName ( superclass ( ) . sourceName ( ) ) ; else setConstantPoolName ( sourceName ( ) ) ; } return super . signature ( ) ; } public char [ ] sourceName ( ) { if ( isAnonymousType ( ) ) { return CharOperation . concat ( TypeConstants . ANONYM_PREFIX , anonymousOriginalSuperType ( ) . sourceName ( ) , TypeConstants . ANONYM_SUFFIX ) ; } else return this . sourceName ; } public String toString ( ) { if ( isAnonymousType ( ) ) return "<STR_LIT>" + super . toString ( ) ; if ( isMemberType ( ) ) return "<STR_LIT>" + new String ( sourceName ( ) ) + "<STR_LIT:U+0020>" + super . toString ( ) ; return "<STR_LIT>" + new String ( sourceName ( ) ) + "<STR_LIT:U+0020>" + super . toString ( ) ; } public void updateInnerEmulationDependents ( ) { if ( this . dependents != null ) { for ( int i = <NUM_LIT:0> ; i < this . dependents . length ; i ++ ) { InnerEmulationDependency dependency = this . dependents [ i ] ; dependency . scope . propagateInnerEmulation ( this , dependency . wasEnclosingInstanceSupplied ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . HashMap ; import java . util . Iterator ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . compiler . util . Util ; public class SourceTypeBinding extends ReferenceBinding { public ReferenceBinding superclass ; public ReferenceBinding [ ] superInterfaces ; private FieldBinding [ ] fields ; private MethodBinding [ ] methods ; public ReferenceBinding [ ] memberTypes ; public TypeVariableBinding [ ] typeVariables ; public ClassScope scope ; private final static int METHOD_EMUL = <NUM_LIT:0> ; private final static int FIELD_EMUL = <NUM_LIT:1> ; private final static int CLASS_LITERAL_EMUL = <NUM_LIT:2> ; private final static int MAX_SYNTHETICS = <NUM_LIT:3> ; HashMap [ ] synthetics ; char [ ] genericReferenceTypeSignature ; private SimpleLookupTable storedAnnotations = null ; private int defaultNullness ; private int nullnessDefaultInitialized = <NUM_LIT:0> ; public SourceTypeBinding ( char [ ] [ ] compoundName , PackageBinding fPackage , ClassScope scope ) { this . compoundName = compoundName ; this . fPackage = fPackage ; this . fileName = scope . referenceCompilationUnit ( ) . getFileName ( ) ; this . modifiers = scope . referenceContext . modifiers ; this . sourceName = scope . referenceContext . name ; this . scope = scope ; this . fields = Binding . UNINITIALIZED_FIELDS ; this . methods = Binding . UNINITIALIZED_METHODS ; computeId ( ) ; } private void addDefaultAbstractMethods ( ) { if ( ( this . tagBits & TagBits . KnowsDefaultAbstractMethods ) != <NUM_LIT:0> ) return ; this . tagBits |= TagBits . KnowsDefaultAbstractMethods ; if ( isClass ( ) && isAbstract ( ) ) { if ( this . scope . compilerOptions ( ) . targetJDK >= ClassFileConstants . JDK1_2 ) return ; ReferenceBinding [ ] itsInterfaces = superInterfaces ( ) ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { MethodBinding [ ] defaultAbstracts = null ; int defaultAbstractsCount = <NUM_LIT:0> ; ReferenceBinding [ ] interfacesToVisit = itsInterfaces ; int nextPosition = interfacesToVisit . length ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { MethodBinding [ ] superMethods = superType . methods ( ) ; nextAbstractMethod : for ( int m = superMethods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = superMethods [ m ] ; if ( implementsMethod ( method ) ) continue nextAbstractMethod ; if ( defaultAbstractsCount == <NUM_LIT:0> ) { defaultAbstracts = new MethodBinding [ <NUM_LIT:5> ] ; } else { for ( int k = <NUM_LIT:0> ; k < defaultAbstractsCount ; k ++ ) { MethodBinding alreadyAdded = defaultAbstracts [ k ] ; if ( CharOperation . equals ( alreadyAdded . selector , method . selector ) && alreadyAdded . areParametersEqual ( method ) ) continue nextAbstractMethod ; } } MethodBinding defaultAbstract = new MethodBinding ( method . modifiers | ExtraCompilerModifiers . AccDefaultAbstract | ClassFileConstants . AccSynthetic , method . selector , method . returnType , method . parameters , method . thrownExceptions , this ) ; if ( defaultAbstractsCount == defaultAbstracts . length ) System . arraycopy ( defaultAbstracts , <NUM_LIT:0> , defaultAbstracts = new MethodBinding [ <NUM_LIT:2> * defaultAbstractsCount ] , <NUM_LIT:0> , defaultAbstractsCount ) ; defaultAbstracts [ defaultAbstractsCount ++ ] = defaultAbstract ; } if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( defaultAbstractsCount > <NUM_LIT:0> ) { int length = this . methods . length ; System . arraycopy ( this . methods , <NUM_LIT:0> , this . methods = new MethodBinding [ length + defaultAbstractsCount ] , <NUM_LIT:0> , length ) ; System . arraycopy ( defaultAbstracts , <NUM_LIT:0> , this . methods , length , defaultAbstractsCount ) ; length = length + defaultAbstractsCount ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; } } } } public FieldBinding addSyntheticFieldForInnerclass ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( actualOuterLocalVariable ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name ) , actualOuterLocalVariable . type , ClassFileConstants . AccPrivate | ClassFileConstants . AccFinal | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( actualOuterLocalVariable , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:1> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( TypeConstants . SYNTHETIC_OUTER_LOCAL_PREFIX , actualOuterLocalVariable . name , ( "<STR_LIT:$>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public FieldBinding addSyntheticFieldForInnerclass ( ReferenceBinding enclosingType ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( enclosingType ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( CharOperation . concat ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , String . valueOf ( enclosingType . depth ( ) ) . toCharArray ( ) ) , enclosingType , ClassFileConstants . AccDefault | ClassFileConstants . AccFinal | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( enclosingType , synthField ) ; } boolean needRecheck ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { if ( this . scope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_5 ) { synthField . name = CharOperation . concat ( synthField . name , "<STR_LIT:$>" . toCharArray ( ) ) ; needRecheck = true ; } else { this . scope . problemReporter ( ) . duplicateFieldInType ( this , fieldDecl ) ; } break ; } } } } while ( needRecheck ) ; return synthField ; } public FieldBinding addSyntheticFieldForClassLiteral ( TypeBinding targetType , BlockScope blockScope ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] == null ) this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . get ( targetType ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( CharOperation . concat ( TypeConstants . SYNTHETIC_CLASS , String . valueOf ( this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . size ( ) ) . toCharArray ( ) ) , blockScope . getJavaLangClass ( ) , ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . put ( targetType , synthField ) ; } FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = blockScope . referenceType ( ) ; FieldDeclaration [ ] typeDeclarationFields = typeDecl . fields ; int max = typeDeclarationFields == null ? <NUM_LIT:0> : typeDeclarationFields . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = typeDeclarationFields [ i ] ; if ( fieldDecl . binding == existingField ) { blockScope . problemReporter ( ) . duplicateFieldInType ( this , fieldDecl ) ; break ; } } } return synthField ; } public FieldBinding addSyntheticFieldForAssert ( BlockScope blockScope ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( "<STR_LIT>" ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( TypeConstants . SYNTHETIC_ASSERT_DISABLED , TypeBinding . BOOLEAN , ClassFileConstants . AccDefault | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic | ClassFileConstants . AccFinal , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( "<STR_LIT>" , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:0> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; int max = ( typeDecl . fields == null ) ? <NUM_LIT:0> : typeDecl . fields . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = typeDecl . fields [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( TypeConstants . SYNTHETIC_ASSERT_DISABLED , ( "<STR_LIT:_>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public FieldBinding addSyntheticFieldForEnumValues ( ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; FieldBinding synthField = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( "<STR_LIT>" ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( TypeConstants . SYNTHETIC_ENUM_VALUES , this . scope . createArrayType ( this , <NUM_LIT:1> ) , ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic | ClassFileConstants . AccFinal , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( "<STR_LIT>" , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:0> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( TypeConstants . SYNTHETIC_ENUM_VALUES , ( "<STR_LIT:_>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public SyntheticMethodBinding addSyntheticMethod ( FieldBinding targetField , boolean isReadAccess , boolean isSuperAccess ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( targetField ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( targetField , isReadAccess , isSuperAccess , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( targetField , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ isReadAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ isReadAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( targetField , isReadAccess , isSuperAccess , this ) ; accessors [ isReadAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } } return accessMethod ; } public SyntheticMethodBinding addSyntheticEnumMethod ( char [ ] selector ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( selector ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( this , selector ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( selector , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:0> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( this , selector ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } } return accessMethod ; } public SyntheticFieldBinding addSyntheticFieldForSwitchEnum ( char [ ] fieldName , String key ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticFieldBinding synthField = ( SyntheticFieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( key ) ; if ( synthField == null ) { synthField = new SyntheticFieldBinding ( fieldName , this . scope . createArrayType ( TypeBinding . INT , <NUM_LIT:1> ) , ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccSynthetic , this , Constant . NotAConstant , this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ) ; this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . put ( key , synthField ) ; } boolean needRecheck ; int index = <NUM_LIT:0> ; do { needRecheck = false ; FieldBinding existingField ; if ( ( existingField = getField ( synthField . name , true ) ) != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; FieldDeclaration [ ] fieldDeclarations = typeDecl . fields ; int max = fieldDeclarations == null ? <NUM_LIT:0> : fieldDeclarations . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . binding == existingField ) { synthField . name = CharOperation . concat ( fieldName , ( "<STR_LIT:_>" + String . valueOf ( index ++ ) ) . toCharArray ( ) ) ; needRecheck = true ; break ; } } } } while ( needRecheck ) ; return synthField ; } public SyntheticMethodBinding addSyntheticMethodForSwitchEnum ( TypeBinding enumBinding ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; char [ ] selector = CharOperation . concat ( TypeConstants . SYNTHETIC_SWITCH_ENUM_TABLE , enumBinding . constantPoolName ( ) ) ; CharOperation . replace ( selector , '<CHAR_LIT:/>' , '<CHAR_LIT>' ) ; final String key = new String ( selector ) ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( key ) ; if ( accessors == null ) { final SyntheticFieldBinding fieldBinding = addSyntheticFieldForSwitchEnum ( selector , key ) ; accessMethod = new SyntheticMethodBinding ( fieldBinding , this , enumBinding , selector ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( key , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:0> ] ) == null ) { final SyntheticFieldBinding fieldBinding = addSyntheticFieldForSwitchEnum ( selector , key ) ; accessMethod = new SyntheticMethodBinding ( fieldBinding , this , enumBinding , selector ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } } return accessMethod ; } public SyntheticMethodBinding addSyntheticMethodForEnumInitialization ( int begin , int end ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = new SyntheticMethodBinding ( this , begin , end ) ; SyntheticMethodBinding [ ] accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( accessMethod . selector , accessors ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; return accessMethod ; } public SyntheticMethodBinding addSyntheticMethod ( MethodBinding targetMethod , boolean isSuperAccess ) { if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( targetMethod ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( targetMethod , isSuperAccess , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( targetMethod , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ isSuperAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ isSuperAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( targetMethod , isSuperAccess , this ) ; accessors [ isSuperAccess ? <NUM_LIT:0> : <NUM_LIT:1> ] = accessMethod ; } } if ( targetMethod . declaringClass . isStatic ( ) ) { if ( ( targetMethod . isConstructor ( ) && targetMethod . parameters . length >= <NUM_LIT> ) || targetMethod . parameters . length >= <NUM_LIT> ) { this . scope . problemReporter ( ) . tooManyParametersForSyntheticMethod ( targetMethod . sourceMethod ( ) ) ; } } else if ( ( targetMethod . isConstructor ( ) && targetMethod . parameters . length >= <NUM_LIT> ) || targetMethod . parameters . length >= <NUM_LIT> ) { this . scope . problemReporter ( ) . tooManyParametersForSyntheticMethod ( targetMethod . sourceMethod ( ) ) ; } return accessMethod ; } public SyntheticMethodBinding addSyntheticBridgeMethod ( MethodBinding inheritedMethodToBridge , MethodBinding targetMethod ) { if ( isInterface ( ) ) return null ; if ( inheritedMethodToBridge . returnType . erasure ( ) == targetMethod . returnType . erasure ( ) && inheritedMethodToBridge . areParameterErasuresEqual ( targetMethod ) ) { return null ; } if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) { this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; } else { Iterator synthMethods = this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . keySet ( ) . iterator ( ) ; while ( synthMethods . hasNext ( ) ) { Object synthetic = synthMethods . next ( ) ; if ( synthetic instanceof MethodBinding ) { MethodBinding method = ( MethodBinding ) synthetic ; if ( CharOperation . equals ( inheritedMethodToBridge . selector , method . selector ) && inheritedMethodToBridge . returnType . erasure ( ) == method . returnType . erasure ( ) && inheritedMethodToBridge . areParameterErasuresEqual ( method ) ) { return null ; } } } } SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( inheritedMethodToBridge ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , targetMethod , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( inheritedMethodToBridge , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:1> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:1> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , targetMethod , this ) ; accessors [ <NUM_LIT:1> ] = accessMethod ; } } return accessMethod ; } public SyntheticMethodBinding addSyntheticBridgeMethod ( MethodBinding inheritedMethodToBridge ) { if ( this . scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_5 ) { return null ; } if ( isInterface ( ) ) return null ; if ( inheritedMethodToBridge . isAbstract ( ) || inheritedMethodToBridge . isFinal ( ) || inheritedMethodToBridge . isStatic ( ) ) { return null ; } if ( this . synthetics == null ) this . synthetics = new HashMap [ MAX_SYNTHETICS ] ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) { this . synthetics [ SourceTypeBinding . METHOD_EMUL ] = new HashMap ( <NUM_LIT:5> ) ; } else { Iterator synthMethods = this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . keySet ( ) . iterator ( ) ; while ( synthMethods . hasNext ( ) ) { Object synthetic = synthMethods . next ( ) ; if ( synthetic instanceof MethodBinding ) { MethodBinding method = ( MethodBinding ) synthetic ; if ( CharOperation . equals ( inheritedMethodToBridge . selector , method . selector ) && inheritedMethodToBridge . returnType . erasure ( ) == method . returnType . erasure ( ) && inheritedMethodToBridge . areParameterErasuresEqual ( method ) ) { return null ; } } } } SyntheticMethodBinding accessMethod = null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( inheritedMethodToBridge ) ; if ( accessors == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , this ) ; this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . put ( inheritedMethodToBridge , accessors = new SyntheticMethodBinding [ <NUM_LIT:2> ] ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } else { if ( ( accessMethod = accessors [ <NUM_LIT:0> ] ) == null ) { accessMethod = new SyntheticMethodBinding ( inheritedMethodToBridge , this ) ; accessors [ <NUM_LIT:0> ] = accessMethod ; } } return accessMethod ; } boolean areFieldsInitialized ( ) { return this . fields != Binding . UNINITIALIZED_FIELDS ; } boolean areMethodsInitialized ( ) { return this . methods != Binding . UNINITIALIZED_METHODS ; } public int kind ( ) { if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) return Binding . GENERIC_TYPE ; return Binding . TYPE ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { char [ ] uniqueKey = super . computeUniqueKey ( isLeaf ) ; if ( uniqueKey . length == <NUM_LIT:2> ) return uniqueKey ; if ( Util . isClassFileName ( this . fileName ) ) return uniqueKey ; int end = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , this . fileName ) ; if ( end != - <NUM_LIT:1> ) { int start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , this . fileName ) + <NUM_LIT:1> ; char [ ] mainTypeName = CharOperation . subarray ( this . fileName , start , end ) ; start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , uniqueKey ) + <NUM_LIT:1> ; if ( start == <NUM_LIT:0> ) start = <NUM_LIT:1> ; if ( this . isMemberType ( ) ) { end = CharOperation . indexOf ( '<CHAR_LIT>' , uniqueKey , start ) ; } else { end = - <NUM_LIT:1> ; } if ( end == - <NUM_LIT:1> ) end = CharOperation . indexOf ( '<CHAR_LIT>' , uniqueKey , start ) ; if ( end == - <NUM_LIT:1> ) end = CharOperation . indexOf ( '<CHAR_LIT:;>' , uniqueKey , start ) ; char [ ] topLevelType = CharOperation . subarray ( uniqueKey , start , end ) ; if ( ! CharOperation . equals ( topLevelType , mainTypeName ) ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( uniqueKey , <NUM_LIT:0> , start ) ; buffer . append ( mainTypeName ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( topLevelType ) ; buffer . append ( uniqueKey , end , uniqueKey . length - end ) ; int length = buffer . length ( ) ; uniqueKey = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } } return uniqueKey ; } void faultInTypesForFieldsAndMethods ( ) { getAnnotationTagBits ( ) ; ReferenceBinding enclosingType = enclosingType ( ) ; if ( enclosingType != null && enclosingType . isViewedAsDeprecated ( ) && ! isDeprecated ( ) ) this . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; fields ( ) ; methods ( ) ; for ( int i = <NUM_LIT:0> , length = this . memberTypes . length ; i < length ; i ++ ) ( ( SourceTypeBinding ) this . memberTypes [ i ] ) . faultInTypesForFieldsAndMethods ( ) ; } public FieldBinding [ ] fields ( ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return this . fields ; int failed = <NUM_LIT:0> ; FieldBinding [ ] resolvedFields = this . fields ; try { if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) { if ( resolveTypeFor ( this . fields [ i ] ) == null ) { if ( resolvedFields == this . fields ) { System . arraycopy ( this . fields , <NUM_LIT:0> , resolvedFields = new FieldBinding [ length ] , <NUM_LIT:0> , length ) ; } resolvedFields [ i ] = null ; failed ++ ; } } } finally { if ( failed > <NUM_LIT:0> ) { int newSize = resolvedFields . length - failed ; if ( newSize == <NUM_LIT:0> ) return this . fields = Binding . NO_FIELDS ; FieldBinding [ ] newFields = new FieldBinding [ newSize ] ; for ( int i = <NUM_LIT:0> , j = <NUM_LIT:0> , length = resolvedFields . length ; i < length ; i ++ ) { if ( resolvedFields [ i ] != null ) newFields [ j ++ ] = resolvedFields [ i ] ; } this . fields = newFields ; } } this . tagBits |= TagBits . AreFieldsComplete ; return this . fields ; } public char [ ] genericTypeSignature ( ) { if ( this . genericReferenceTypeSignature == null ) this . genericReferenceTypeSignature = computeGenericTypeSignature ( this . typeVariables ) ; return this . genericReferenceTypeSignature ; } public char [ ] genericSignature ( ) { StringBuffer sig = null ; if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) { sig = new StringBuffer ( <NUM_LIT:10> ) ; sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . typeVariables . length ; i < length ; i ++ ) sig . append ( this . typeVariables [ i ] . genericSignature ( ) ) ; sig . append ( '<CHAR_LIT:>>' ) ; } else { noSignature : if ( this . superclass == null || ! this . superclass . isParameterizedType ( ) ) { for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) if ( this . superInterfaces [ i ] . isParameterizedType ( ) ) break noSignature ; return null ; } sig = new StringBuffer ( <NUM_LIT:10> ) ; } if ( this . superclass != null ) sig . append ( this . superclass . genericTypeSignature ( ) ) ; else sig . append ( this . scope . getJavaLangObject ( ) . genericTypeSignature ( ) ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) sig . append ( this . superInterfaces [ i ] . genericTypeSignature ( ) ) ; return sig . toString ( ) . toCharArray ( ) ; } public long getAnnotationTagBits ( ) { if ( ( this . tagBits & TagBits . AnnotationResolved ) == <NUM_LIT:0> && this . scope != null ) { TypeDeclaration typeDecl = this . scope . referenceContext ; boolean old = typeDecl . staticInitializerScope . insideTypeAnnotation ; try { typeDecl . staticInitializerScope . insideTypeAnnotation = true ; ASTNode . resolveAnnotations ( typeDecl . staticInitializerScope , typeDecl . annotations , this ) ; } finally { typeDecl . staticInitializerScope . insideTypeAnnotation = old ; } if ( ( this . tagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) this . modifiers |= ClassFileConstants . AccDeprecated ; evaluateNullAnnotations ( this . tagBits ) ; } return this . tagBits ; } public MethodBinding [ ] getDefaultAbstractMethods ( ) { int count = <NUM_LIT:0> ; for ( int i = this . methods . length ; -- i >= <NUM_LIT:0> ; ) if ( this . methods [ i ] . isDefaultAbstract ( ) ) count ++ ; if ( count == <NUM_LIT:0> ) return Binding . NO_METHODS ; MethodBinding [ ] result = new MethodBinding [ count ] ; count = <NUM_LIT:0> ; for ( int i = this . methods . length ; -- i >= <NUM_LIT:0> ; ) if ( this . methods [ i ] . isDefaultAbstract ( ) ) result [ count ++ ] = this . methods [ i ] ; return result ; } public MethodBinding getExactConstructor ( TypeBinding [ ] argumentTypes ) { int argCount = argumentTypes . length ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } else { if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( resolveTypesFor ( method ) == null || method . returnType == null ) { methods ( ) ; return getExactConstructor ( argumentTypes ) ; } if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } return null ; } public MethodBinding getExactMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , CompilationUnitScope refScope ) { int argCount = argumentTypes . length ; boolean foundNothing = true ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; foundNothing = false ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } else { if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; for ( int imethod = start ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( resolveTypesFor ( method ) == null || method . returnType == null ) { methods ( ) ; return getExactMethod ( selector , argumentTypes , refScope ) ; } } boolean isSource15 = this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; for ( int i = start ; i <= end ; i ++ ) { MethodBinding method1 = this . methods [ i ] ; for ( int j = end ; j > i ; j -- ) { MethodBinding method2 = this . methods [ j ] ; boolean paramsMatch = isSource15 ? method1 . areParameterErasuresEqual ( method2 ) : method1 . areParametersEqual ( method2 ) ; if ( paramsMatch ) { methods ( ) ; return getExactMethod ( selector , argumentTypes , refScope ) ; } } } nextMethod : for ( int imethod = start ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; TypeBinding [ ] toMatch = method . parameters ; if ( toMatch . length == argCount ) { for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; return method ; } } } } if ( foundNothing ) { if ( isInterface ( ) ) { if ( this . superInterfaces . length == <NUM_LIT:1> ) { if ( refScope != null ) refScope . recordTypeReference ( this . superInterfaces [ <NUM_LIT:0> ] ) ; return this . superInterfaces [ <NUM_LIT:0> ] . getExactMethod ( selector , argumentTypes , refScope ) ; } } else if ( this . superclass != null ) { if ( refScope != null ) refScope . recordTypeReference ( this . superclass ) ; return this . superclass . getExactMethod ( selector , argumentTypes , refScope ) ; } } return null ; } public FieldBinding getField ( char [ ] fieldName , boolean needResolve ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return ReferenceBinding . binarySearch ( fieldName , this . fields ) ; if ( ( this . tagBits & TagBits . AreFieldsSorted ) == <NUM_LIT:0> ) { int length = this . fields . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortFields ( this . fields , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreFieldsSorted ; } FieldBinding field = ReferenceBinding . binarySearch ( fieldName , this . fields ) ; if ( field != null ) { FieldBinding result = null ; try { result = resolveTypeFor ( field ) ; return result ; } finally { if ( result == null ) { int newSize = this . fields . length - <NUM_LIT:1> ; if ( newSize == <NUM_LIT:0> ) { this . fields = Binding . NO_FIELDS ; } else { FieldBinding [ ] newFields = new FieldBinding [ newSize ] ; int index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) { FieldBinding f = this . fields [ i ] ; if ( f == field ) continue ; newFields [ index ++ ] = f ; } this . fields = newFields ; } } } } return null ; } public MethodBinding [ ] getAnyExtraMethods ( char [ ] selector ) { return ( this . scope == null ? null : this . scope . getAnyExtraMethods ( selector ) ) ; } public MethodBinding [ ] getMethods ( char [ ] selector ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; int length = end - start + <NUM_LIT:1> ; MethodBinding [ ] result ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; return result ; } else { return Binding . NO_METHODS ; } } if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } MethodBinding [ ] result ; long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; for ( int i = start ; i <= end ; i ++ ) { MethodBinding method = this . methods [ i ] ; if ( resolveTypesFor ( method ) == null || method . returnType == null ) { methods ( ) ; return getMethods ( selector ) ; } } int length = end - start + <NUM_LIT:1> ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; } else { return Binding . NO_METHODS ; } boolean isSource15 = this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; for ( int i = <NUM_LIT:0> , length = result . length - <NUM_LIT:1> ; i < length ; i ++ ) { MethodBinding method = result [ i ] ; for ( int j = length ; j > i ; j -- ) { boolean paramsMatch = isSource15 ? method . areParameterErasuresEqual ( result [ j ] ) : method . areParametersEqual ( result [ j ] ) ; if ( paramsMatch ) { methods ( ) ; return getMethods ( selector ) ; } } } return result ; } public FieldBinding getSyntheticField ( LocalVariableBinding actualOuterLocalVariable ) { if ( this . synthetics == null || this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) return null ; return ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( actualOuterLocalVariable ) ; } public FieldBinding getSyntheticField ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch ) { if ( this . synthetics == null || this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ) return null ; FieldBinding field = ( FieldBinding ) this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . get ( targetEnclosingType ) ; if ( field != null ) return field ; if ( ! onlyExactMatch ) { Iterator accessFields = this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . values ( ) . iterator ( ) ; while ( accessFields . hasNext ( ) ) { field = ( FieldBinding ) accessFields . next ( ) ; if ( CharOperation . prefixEquals ( TypeConstants . SYNTHETIC_ENCLOSING_INSTANCE_PREFIX , field . name ) && field . type . findSuperTypeOriginatingFrom ( targetEnclosingType ) != null ) return field ; } } return null ; } public SyntheticMethodBinding getSyntheticBridgeMethod ( MethodBinding inheritedMethodToBridge ) { if ( this . synthetics == null ) return null ; if ( this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null ) return null ; SyntheticMethodBinding [ ] accessors = ( SyntheticMethodBinding [ ] ) this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . get ( inheritedMethodToBridge ) ; if ( accessors == null ) return null ; return accessors [ <NUM_LIT:1> ] ; } public boolean hasTypeBit ( int bit ) { return ( this . typeBits & bit ) != <NUM_LIT:0> ; } public void initializeDeprecatedAnnotationTagBits ( ) { if ( ( this . tagBits & TagBits . DeprecatedAnnotationResolved ) == <NUM_LIT:0> ) { TypeDeclaration typeDecl = this . scope . referenceContext ; boolean old = typeDecl . staticInitializerScope . insideTypeAnnotation ; try { typeDecl . staticInitializerScope . insideTypeAnnotation = true ; ASTNode . resolveDeprecatedAnnotations ( typeDecl . staticInitializerScope , typeDecl . annotations , this ) ; this . tagBits |= TagBits . DeprecatedAnnotationResolved ; } finally { typeDecl . staticInitializerScope . insideTypeAnnotation = old ; } if ( ( this . tagBits & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) { this . modifiers |= ClassFileConstants . AccDeprecated ; } } } void initializeForStaticImports ( ) { if ( this . scope == null ) return ; if ( this . superInterfaces == null ) this . scope . connectTypeHierarchy ( ) ; this . scope . buildFields ( ) ; this . scope . buildMethods ( ) ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == 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 . PARAMETERIZED_TYPE : if ( ( otherType . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> && ( ! isMemberType ( ) || ! otherType . isMemberType ( ) ) ) return false ; ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( this != otherParamType . genericType ( ) ) return false ; if ( ! isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } int length = this . typeVariables == null ? <NUM_LIT:0> : this . typeVariables . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; int otherLength = otherArguments == null ? <NUM_LIT:0> : otherArguments . length ; if ( otherLength != length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! this . typeVariables [ i ] . isTypeArgumentContainedBy ( otherArguments [ i ] ) ) return false ; return true ; case Binding . RAW_TYPE : return otherType . erasure ( ) == this ; } return false ; } public boolean isGenericType ( ) { return this . typeVariables != Binding . NO_TYPE_VARIABLES ; } public boolean isHierarchyConnected ( ) { return ( this . tagBits & TagBits . EndHierarchyCheck ) != <NUM_LIT:0> ; } public ReferenceBinding [ ] memberTypes ( ) { return this . memberTypes ; } public boolean hasMemberTypes ( ) { return this . memberTypes . length > <NUM_LIT:0> ; } public MethodBinding [ ] methods ( ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return this . methods ; if ( ! areMethodsInitialized ( ) ) { this . scope . buildMethods ( ) ; } if ( ( this . tagBits & TagBits . AreMethodsSorted ) == <NUM_LIT:0> ) { int length = this . methods . length ; if ( length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( this . methods , <NUM_LIT:0> , length ) ; this . tagBits |= TagBits . AreMethodsSorted ; } int failed = <NUM_LIT:0> ; MethodBinding [ ] resolvedMethods = this . methods ; try { for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { return this . methods ; } if ( resolveTypesFor ( this . methods [ i ] ) == null ) { if ( resolvedMethods == this . methods ) { System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; } resolvedMethods [ i ] = null ; failed ++ ; } } boolean complyTo15OrAbove = this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; boolean compliance16 = this . scope . compilerOptions ( ) . complianceLevel == ClassFileConstants . JDK1_6 ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) { int severity = ProblemSeverities . Error ; MethodBinding method = resolvedMethods [ i ] ; if ( method == null ) continue ; char [ ] selector = method . selector ; AbstractMethodDeclaration methodDecl = null ; nextSibling : for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { MethodBinding method2 = resolvedMethods [ j ] ; if ( method2 == null ) continue nextSibling ; if ( ! CharOperation . equals ( selector , method2 . selector ) ) break nextSibling ; if ( complyTo15OrAbove ) { if ( method . areParameterErasuresEqual ( method2 ) ) { if ( compliance16 && method . returnType != null && method2 . returnType != null ) { if ( method . returnType . erasure ( ) != method2 . returnType . erasure ( ) ) { TypeBinding [ ] params1 = method . parameters ; TypeBinding [ ] params2 = method2 . parameters ; int pLength = params1 . length ; TypeVariableBinding [ ] vars = method . typeVariables ; TypeVariableBinding [ ] vars2 = method2 . typeVariables ; boolean equalTypeVars = vars == vars2 ; MethodBinding subMethod = method2 ; if ( ! equalTypeVars ) { MethodBinding temp = method . computeSubstitutedMethod ( method2 , this . scope . environment ( ) ) ; if ( temp != null ) { equalTypeVars = true ; subMethod = temp ; } } boolean equalParams = method . areParametersEqual ( subMethod ) ; if ( equalParams && equalTypeVars ) { } else if ( vars != Binding . NO_TYPE_VARIABLES && vars2 != Binding . NO_TYPE_VARIABLES ) { severity = ProblemSeverities . Warning ; } else if ( pLength > <NUM_LIT:0> ) { int index = pLength ; for ( ; -- index >= <NUM_LIT:0> ; ) { if ( params1 [ index ] != params2 [ index ] . erasure ( ) ) { if ( params1 [ index ] instanceof RawTypeBinding ) { if ( params2 [ index ] . erasure ( ) != ( ( RawTypeBinding ) params1 [ index ] ) . actualType ( ) ) { break ; } } else { break ; } } if ( params1 [ index ] == params2 [ index ] ) { TypeBinding type = params1 [ index ] . leafComponentType ( ) ; if ( type instanceof SourceTypeBinding && type . typeVariables ( ) != Binding . NO_TYPE_VARIABLES ) { index = pLength ; break ; } } } if ( index >= <NUM_LIT:0> && index < pLength ) { for ( index = pLength ; -- index >= <NUM_LIT:0> ; ) if ( params1 [ index ] . erasure ( ) != params2 [ index ] ) { if ( params2 [ index ] instanceof RawTypeBinding ) { if ( params1 [ index ] . erasure ( ) != ( ( RawTypeBinding ) params2 [ index ] ) . actualType ( ) ) { break ; } } else { break ; } } } if ( index >= <NUM_LIT:0> ) { severity = ProblemSeverities . Warning ; } } else if ( pLength != <NUM_LIT:0> ) { severity = ProblemSeverities . Warning ; } } } } else { continue nextSibling ; } } else if ( ! method . areParametersEqual ( method2 ) ) { continue nextSibling ; } boolean isEnumSpecialMethod = isEnum ( ) && ( CharOperation . equals ( selector , TypeConstants . VALUEOF ) || CharOperation . equals ( selector , TypeConstants . VALUES ) ) ; boolean removeMethod2 = ( severity == ProblemSeverities . Error ) ? true : false ; if ( methodDecl == null ) { methodDecl = method . sourceMethod ( ) ; if ( methodDecl != null && methodDecl . binding != null ) { boolean removeMethod = method . returnType == null && method2 . returnType != null ; if ( isEnumSpecialMethod ) { this . scope . problemReporter ( ) . duplicateEnumSpecialMethod ( this , methodDecl ) ; removeMethod = true ; } else { this . scope . problemReporter ( ) . duplicateMethodInType ( this , methodDecl , method . areParametersEqual ( method2 ) , severity ) ; } if ( removeMethod ) { removeMethod2 = false ; methodDecl . binding = null ; if ( resolvedMethods == this . methods ) System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; resolvedMethods [ i ] = null ; failed ++ ; } } } AbstractMethodDeclaration method2Decl = method2 . sourceMethod ( ) ; if ( method2Decl != null && method2Decl . binding != null ) { if ( isEnumSpecialMethod ) { this . scope . problemReporter ( ) . duplicateEnumSpecialMethod ( this , method2Decl ) ; removeMethod2 = true ; } else { this . scope . problemReporter ( ) . duplicateMethodInType ( this , method2Decl , method . areParametersEqual ( method2 ) , severity ) ; } if ( removeMethod2 ) { method2Decl . binding = null ; if ( resolvedMethods == this . methods ) System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; resolvedMethods [ j ] = null ; failed ++ ; } } } if ( method . returnType == null && resolvedMethods [ i ] != null ) { methodDecl = method . sourceMethod ( ) ; if ( methodDecl != null ) methodDecl . binding = null ; if ( resolvedMethods == this . methods ) System . arraycopy ( this . methods , <NUM_LIT:0> , resolvedMethods = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; resolvedMethods [ i ] = null ; failed ++ ; } } } finally { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { return this . methods ; } if ( failed > <NUM_LIT:0> ) { int newSize = resolvedMethods . length - failed ; if ( newSize == <NUM_LIT:0> ) { this . methods = Binding . NO_METHODS ; } else { MethodBinding [ ] newMethods = new MethodBinding [ newSize ] ; for ( int i = <NUM_LIT:0> , j = <NUM_LIT:0> , length = resolvedMethods . length ; i < length ; i ++ ) if ( resolvedMethods [ i ] != null ) newMethods [ j ++ ] = resolvedMethods [ i ] ; this . methods = newMethods ; } } addDefaultAbstractMethods ( ) ; this . tagBits |= TagBits . AreMethodsComplete ; } return this . methods ; } public FieldBinding resolveTypeFor ( FieldBinding field ) { if ( ( field . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return field ; if ( this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( ( field . getAnnotationTagBits ( ) & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) field . modifiers |= ClassFileConstants . AccDeprecated ; } if ( isViewedAsDeprecated ( ) && ! field . isDeprecated ( ) ) field . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; if ( hasRestrictedAccess ( ) ) field . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; FieldDeclaration [ ] fieldDecls = this . scope . referenceContext . fields ; int length = fieldDecls == null ? <NUM_LIT:0> : fieldDecls . length ; for ( int f = <NUM_LIT:0> ; f < length ; f ++ ) { if ( fieldDecls [ f ] . binding != field ) continue ; MethodScope initializationScope = field . isStatic ( ) ? this . scope . referenceContext . staticInitializerScope : this . scope . referenceContext . initializerScope ; FieldBinding previousField = initializationScope . initializedField ; try { initializationScope . initializedField = field ; FieldDeclaration fieldDecl = fieldDecls [ f ] ; TypeBinding fieldType = fieldDecl . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ? initializationScope . environment ( ) . convertToRawType ( this , false ) : fieldDecl . type . resolveType ( initializationScope , true ) ; field . type = fieldType ; field . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; if ( fieldType == null ) { fieldDecl . binding = null ; return null ; } if ( fieldType == TypeBinding . VOID ) { this . scope . problemReporter ( ) . variableTypeCannotBeVoid ( fieldDecl ) ; fieldDecl . binding = null ; return null ; } if ( fieldType . isArrayType ( ) && ( ( ArrayBinding ) fieldType ) . leafComponentType == TypeBinding . VOID ) { this . scope . problemReporter ( ) . variableTypeCannotBeVoidArray ( fieldDecl ) ; fieldDecl . binding = null ; return null ; } if ( ( fieldType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { field . tagBits |= TagBits . HasMissingType ; } TypeBinding leafType = fieldType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding && ( ( ( ReferenceBinding ) leafType ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { field . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } } finally { initializationScope . initializedField = previousField ; } return field ; } return null ; } public MethodBinding resolveTypesFor ( MethodBinding method ) { if ( ( method . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return method ; if ( this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( ( method . getAnnotationTagBits ( ) & TagBits . AnnotationDeprecated ) != <NUM_LIT:0> ) method . modifiers |= ClassFileConstants . AccDeprecated ; } if ( isViewedAsDeprecated ( ) && ! method . isDeprecated ( ) ) method . modifiers |= ExtraCompilerModifiers . AccDeprecatedImplicitly ; if ( hasRestrictedAccess ( ) ) method . modifiers |= ExtraCompilerModifiers . AccRestrictedAccess ; AbstractMethodDeclaration methodDecl = method . sourceMethod ( ) ; if ( methodDecl == null ) { if ( method instanceof LazilyResolvedMethodBinding ) { LazilyResolvedMethodBinding lrMethod = ( LazilyResolvedMethodBinding ) method ; TypeBinding ptb = lrMethod . getParameterTypeBinding ( ) ; if ( ptb == null ) { method . parameters = Binding . NO_PARAMETERS ; } else { method . parameters = new TypeBinding [ ] { ptb } ; } method . returnType = lrMethod . getReturnTypeBinding ( ) ; method . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return method ; } return null ; } TypeParameter [ ] typeParameters = methodDecl . typeParameters ( ) ; if ( typeParameters != null ) { methodDecl . scope . connectTypeVariables ( typeParameters , true ) ; for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) typeParameters [ i ] . checkBounds ( methodDecl . scope ) ; } TypeReference [ ] exceptionTypes = methodDecl . thrownExceptions ; if ( exceptionTypes != null ) { int size = exceptionTypes . length ; method . thrownExceptions = new ReferenceBinding [ size ] ; int count = <NUM_LIT:0> ; ReferenceBinding resolvedExceptionType ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { resolvedExceptionType = ( ReferenceBinding ) exceptionTypes [ i ] . resolveType ( methodDecl . scope , true ) ; if ( resolvedExceptionType == null ) continue ; if ( resolvedExceptionType . isBoundParameterizedType ( ) ) { methodDecl . scope . problemReporter ( ) . invalidParameterizedExceptionType ( resolvedExceptionType , exceptionTypes [ i ] ) ; continue ; } if ( resolvedExceptionType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) == null ) { if ( resolvedExceptionType . isValidBinding ( ) ) { methodDecl . scope . problemReporter ( ) . cannotThrowType ( exceptionTypes [ i ] , resolvedExceptionType ) ; continue ; } } if ( ( resolvedExceptionType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } method . modifiers |= ( resolvedExceptionType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) ; method . thrownExceptions [ count ++ ] = resolvedExceptionType ; } if ( count < size ) System . arraycopy ( method . thrownExceptions , <NUM_LIT:0> , method . thrownExceptions = new ReferenceBinding [ count ] , <NUM_LIT:0> , count ) ; } final boolean reportUnavoidableGenericTypeProblems = this . scope . compilerOptions ( ) . reportUnavoidableGenericTypeProblems ; boolean foundArgProblem = false ; Argument [ ] arguments = methodDecl . arguments ; if ( arguments != null ) { int size = arguments . length ; method . parameters = Binding . NO_PARAMETERS ; TypeBinding [ ] newParameters = new TypeBinding [ size ] ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { Argument arg = arguments [ i ] ; if ( arg . annotations != null ) { method . tagBits |= TagBits . HasParameterAnnotations ; } boolean deferRawTypeCheck = ! reportUnavoidableGenericTypeProblems && ! method . isConstructor ( ) && ( arg . type . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ; TypeBinding parameterType ; if ( deferRawTypeCheck ) { arg . type . bits |= ASTNode . IgnoreRawTypeCheck ; } try { parameterType = arg . type . resolveType ( methodDecl . scope , true ) ; } finally { if ( deferRawTypeCheck ) { arg . type . bits &= ~ ASTNode . IgnoreRawTypeCheck ; } } if ( parameterType == null ) { foundArgProblem = true ; } else if ( parameterType == TypeBinding . VOID ) { methodDecl . scope . problemReporter ( ) . argumentTypeCannotBeVoid ( this , methodDecl , arg ) ; foundArgProblem = true ; } else { if ( ( parameterType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } TypeBinding leafType = parameterType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding && ( ( ( ReferenceBinding ) leafType ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) method . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; newParameters [ i ] = parameterType ; arg . binding = new LocalVariableBinding ( arg , parameterType , arg . modifiers , true ) ; } } if ( ! foundArgProblem ) { method . parameters = newParameters ; } } if ( this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_7 ) { if ( ( method . tagBits & TagBits . AnnotationSafeVarargs ) != <NUM_LIT:0> ) { if ( ! method . isVarargs ( ) ) { methodDecl . scope . problemReporter ( ) . safeVarargsOnFixedArityMethod ( method ) ; } else if ( ! method . isStatic ( ) && ! method . isFinal ( ) && ! method . isConstructor ( ) ) { methodDecl . scope . problemReporter ( ) . safeVarargsOnNonFinalInstanceMethod ( method ) ; } } else if ( method . parameters != null && method . parameters . length > <NUM_LIT:0> && method . isVarargs ( ) ) { if ( ! method . parameters [ method . parameters . length - <NUM_LIT:1> ] . isReifiable ( ) ) { methodDecl . scope . problemReporter ( ) . possibleHeapPollutionFromVararg ( methodDecl . arguments [ methodDecl . arguments . length - <NUM_LIT:1> ] ) ; } } } boolean foundReturnTypeProblem = false ; if ( ! method . isConstructor ( ) ) { TypeReference returnType = methodDecl instanceof MethodDeclaration ? ( ( MethodDeclaration ) methodDecl ) . returnType : null ; if ( returnType == null ) { methodDecl . scope . problemReporter ( ) . missingReturnType ( methodDecl ) ; method . returnType = null ; foundReturnTypeProblem = true ; } else { boolean deferRawTypeCheck = ! reportUnavoidableGenericTypeProblems && ( returnType . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> ; TypeBinding methodType ; if ( deferRawTypeCheck ) { returnType . bits |= ASTNode . IgnoreRawTypeCheck ; } try { methodType = returnType . resolveType ( methodDecl . scope , true ) ; } finally { if ( deferRawTypeCheck ) { returnType . bits &= ~ ASTNode . IgnoreRawTypeCheck ; } } if ( methodType == null ) { foundReturnTypeProblem = true ; } else if ( methodType . isArrayType ( ) && ( ( ArrayBinding ) methodType ) . leafComponentType == TypeBinding . VOID ) { methodDecl . scope . problemReporter ( ) . returnTypeCannotBeVoidArray ( ( MethodDeclaration ) methodDecl ) ; foundReturnTypeProblem = true ; } else { if ( ( methodType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { method . tagBits |= TagBits . HasMissingType ; } method . returnType = methodType ; TypeBinding leafType = methodType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding && ( ( ( ReferenceBinding ) leafType ) . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) method . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } } } if ( foundArgProblem ) { methodDecl . binding = null ; method . parameters = Binding . NO_PARAMETERS ; if ( typeParameters != null ) for ( int i = <NUM_LIT:0> , length = typeParameters . length ; i < length ; i ++ ) typeParameters [ i ] . binding = null ; return null ; } if ( this . scope . compilerOptions ( ) . isAnnotationBasedNullAnalysisEnabled ) createArgumentBindings ( method ) ; if ( foundReturnTypeProblem ) return method ; method . modifiers &= ~ ExtraCompilerModifiers . AccUnresolved ; return method ; } private void createArgumentBindings ( MethodBinding method ) { switch ( this . nullnessDefaultInitialized ) { case <NUM_LIT:0> : getAnnotationTagBits ( ) ; case <NUM_LIT:1> : getPackage ( ) . isViewedAsDeprecated ( ) ; this . nullnessDefaultInitialized = <NUM_LIT:2> ; } AbstractMethodDeclaration methodDecl = method . sourceMethod ( ) ; if ( methodDecl != null ) { if ( method . parameters != Binding . NO_PARAMETERS ) methodDecl . createArgumentBindings ( ) ; if ( ( findNonNullDefault ( methodDecl . scope , methodDecl . scope . environment ( ) ) == NONNULL_BY_DEFAULT ) ) { method . fillInDefaultNonNullness ( ) ; } } } private void evaluateNullAnnotations ( long annotationTagBits ) { if ( this . nullnessDefaultInitialized > <NUM_LIT:0> || ! this . scope . compilerOptions ( ) . isAnnotationBasedNullAnalysisEnabled ) return ; boolean isPackageInfo = CharOperation . equals ( this . sourceName , TypeConstants . PACKAGE_INFO_NAME ) ; PackageBinding pkg = getPackage ( ) ; boolean isInDefaultPkg = ( pkg . compoundName == CharOperation . NO_CHAR_CHAR ) ; if ( ! isPackageInfo ) { boolean isInNullnessAnnotationPackage = pkg == this . scope . environment ( ) . nonnullAnnotationPackage || pkg == this . scope . environment ( ) . nullableAnnotationPackage || pkg == this . scope . environment ( ) . nonnullByDefaultAnnotationPackage ; if ( pkg . defaultNullness == NO_NULL_DEFAULT && ! isInDefaultPkg && ! isInNullnessAnnotationPackage && ! ( this instanceof NestedTypeBinding ) ) { ReferenceBinding packageInfo = pkg . getType ( TypeConstants . PACKAGE_INFO_NAME ) ; if ( packageInfo == null ) { this . scope . problemReporter ( ) . missingNonNullByDefaultAnnotation ( this . scope . referenceContext ) ; pkg . defaultNullness = NULL_UNSPECIFIED_BY_DEFAULT ; } else { packageInfo . getAnnotationTagBits ( ) ; } } } this . nullnessDefaultInitialized = <NUM_LIT:1> ; int newDefaultNullness = NO_NULL_DEFAULT ; if ( ( annotationTagBits & TagBits . AnnotationNullUnspecifiedByDefault ) != <NUM_LIT:0> ) newDefaultNullness = NULL_UNSPECIFIED_BY_DEFAULT ; else if ( ( annotationTagBits & TagBits . AnnotationNonNullByDefault ) != <NUM_LIT:0> ) newDefaultNullness = NONNULL_BY_DEFAULT ; if ( newDefaultNullness != NO_NULL_DEFAULT ) { if ( isPackageInfo ) { pkg . defaultNullness = newDefaultNullness ; } else { this . defaultNullness = newDefaultNullness ; TypeDeclaration typeDecl = this . scope . referenceContext ; long nullDefaultBits = annotationTagBits & ( TagBits . AnnotationNullUnspecifiedByDefault | TagBits . AnnotationNonNullByDefault ) ; checkRedundantNullnessDefaultRecurse ( typeDecl , typeDecl . annotations , nullDefaultBits ) ; } } else if ( isPackageInfo || ( isInDefaultPkg && ! ( this instanceof NestedTypeBinding ) ) ) { this . scope . problemReporter ( ) . missingNonNullByDefaultAnnotation ( this . scope . referenceContext ) ; if ( ! isInDefaultPkg ) pkg . defaultNullness = NULL_UNSPECIFIED_BY_DEFAULT ; } } protected void checkRedundantNullnessDefaultRecurse ( ASTNode location , Annotation [ ] annotations , long annotationTagBits ) { if ( this . fPackage . defaultNullness != NO_NULL_DEFAULT ) { if ( ( this . fPackage . defaultNullness == NONNULL_BY_DEFAULT && ( ( annotationTagBits & TagBits . AnnotationNonNullByDefault ) != <NUM_LIT:0> ) ) ) { this . scope . problemReporter ( ) . nullDefaultAnnotationIsRedundant ( location , annotations , this . fPackage ) ; } return ; } } protected boolean checkRedundantNullnessDefaultOne ( ASTNode location , Annotation [ ] annotations , long annotationTagBits ) { int thisDefault = this . defaultNullness ; if ( thisDefault == NONNULL_BY_DEFAULT ) { if ( ( annotationTagBits & TagBits . AnnotationNonNullByDefault ) != <NUM_LIT:0> ) { this . scope . problemReporter ( ) . nullDefaultAnnotationIsRedundant ( location , annotations , this ) ; } return false ; } return true ; } private int findNonNullDefault ( Scope currentScope , LookupEnvironment environment ) { SourceTypeBinding currentType = null ; while ( currentScope != null ) { switch ( currentScope . kind ) { case Scope . METHOD_SCOPE : AbstractMethodDeclaration referenceMethod = ( ( MethodScope ) currentScope ) . referenceMethod ( ) ; if ( referenceMethod != null && referenceMethod . binding != null ) { long methodTagBits = referenceMethod . binding . tagBits ; if ( ( methodTagBits & TagBits . AnnotationNonNullByDefault ) != <NUM_LIT:0> ) return NONNULL_BY_DEFAULT ; if ( ( methodTagBits & TagBits . AnnotationNullUnspecifiedByDefault ) != <NUM_LIT:0> ) return NULL_UNSPECIFIED_BY_DEFAULT ; } break ; case Scope . CLASS_SCOPE : currentType = ( ( ClassScope ) currentScope ) . referenceContext . binding ; if ( currentType != null ) { int foundDefaultNullness = currentType . defaultNullness ; if ( foundDefaultNullness != NO_NULL_DEFAULT ) { return foundDefaultNullness ; } } break ; } currentScope = currentScope . parent ; } if ( currentType != null ) { int foundDefaultNullness = currentType . getPackage ( ) . defaultNullness ; if ( foundDefaultNullness != NO_NULL_DEFAULT ) { return foundDefaultNullness ; } } return NO_NULL_DEFAULT ; } public AnnotationHolder retrieveAnnotationHolder ( Binding binding , boolean forceInitialization ) { if ( forceInitialization ) binding . getAnnotationTagBits ( ) ; return super . retrieveAnnotationHolder ( binding , false ) ; } public void setFields ( FieldBinding [ ] fields ) { this . fields = fields ; } public void setMethods ( MethodBinding [ ] methods ) { this . methods = methods ; } public final int sourceEnd ( ) { return this . scope . referenceContext . sourceEnd ; } public final int sourceStart ( ) { return this . scope . referenceContext . sourceStart ; } SimpleLookupTable storedAnnotations ( boolean forceInitialize ) { if ( forceInitialize && this . storedAnnotations == null && this . scope != null ) { this . scope . referenceCompilationUnit ( ) . compilationResult . hasAnnotations = true ; if ( ! this . scope . environment ( ) . globalOptions . storeAnnotations ) return null ; this . storedAnnotations = new SimpleLookupTable ( <NUM_LIT:3> ) ; } return this . storedAnnotations ; } public ReferenceBinding superclass ( ) { return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { return this . superInterfaces ; } public SyntheticMethodBinding [ ] syntheticMethods ( ) { if ( this . synthetics == null || this . synthetics [ SourceTypeBinding . METHOD_EMUL ] == null || this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . size ( ) == <NUM_LIT:0> ) { return null ; } int index = <NUM_LIT:0> ; SyntheticMethodBinding [ ] bindings = new SyntheticMethodBinding [ <NUM_LIT:1> ] ; Iterator methodArrayIterator = this . synthetics [ SourceTypeBinding . METHOD_EMUL ] . values ( ) . iterator ( ) ; while ( methodArrayIterator . hasNext ( ) ) { SyntheticMethodBinding [ ] methodAccessors = ( SyntheticMethodBinding [ ] ) methodArrayIterator . next ( ) ; for ( int i = <NUM_LIT:0> , max = methodAccessors . length ; i < max ; i ++ ) { if ( methodAccessors [ i ] != null ) { if ( index + <NUM_LIT:1> > bindings . length ) { System . arraycopy ( bindings , <NUM_LIT:0> , ( bindings = new SyntheticMethodBinding [ index + <NUM_LIT:1> ] ) , <NUM_LIT:0> , index ) ; } bindings [ index ++ ] = methodAccessors [ i ] ; } } } int length ; SyntheticMethodBinding [ ] sortedBindings = new SyntheticMethodBinding [ length = bindings . length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { SyntheticMethodBinding binding = bindings [ i ] ; sortedBindings [ binding . index ] = binding ; } return sortedBindings ; } public FieldBinding [ ] syntheticFields ( ) { if ( this . synthetics == null ) return null ; int fieldSize = this . synthetics [ SourceTypeBinding . FIELD_EMUL ] == null ? <NUM_LIT:0> : this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . size ( ) ; int literalSize = this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] == null ? <NUM_LIT:0> : this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . size ( ) ; int totalSize = fieldSize + literalSize ; if ( totalSize == <NUM_LIT:0> ) return null ; FieldBinding [ ] bindings = new FieldBinding [ totalSize ] ; if ( this . synthetics [ SourceTypeBinding . FIELD_EMUL ] != null ) { Iterator elements = this . synthetics [ SourceTypeBinding . FIELD_EMUL ] . values ( ) . iterator ( ) ; for ( int i = <NUM_LIT:0> ; i < fieldSize ; i ++ ) { SyntheticFieldBinding synthBinding = ( SyntheticFieldBinding ) elements . next ( ) ; bindings [ synthBinding . index ] = synthBinding ; } } if ( this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] != null ) { Iterator elements = this . synthetics [ SourceTypeBinding . CLASS_LITERAL_EMUL ] . values ( ) . iterator ( ) ; for ( int i = <NUM_LIT:0> ; i < literalSize ; i ++ ) { SyntheticFieldBinding synthBinding = ( SyntheticFieldBinding ) elements . next ( ) ; bindings [ fieldSize + synthBinding . index ] = synthBinding ; } } return bindings ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:30> ) ; buffer . append ( "<STR_LIT>" ) ; if ( this . id == TypeIds . NoId ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( this . id ) ; buffer . append ( "<STR_LIT>" ) ; if ( isDeprecated ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPublic ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isProtected ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPrivate ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isAbstract ( ) && isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isStatic ( ) && isNestedType ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isFinal ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isEnum ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isAnnotationType ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . compoundName != null ) ? CharOperation . toString ( this . compoundName ) : "<STR_LIT>" ) ; if ( this . typeVariables == null ) { buffer . append ( "<STR_LIT>" ) ; } else if ( this . typeVariables != Binding . NO_TYPE_VARIABLES ) { buffer . append ( "<STR_LIT:<>" ) ; for ( int i = <NUM_LIT:0> , length = this . typeVariables . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; if ( this . typeVariables [ i ] == null ) { buffer . append ( "<STR_LIT>" ) ; continue ; } char [ ] varChars = this . typeVariables [ i ] . toString ( ) . toCharArray ( ) ; buffer . append ( varChars , <NUM_LIT:1> , varChars . length - <NUM_LIT:2> ) ; } buffer . append ( "<STR_LIT:>>" ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . superclass != null ) ? this . superclass . debugName ( ) : "<STR_LIT>" ) ; if ( this . superInterfaces != null ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( ( this . superInterfaces [ i ] != null ) ? this . superInterfaces [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { buffer . append ( "<STR_LIT>" ) ; } if ( enclosingType ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( enclosingType ( ) . debugName ( ) ) ; } if ( this . fields != null ) { if ( this . fields != Binding . NO_FIELDS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . fields [ i ] != null ) ? this . fields [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . methods != null ) { if ( this . methods != Binding . NO_METHODS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . methods [ i ] != null ) ? this . methods [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . memberTypes != null ) { if ( this . memberTypes != Binding . NO_MEMBER_TYPES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . memberTypes . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . memberTypes [ i ] != null ) ? this . memberTypes [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } public TypeVariableBinding [ ] typeVariables ( ) { return this . typeVariables != null ? this . typeVariables : Binding . NO_TYPE_VARIABLES ; } void verifyMethods ( MethodVerifier verifier ) { verifier . verify ( this ) ; for ( int i = this . memberTypes . length ; -- i >= <NUM_LIT:0> ; ) ( ( SourceTypeBinding ) this . memberTypes [ i ] ) . verifyMethods ( verifier ) ; } public FieldBinding [ ] unResolvedFields ( ) { return this . fields ; } public void tagIndirectlyAccessibleMembers ( ) { for ( int i = <NUM_LIT:0> ; i < this . fields . length ; i ++ ) { if ( ! this . fields [ i ] . isPrivate ( ) ) this . fields [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } for ( int i = <NUM_LIT:0> ; i < this . memberTypes . length ; i ++ ) { if ( ! this . memberTypes [ i ] . isPrivate ( ) ) this . memberTypes [ i ] . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( this . superclass . isPrivate ( ) ) if ( this . superclass instanceof SourceTypeBinding ) ( ( SourceTypeBinding ) this . superclass ) . tagIndirectlyAccessibleMembers ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; public class MethodVerifier { SourceTypeBinding type ; HashtableOfObject inheritedMethods ; HashtableOfObject currentMethods ; LookupEnvironment environment ; private boolean allowCompatibleReturnTypes ; MethodVerifier ( LookupEnvironment environment ) { this . type = null ; this . inheritedMethods = null ; this . currentMethods = null ; this . environment = environment ; this . allowCompatibleReturnTypes = environment . globalOptions . complianceLevel >= ClassFileConstants . JDK1_5 && environment . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 ; } boolean areMethodsCompatible ( MethodBinding one , MethodBinding two ) { return isParameterSubsignature ( one , two ) && areReturnTypesCompatible ( one , two ) ; } boolean areParametersEqual ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneArgs = one . parameters ; TypeBinding [ ] twoArgs = two . parameters ; if ( oneArgs == twoArgs ) return true ; int length = oneArgs . length ; if ( length != twoArgs . length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( ! areTypesEqual ( oneArgs [ i ] , twoArgs [ i ] ) ) return false ; return true ; } boolean areReturnTypesCompatible ( MethodBinding one , MethodBinding two ) { if ( one . returnType == two . returnType ) return true ; if ( areTypesEqual ( one . returnType , two . returnType ) ) return true ; if ( this . allowCompatibleReturnTypes && one . declaringClass instanceof BinaryTypeBinding && two . declaringClass instanceof BinaryTypeBinding ) { return areReturnTypesCompatible0 ( one , two ) ; } return false ; } boolean areReturnTypesCompatible0 ( MethodBinding one , MethodBinding two ) { if ( one . returnType . isBaseType ( ) ) return false ; if ( ! one . declaringClass . isInterface ( ) && one . declaringClass . id == TypeIds . T_JavaLangObject ) return two . returnType . isCompatibleWith ( one . returnType ) ; return one . returnType . isCompatibleWith ( two . returnType ) ; } boolean areTypesEqual ( TypeBinding one , TypeBinding two ) { if ( one == two ) return true ; if ( one instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) one ) . resolvedType == two ; if ( two instanceof UnresolvedReferenceBinding ) return ( ( UnresolvedReferenceBinding ) two ) . resolvedType == one ; return false ; } boolean canSkipInheritedMethods ( ) { if ( this . type . superclass ( ) != null && this . type . superclass ( ) . isAbstract ( ) ) return false ; return this . type . superInterfaces ( ) == Binding . NO_SUPERINTERFACES ; } boolean canSkipInheritedMethods ( MethodBinding one , MethodBinding two ) { return two == null || one . declaringClass == two . declaringClass ; } void checkAbstractMethod ( MethodBinding abstractMethod ) { if ( mustImplementAbstractMethod ( abstractMethod . declaringClass ) ) { TypeDeclaration typeDeclaration = this . type . scope . referenceContext ; if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( abstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , abstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , abstractMethod ) ; } } } void checkAgainstInheritedMethods ( MethodBinding currentMethod , MethodBinding [ ] methods , int length , MethodBinding [ ] allInheritedMethods ) { if ( this . type . isAnnotationType ( ) ) { problemReporter ( ) . annotationCannotOverrideMethod ( currentMethod , methods [ length - <NUM_LIT:1> ] ) ; return ; } CompilerOptions options = this . type . scope . compilerOptions ( ) ; int [ ] overriddenInheritedMethods = length > <NUM_LIT:1> ? findOverriddenInheritedMethods ( methods , length ) : null ; nextMethod : for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ i ] ; if ( overriddenInheritedMethods == null || overriddenInheritedMethods [ i ] == <NUM_LIT:0> ) { if ( currentMethod . isStatic ( ) != inheritedMethod . isStatic ( ) ) { problemReporter ( currentMethod ) . staticAndInstanceConflict ( currentMethod , inheritedMethod ) ; continue nextMethod ; } if ( inheritedMethod . isAbstract ( ) ) { if ( inheritedMethod . declaringClass . isInterface ( ) ) { currentMethod . modifiers |= ExtraCompilerModifiers . AccImplementing ; } else { currentMethod . modifiers |= ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ; } } else if ( inheritedMethod . isPublic ( ) || ! this . type . isInterface ( ) ) { currentMethod . modifiers |= ExtraCompilerModifiers . AccOverriding ; } if ( ! areReturnTypesCompatible ( currentMethod , inheritedMethod ) && ( currentMethod . returnType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( reportIncompatibleReturnTypeError ( currentMethod , inheritedMethod ) ) continue nextMethod ; } reportRawReferences ( currentMethod , inheritedMethod ) ; if ( currentMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) checkExceptions ( currentMethod , inheritedMethod ) ; if ( inheritedMethod . isFinal ( ) ) problemReporter ( currentMethod ) . finalMethodCannotBeOverridden ( currentMethod , inheritedMethod ) ; if ( ! isAsVisible ( currentMethod , inheritedMethod ) ) problemReporter ( currentMethod ) . visibilityConflict ( currentMethod , inheritedMethod ) ; if ( inheritedMethod . isSynchronized ( ) && ! currentMethod . isSynchronized ( ) ) { problemReporter ( currentMethod ) . missingSynchronizedOnInheritedMethod ( currentMethod , inheritedMethod ) ; } if ( options . reportDeprecationWhenOverridingDeprecatedMethod && inheritedMethod . isViewedAsDeprecated ( ) ) { if ( ! currentMethod . isViewedAsDeprecated ( ) || options . reportDeprecationInsideDeprecatedCode ) { ReferenceBinding declaringClass = inheritedMethod . declaringClass ; if ( declaringClass . isInterface ( ) ) for ( int j = length ; -- j >= <NUM_LIT:0> ; ) if ( i != j && methods [ j ] . declaringClass . implementsInterface ( declaringClass , false ) ) continue nextMethod ; problemReporter ( currentMethod ) . overridesDeprecatedMethod ( currentMethod , inheritedMethod ) ; } } } checkForBridgeMethod ( currentMethod , inheritedMethod , allInheritedMethods ) ; } } public void reportRawReferences ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { } void checkConcreteInheritedMethod ( MethodBinding concreteMethod , MethodBinding [ ] abstractMethods ) { if ( concreteMethod . isStatic ( ) ) problemReporter ( ) . staticInheritedMethodConflicts ( this . type , concreteMethod , abstractMethods ) ; if ( ! concreteMethod . isPublic ( ) ) { int index = <NUM_LIT:0> , length = abstractMethods . length ; if ( concreteMethod . isProtected ( ) ) { for ( ; index < length ; index ++ ) if ( abstractMethods [ index ] . isPublic ( ) ) break ; } else if ( concreteMethod . isDefault ( ) ) { for ( ; index < length ; index ++ ) if ( ! abstractMethods [ index ] . isDefault ( ) ) break ; } if ( index < length ) problemReporter ( ) . inheritedMethodReducesVisibility ( this . type , concreteMethod , abstractMethods ) ; } if ( concreteMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) for ( int i = abstractMethods . length ; -- i >= <NUM_LIT:0> ; ) checkExceptions ( concreteMethod , abstractMethods [ i ] ) ; if ( concreteMethod . isOrEnclosedByPrivateType ( ) ) concreteMethod . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } void checkExceptions ( MethodBinding newMethod , MethodBinding inheritedMethod ) { ReferenceBinding [ ] newExceptions = resolvedExceptionTypesFor ( newMethod ) ; ReferenceBinding [ ] inheritedExceptions = resolvedExceptionTypesFor ( inheritedMethod ) ; for ( int i = newExceptions . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding newException = newExceptions [ i ] ; int j = inheritedExceptions . length ; while ( -- j > - <NUM_LIT:1> && ! isSameClassOrSubclassOf ( newException , inheritedExceptions [ j ] ) ) { } if ( j == - <NUM_LIT:1> ) if ( ! newException . isUncheckedException ( false ) && ( newException . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { problemReporter ( newMethod ) . incompatibleExceptionInThrowsClause ( this . type , newMethod , inheritedMethod , newException ) ; } } } void checkForBridgeMethod ( MethodBinding currentMethod , MethodBinding inheritedMethod , MethodBinding [ ] allInheritedMethods ) { } void checkForMissingHashCodeMethod ( ) { MethodBinding [ ] choices = this . type . getMethods ( TypeConstants . EQUALS ) ; boolean overridesEquals = false ; for ( int i = choices . length ; ! overridesEquals && -- i >= <NUM_LIT:0> ; ) overridesEquals = choices [ i ] . parameters . length == <NUM_LIT:1> && choices [ i ] . parameters [ <NUM_LIT:0> ] . id == TypeIds . T_JavaLangObject ; if ( overridesEquals ) { MethodBinding hashCodeMethod = this . type . getExactMethod ( TypeConstants . HASHCODE , Binding . NO_PARAMETERS , null ) ; if ( hashCodeMethod != null && hashCodeMethod . declaringClass . id == TypeIds . T_JavaLangObject ) this . problemReporter ( ) . shouldImplementHashcode ( this . type ) ; } } void checkForRedundantSuperinterfaces ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { if ( superInterfaces == Binding . NO_SUPERINTERFACES ) return ; SimpleSet interfacesToCheck = new SimpleSet ( superInterfaces . length ) ; SimpleSet redundantInterfaces = null ; for ( int i = <NUM_LIT:0> , l = superInterfaces . length ; i < l ; i ++ ) { ReferenceBinding toCheck = superInterfaces [ i ] ; for ( int j = <NUM_LIT:0> ; j < l ; j ++ ) { ReferenceBinding implementedInterface = superInterfaces [ j ] ; if ( i != j && toCheck . implementsInterface ( implementedInterface , true ) ) { if ( redundantInterfaces == null ) { redundantInterfaces = new SimpleSet ( <NUM_LIT:3> ) ; } else if ( redundantInterfaces . includes ( implementedInterface ) ) { continue ; } redundantInterfaces . add ( implementedInterface ) ; TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == toCheck ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ j ] , implementedInterface , toCheck ) ; break ; } } } } interfacesToCheck . add ( toCheck ) ; } ReferenceBinding [ ] itsInterfaces = null ; SimpleSet inheritedInterfaces = new SimpleSet ( <NUM_LIT:5> ) ; ReferenceBinding superType = superclass ; while ( superType != null && superType . isValidBinding ( ) ) { if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { for ( int i = <NUM_LIT:0> , l = itsInterfaces . length ; i < l ; i ++ ) { ReferenceBinding inheritedInterface = itsInterfaces [ i ] ; if ( ! inheritedInterfaces . includes ( inheritedInterface ) && inheritedInterface . isValidBinding ( ) ) { if ( interfacesToCheck . includes ( inheritedInterface ) ) { if ( redundantInterfaces == null ) { redundantInterfaces = new SimpleSet ( <NUM_LIT:3> ) ; } else if ( redundantInterfaces . includes ( inheritedInterface ) ) { continue ; } redundantInterfaces . add ( inheritedInterface ) ; TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == inheritedInterface ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ r ] , inheritedInterface , superType ) ; break ; } } } else { inheritedInterfaces . add ( inheritedInterface ) ; } } } } superType = superType . superclass ( ) ; } int nextPosition = inheritedInterfaces . elementSize ; if ( nextPosition == <NUM_LIT:0> ) return ; ReferenceBinding [ ] interfacesToVisit = new ReferenceBinding [ nextPosition ] ; inheritedInterfaces . asArray ( interfacesToVisit ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding inheritedInterface = itsInterfaces [ a ] ; if ( ! inheritedInterfaces . includes ( inheritedInterface ) && inheritedInterface . isValidBinding ( ) ) { if ( interfacesToCheck . includes ( inheritedInterface ) ) { if ( redundantInterfaces == null ) { redundantInterfaces = new SimpleSet ( <NUM_LIT:3> ) ; } else if ( redundantInterfaces . includes ( inheritedInterface ) ) { continue ; } redundantInterfaces . add ( inheritedInterface ) ; TypeReference [ ] refs = this . type . scope . referenceContext . superInterfaces ; for ( int r = <NUM_LIT:0> , rl = refs . length ; r < rl ; r ++ ) { if ( refs [ r ] . resolvedType == inheritedInterface ) { problemReporter ( ) . redundantSuperInterface ( this . type , refs [ r ] , inheritedInterface , superType ) ; break ; } } } else { inheritedInterfaces . add ( inheritedInterface ) ; interfacesToVisit [ nextPosition ++ ] = inheritedInterface ; } } } } } } void checkInheritedMethods ( MethodBinding [ ] methods , int length ) { MethodBinding concreteMethod = this . type . isInterface ( ) || methods [ <NUM_LIT:0> ] . isAbstract ( ) ? null : methods [ <NUM_LIT:0> ] ; if ( concreteMethod == null ) { MethodBinding bestAbstractMethod = length == <NUM_LIT:1> ? methods [ <NUM_LIT:0> ] : findBestInheritedAbstractMethod ( methods , length ) ; boolean noMatch = bestAbstractMethod == null ; if ( noMatch ) bestAbstractMethod = methods [ <NUM_LIT:0> ] ; if ( mustImplementAbstractMethod ( bestAbstractMethod . declaringClass ) ) { TypeDeclaration typeDeclaration = this . type . scope . referenceContext ; MethodBinding superclassAbstractMethod = methods [ <NUM_LIT:0> ] ; if ( superclassAbstractMethod == bestAbstractMethod || superclassAbstractMethod . declaringClass . isInterface ( ) ) { if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( bestAbstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod ) ; } } else { if ( typeDeclaration != null ) { MethodDeclaration missingAbstractMethod = typeDeclaration . addMissingAbstractMethodFor ( bestAbstractMethod ) ; missingAbstractMethod . scope . problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , superclassAbstractMethod ) ; } else { problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , superclassAbstractMethod ) ; } } } else if ( noMatch ) { problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( this . type , methods , length ) ; } return ; } if ( length < <NUM_LIT:2> ) return ; int index = length ; while ( -- index > <NUM_LIT:0> && checkInheritedReturnTypes ( concreteMethod , methods [ index ] ) ) { } if ( index > <NUM_LIT:0> ) { MethodBinding bestAbstractMethod = findBestInheritedAbstractMethod ( methods , length ) ; if ( bestAbstractMethod == null ) problemReporter ( ) . inheritedMethodsHaveIncompatibleReturnTypes ( this . type , methods , length ) ; else problemReporter ( ) . abstractMethodMustBeImplemented ( this . type , bestAbstractMethod , concreteMethod ) ; return ; } MethodBinding [ ] abstractMethods = new MethodBinding [ length - <NUM_LIT:1> ] ; index = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) if ( methods [ i ] . isAbstract ( ) ) abstractMethods [ index ++ ] = methods [ i ] ; if ( index == <NUM_LIT:0> ) return ; if ( index < abstractMethods . length ) System . arraycopy ( abstractMethods , <NUM_LIT:0> , abstractMethods = new MethodBinding [ index ] , <NUM_LIT:0> , index ) ; checkConcreteInheritedMethod ( concreteMethod , abstractMethods ) ; } boolean checkInheritedReturnTypes ( MethodBinding method , MethodBinding otherMethod ) { if ( areReturnTypesCompatible ( method , otherMethod ) ) return true ; if ( ! this . type . isInterface ( ) ) if ( method . declaringClass . isClass ( ) || ! this . type . implementsInterface ( method . declaringClass , false ) ) if ( otherMethod . declaringClass . isClass ( ) || ! this . type . implementsInterface ( otherMethod . declaringClass , false ) ) return true ; return false ; } void checkMethods ( ) { boolean mustImplementAbstractMethods = mustImplementAbstractMethods ( ) ; boolean skipInheritedMethods = mustImplementAbstractMethods && canSkipInheritedMethods ( ) ; boolean isOrEnclosedByPrivateType = this . type . isOrEnclosedByPrivateType ( ) ; char [ ] [ ] methodSelectors = this . inheritedMethods . keyTable ; nextSelector : for ( int s = methodSelectors . length ; -- s >= <NUM_LIT:0> ; ) { if ( methodSelectors [ s ] == null ) continue nextSelector ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( methodSelectors [ s ] ) ; MethodBinding [ ] inherited = ( MethodBinding [ ] ) this . inheritedMethods . valueTable [ s ] ; if ( current == null && ! isOrEnclosedByPrivateType ) { int length = inherited . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { inherited [ i ] . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } if ( current == null && skipInheritedMethods ) continue nextSelector ; if ( inherited . length == <NUM_LIT:1> && current == null ) { if ( mustImplementAbstractMethods && inherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( inherited [ <NUM_LIT:0> ] ) ; continue nextSelector ; } int index = - <NUM_LIT:1> ; MethodBinding [ ] matchingInherited = new MethodBinding [ inherited . length ] ; if ( current != null ) { for ( int i = <NUM_LIT:0> , length1 = current . length ; i < length1 ; i ++ ) { MethodBinding currentMethod = current [ i ] ; for ( int j = <NUM_LIT:0> , length2 = inherited . length ; j < length2 ; j ++ ) { MethodBinding inheritedMethod = computeSubstituteMethod ( inherited [ j ] , currentMethod ) ; if ( inheritedMethod != null ) { if ( isParameterSubsignature ( currentMethod , inheritedMethod ) ) { matchingInherited [ ++ index ] = inheritedMethod ; inherited [ j ] = null ; } } } if ( index >= <NUM_LIT:0> ) { checkAgainstInheritedMethods ( currentMethod , matchingInherited , index + <NUM_LIT:1> , inherited ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } for ( int i = <NUM_LIT:0> , length = inherited . length ; i < length ; i ++ ) { MethodBinding inheritedMethod = inherited [ i ] ; if ( inheritedMethod == null ) continue ; if ( ! isOrEnclosedByPrivateType && current != null ) { inheritedMethod . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } matchingInherited [ ++ index ] = inheritedMethod ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { MethodBinding otherInheritedMethod = inherited [ j ] ; if ( canSkipInheritedMethods ( inheritedMethod , otherInheritedMethod ) ) continue ; otherInheritedMethod = computeSubstituteMethod ( otherInheritedMethod , inheritedMethod ) ; if ( otherInheritedMethod != null ) { if ( isParameterSubsignature ( inheritedMethod , otherInheritedMethod ) ) { matchingInherited [ ++ index ] = otherInheritedMethod ; inherited [ j ] = null ; } } } if ( index == - <NUM_LIT:1> ) continue ; if ( index > <NUM_LIT:0> ) checkInheritedMethods ( matchingInherited , index + <NUM_LIT:1> ) ; else if ( mustImplementAbstractMethods && matchingInherited [ <NUM_LIT:0> ] . isAbstract ( ) ) checkAbstractMethod ( matchingInherited [ <NUM_LIT:0> ] ) ; while ( index >= <NUM_LIT:0> ) matchingInherited [ index -- ] = null ; } } } void checkPackagePrivateAbstractMethod ( MethodBinding abstractMethod ) { PackageBinding necessaryPackage = abstractMethod . declaringClass . fPackage ; if ( necessaryPackage == this . type . fPackage ) return ; ReferenceBinding superType = this . type . superclass ( ) ; char [ ] selector = abstractMethod . selector ; do { if ( ! superType . isValidBinding ( ) ) return ; if ( ! superType . isAbstract ( ) ) return ; if ( necessaryPackage == superType . fPackage ) { MethodBinding [ ] methods = superType . getMethods ( selector ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ m ] ; if ( method . isPrivate ( ) || method . isConstructor ( ) || method . isDefaultAbstract ( ) ) continue nextMethod ; if ( areMethodsCompatible ( method , abstractMethod ) ) return ; } } } while ( ( superType = superType . superclass ( ) ) != abstractMethod . declaringClass ) ; problemReporter ( ) . abstractMethodCannotBeOverridden ( this . type , abstractMethod ) ; } void computeInheritedMethods ( ) { ReferenceBinding superclass = this . type . isInterface ( ) ? this . type . scope . getJavaLangObject ( ) : this . type . superclass ( ) ; computeInheritedMethods ( superclass , this . type . superInterfaces ( ) ) ; checkForRedundantSuperinterfaces ( superclass , this . type . superInterfaces ( ) ) ; } void computeInheritedMethods ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { this . inheritedMethods = new HashtableOfObject ( <NUM_LIT> ) ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding [ ] itsInterfaces = superInterfaces ; if ( itsInterfaces != Binding . NO_SUPERINTERFACES ) { nextPosition = itsInterfaces . length ; interfacesToVisit = itsInterfaces ; } ReferenceBinding superType = superclass ; HashtableOfObject nonVisibleDefaultMethods = new HashtableOfObject ( <NUM_LIT:3> ) ; while ( superType != null && superType . isValidBinding ( ) ) { if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } MethodBinding [ ] methods = superType . unResolvedMethods ( ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ m ] ; if ( inheritedMethod . isPrivate ( ) || inheritedMethod . isConstructor ( ) || inheritedMethod . isDefaultAbstract ( ) ) continue nextMethod ; MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . inheritedMethods . get ( inheritedMethod . selector ) ; if ( existingMethods != null ) { existing : for ( int i = <NUM_LIT:0> , length = existingMethods . length ; i < length ; i ++ ) { MethodBinding existingMethod = existingMethods [ i ] ; if ( existingMethod . declaringClass != inheritedMethod . declaringClass && areMethodsCompatible ( existingMethod , inheritedMethod ) && ! canOverridingMethodDifferInErasure ( existingMethod , inheritedMethod ) ) { if ( inheritedMethod . isDefault ( ) ) { if ( inheritedMethod . isAbstract ( ) ) { checkPackagePrivateAbstractMethod ( inheritedMethod ) ; } else if ( existingMethod . declaringClass . fPackage != inheritedMethod . declaringClass . fPackage ) { if ( this . type . fPackage == inheritedMethod . declaringClass . fPackage && ! areReturnTypesCompatible ( inheritedMethod , existingMethod ) ) continue existing ; } } continue nextMethod ; } } } if ( ! inheritedMethod . isDefault ( ) || inheritedMethod . declaringClass . fPackage == this . type . fPackage ) { if ( existingMethods == null ) { existingMethods = new MethodBinding [ ] { inheritedMethod } ; } else { int length = existingMethods . length ; System . arraycopy ( existingMethods , <NUM_LIT:0> , existingMethods = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; existingMethods [ length ] = inheritedMethod ; } this . inheritedMethods . put ( inheritedMethod . selector , existingMethods ) ; } else { MethodBinding [ ] nonVisible = ( MethodBinding [ ] ) nonVisibleDefaultMethods . get ( inheritedMethod . selector ) ; if ( nonVisible != null ) for ( int i = <NUM_LIT:0> , l = nonVisible . length ; i < l ; i ++ ) if ( areMethodsCompatible ( nonVisible [ i ] , inheritedMethod ) ) continue nextMethod ; if ( nonVisible == null ) { nonVisible = new MethodBinding [ ] { inheritedMethod } ; } else { int length = nonVisible . length ; System . arraycopy ( nonVisible , <NUM_LIT:0> , nonVisible = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; nonVisible [ length ] = inheritedMethod ; } nonVisibleDefaultMethods . put ( inheritedMethod . selector , nonVisible ) ; if ( inheritedMethod . isAbstract ( ) && ! this . type . isAbstract ( ) ) problemReporter ( ) . abstractMethodCannotBeOverridden ( this . type , inheritedMethod ) ; MethodBinding [ ] current = ( MethodBinding [ ] ) this . currentMethods . get ( inheritedMethod . selector ) ; if ( current != null && ! inheritedMethod . isStatic ( ) ) { foundMatch : for ( int i = <NUM_LIT:0> , length = current . length ; i < length ; i ++ ) { if ( ! current [ i ] . isStatic ( ) && areMethodsCompatible ( current [ i ] , inheritedMethod ) ) { problemReporter ( ) . overridesPackageDefaultMethod ( current [ i ] , inheritedMethod ) ; break foundMatch ; } } } } } superType = superType . superclass ( ) ; } if ( nextPosition == <NUM_LIT:0> ) return ; SimpleSet skip = findSuperinterfaceCollisions ( superclass , superInterfaces ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { superType = interfacesToVisit [ i ] ; if ( superType . isValidBinding ( ) ) { if ( skip != null && skip . includes ( superType ) ) continue ; if ( ( itsInterfaces = superType . superInterfaces ( ) ) != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } MethodBinding [ ] methods = superType . unResolvedMethods ( ) ; nextMethod : for ( int m = methods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding inheritedMethod = methods [ m ] ; MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . inheritedMethods . get ( inheritedMethod . selector ) ; if ( existingMethods == null ) { existingMethods = new MethodBinding [ ] { inheritedMethod } ; } else { int length = existingMethods . length ; for ( int e = <NUM_LIT:0> ; e < length ; e ++ ) if ( isInterfaceMethodImplemented ( inheritedMethod , existingMethods [ e ] , superType ) && ! canOverridingMethodDifferInErasure ( existingMethods [ e ] , inheritedMethod ) ) continue nextMethod ; System . arraycopy ( existingMethods , <NUM_LIT:0> , existingMethods = new MethodBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; existingMethods [ length ] = inheritedMethod ; } this . inheritedMethods . put ( inheritedMethod . selector , existingMethods ) ; } } } } protected boolean canOverridingMethodDifferInErasure ( MethodBinding overridingMethod , MethodBinding inheritedMethod ) { return false ; } void computeMethods ( ) { MethodBinding [ ] methods = this . type . methods ( ) ; int size = methods . length ; this . currentMethods = new HashtableOfObject ( size == <NUM_LIT:0> ? <NUM_LIT:1> : size ) ; for ( int m = size ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = methods [ m ] ; if ( ! ( method . isConstructor ( ) || method . isDefaultAbstract ( ) ) ) { MethodBinding [ ] existingMethods = ( MethodBinding [ ] ) this . currentMethods . get ( method . selector ) ; if ( existingMethods == null ) existingMethods = new MethodBinding [ <NUM_LIT:1> ] ; else System . arraycopy ( existingMethods , <NUM_LIT:0> , ( existingMethods = new MethodBinding [ existingMethods . length + <NUM_LIT:1> ] ) , <NUM_LIT:0> , existingMethods . length - <NUM_LIT:1> ) ; existingMethods [ existingMethods . length - <NUM_LIT:1> ] = method ; this . currentMethods . put ( method . selector , existingMethods ) ; } } } MethodBinding computeSubstituteMethod ( MethodBinding inheritedMethod , MethodBinding currentMethod ) { if ( inheritedMethod == null ) return null ; if ( currentMethod . parameters . length != inheritedMethod . parameters . length ) return null ; return inheritedMethod ; } boolean couldMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) ) return false ; if ( method == inheritedMethod || method . isStatic ( ) || inheritedMethod . isStatic ( ) ) return false ; if ( inheritedMethod . isPrivate ( ) ) return false ; if ( inheritedMethod . isDefault ( ) && method . declaringClass . getPackage ( ) != inheritedMethod . declaringClass . getPackage ( ) ) return false ; if ( ! method . isPublic ( ) ) { if ( inheritedMethod . isPublic ( ) ) return false ; if ( inheritedMethod . isProtected ( ) && ! method . isProtected ( ) ) return false ; } return true ; } public boolean doesMethodOverride ( MethodBinding method , MethodBinding inheritedMethod ) { if ( ! couldMethodOverride ( method , inheritedMethod ) ) return false ; inheritedMethod = inheritedMethod . original ( ) ; TypeBinding match = method . declaringClass . findSuperTypeOriginatingFrom ( inheritedMethod . declaringClass ) ; if ( ! ( match instanceof ReferenceBinding ) ) return false ; return isParameterSubsignature ( method , inheritedMethod ) ; } SimpleSet findSuperinterfaceCollisions ( ReferenceBinding superclass , ReferenceBinding [ ] superInterfaces ) { return null ; } MethodBinding findBestInheritedAbstractMethod ( MethodBinding [ ] methods , int length ) { findMethod : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { MethodBinding method = methods [ i ] ; if ( ! method . isAbstract ( ) ) continue findMethod ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; if ( ! checkInheritedReturnTypes ( method , methods [ j ] ) ) { if ( this . type . isInterface ( ) && methods [ j ] . declaringClass . id == TypeIds . T_JavaLangObject ) return method ; continue findMethod ; } } return method ; } return null ; } int [ ] findOverriddenInheritedMethods ( MethodBinding [ ] methods , int length ) { int [ ] toSkip = null ; int i = <NUM_LIT:0> ; ReferenceBinding declaringClass = methods [ i ] . declaringClass ; if ( ! declaringClass . isInterface ( ) ) { ReferenceBinding declaringClass2 = methods [ ++ i ] . declaringClass ; while ( declaringClass == declaringClass2 ) { if ( ++ i == length ) return null ; declaringClass2 = methods [ i ] . declaringClass ; } if ( ! declaringClass2 . isInterface ( ) ) { if ( declaringClass . fPackage != declaringClass2 . fPackage && methods [ i ] . isDefault ( ) ) return null ; toSkip = new int [ length ] ; do { toSkip [ i ] = - <NUM_LIT:1> ; if ( ++ i == length ) return toSkip ; declaringClass2 = methods [ i ] . declaringClass ; } while ( ! declaringClass2 . isInterface ( ) ) ; } } nextMethod : for ( ; i < length ; i ++ ) { if ( toSkip != null && toSkip [ i ] == - <NUM_LIT:1> ) continue nextMethod ; declaringClass = methods [ i ] . declaringClass ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { if ( toSkip != null && toSkip [ j ] == - <NUM_LIT:1> ) continue ; ReferenceBinding declaringClass2 = methods [ j ] . declaringClass ; if ( declaringClass == declaringClass2 ) continue ; if ( declaringClass . implementsInterface ( declaringClass2 , true ) ) { if ( toSkip == null ) toSkip = new int [ length ] ; toSkip [ j ] = - <NUM_LIT:1> ; } else if ( declaringClass2 . implementsInterface ( declaringClass , true ) ) { if ( toSkip == null ) toSkip = new int [ length ] ; toSkip [ i ] = - <NUM_LIT:1> ; continue nextMethod ; } } } return toSkip ; } boolean isAsVisible ( MethodBinding newMethod , MethodBinding inheritedMethod ) { if ( inheritedMethod . modifiers == newMethod . modifiers ) return true ; if ( newMethod . isPublic ( ) ) return true ; if ( inheritedMethod . isPublic ( ) ) return false ; if ( newMethod . isProtected ( ) ) return true ; if ( inheritedMethod . isProtected ( ) ) return false ; return ! newMethod . isPrivate ( ) ; } boolean isInterfaceMethodImplemented ( MethodBinding inheritedMethod , MethodBinding existingMethod , ReferenceBinding superType ) { return areParametersEqual ( existingMethod , inheritedMethod ) && existingMethod . declaringClass . implementsInterface ( superType , true ) ; } public boolean isMethodSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { return org . eclipse . jdt . core . compiler . CharOperation . equals ( method . selector , inheritedMethod . selector ) && isParameterSubsignature ( method , inheritedMethod ) ; } boolean isParameterSubsignature ( MethodBinding method , MethodBinding inheritedMethod ) { return areParametersEqual ( method , inheritedMethod ) ; } boolean isSameClassOrSubclassOf ( ReferenceBinding testClass , ReferenceBinding superclass ) { do { if ( testClass == superclass ) return true ; } while ( ( testClass = testClass . superclass ( ) ) != null ) ; return false ; } boolean mustImplementAbstractMethod ( ReferenceBinding declaringClass ) { if ( ! mustImplementAbstractMethods ( ) ) return false ; ReferenceBinding superclass = this . type . superclass ( ) ; if ( declaringClass . isClass ( ) ) { while ( superclass . isAbstract ( ) && superclass != declaringClass ) superclass = superclass . superclass ( ) ; } else { if ( this . type . implementsInterface ( declaringClass , false ) ) if ( ! superclass . implementsInterface ( declaringClass , true ) ) return true ; while ( superclass . isAbstract ( ) && ! superclass . implementsInterface ( declaringClass , false ) ) superclass = superclass . superclass ( ) ; } return superclass . isAbstract ( ) ; } boolean mustImplementAbstractMethods ( ) { return ! this . type . isInterface ( ) && ! this . type . isAbstract ( ) ; } ProblemReporter problemReporter ( ) { return this . type . scope . problemReporter ( ) ; } ProblemReporter problemReporter ( MethodBinding currentMethod ) { ProblemReporter reporter = problemReporter ( ) ; if ( currentMethod . declaringClass == this . type && currentMethod . sourceMethod ( ) != null ) reporter . referenceContext = currentMethod . sourceMethod ( ) ; return reporter ; } boolean reportIncompatibleReturnTypeError ( MethodBinding currentMethod , MethodBinding inheritedMethod ) { problemReporter ( currentMethod ) . incompatibleReturnType ( currentMethod , inheritedMethod ) ; return true ; } ReferenceBinding [ ] resolvedExceptionTypesFor ( MethodBinding method ) { ReferenceBinding [ ] exceptions = method . thrownExceptions ; if ( ( method . modifiers & ExtraCompilerModifiers . AccUnresolved ) == <NUM_LIT:0> ) return exceptions ; if ( ! ( method . declaringClass instanceof BinaryTypeBinding ) ) return Binding . NO_EXCEPTIONS ; for ( int i = exceptions . length ; -- i >= <NUM_LIT:0> ; ) exceptions [ i ] = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( exceptions [ i ] , this . environment , true ) ; return exceptions ; } void verify ( ) { computeMethods ( ) ; computeInheritedMethods ( ) ; checkMethods ( ) ; if ( this . type . isClass ( ) ) checkForMissingHashCodeMethod ( ) ; } void verify ( SourceTypeBinding someType ) { if ( this . type == null ) { try { this . type = someType ; verify ( ) ; } finally { this . type = null ; } } else { this . environment . newMethodVerifier ( ) . verify ( someType ) ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . type . readableName ( ) ) ; buffer . append ( '<STR_LIT:\n>' ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . inheritedMethods ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class PolymorphicMethodBinding extends MethodBinding { protected MethodBinding polymorphicMethod ; public PolymorphicMethodBinding ( MethodBinding polymorphicMethod , TypeBinding [ ] parameterTypes ) { super ( polymorphicMethod . modifiers , polymorphicMethod . selector , polymorphicMethod . returnType , parameterTypes , polymorphicMethod . thrownExceptions , polymorphicMethod . declaringClass ) ; this . polymorphicMethod = polymorphicMethod ; this . tagBits = polymorphicMethod . tagBits ; } public PolymorphicMethodBinding ( MethodBinding polymorphicMethod , TypeBinding returnType , TypeBinding [ ] parameterTypes ) { super ( polymorphicMethod . modifiers , polymorphicMethod . selector , returnType , parameterTypes , polymorphicMethod . thrownExceptions , polymorphicMethod . declaringClass ) ; this . polymorphicMethod = polymorphicMethod ; this . tagBits = polymorphicMethod . tagBits ; } public MethodBinding original ( ) { return this . polymorphicMethod ; } public boolean isPolymorphic ( ) { return true ; } public boolean matches ( TypeBinding [ ] matchingParameters , TypeBinding matchingReturnType ) { int cachedParametersLength = this . parameters == null ? <NUM_LIT:0> : this . parameters . length ; int matchingParametersLength = matchingParameters == null ? <NUM_LIT:0> : matchingParameters . length ; if ( matchingParametersLength != cachedParametersLength ) { return false ; } for ( int j = <NUM_LIT:0> ; j < cachedParametersLength ; j ++ ) { if ( this . parameters [ j ] != matchingParameters [ j ] ) { return false ; } } TypeBinding cachedReturnType = this . returnType ; if ( matchingReturnType == null ) { if ( cachedReturnType != null ) { return false ; } } else if ( cachedReturnType == null ) { return false ; } else if ( matchingReturnType != cachedReturnType ) { return false ; } return true ; } public boolean isVarargs ( ) { return false ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public abstract class Binding { public static final int FIELD = ASTNode . Bit1 ; public static final int LOCAL = ASTNode . Bit2 ; public static final int VARIABLE = FIELD | LOCAL ; public static final int TYPE = ASTNode . Bit3 ; public static final int METHOD = ASTNode . Bit4 ; public static final int PACKAGE = ASTNode . Bit5 ; public static final int IMPORT = ASTNode . Bit6 ; public static final int ARRAY_TYPE = TYPE | ASTNode . Bit7 ; public static final int BASE_TYPE = TYPE | ASTNode . Bit8 ; public static final int PARAMETERIZED_TYPE = TYPE | ASTNode . Bit9 ; public static final int WILDCARD_TYPE = TYPE | ASTNode . Bit10 ; public static final int RAW_TYPE = TYPE | ASTNode . Bit11 ; public static final int GENERIC_TYPE = TYPE | ASTNode . Bit12 ; public static final int TYPE_PARAMETER = TYPE | ASTNode . Bit13 ; public static final int INTERSECTION_TYPE = TYPE | ASTNode . Bit14 ; public static final TypeBinding [ ] NO_TYPES = new TypeBinding [ <NUM_LIT:0> ] ; public static final TypeBinding [ ] NO_PARAMETERS = new TypeBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_EXCEPTIONS = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] ANY_EXCEPTION = new ReferenceBinding [ ] { null } ; public static final FieldBinding [ ] NO_FIELDS = new FieldBinding [ <NUM_LIT:0> ] ; public static final MethodBinding [ ] NO_METHODS = new MethodBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_SUPERINTERFACES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] NO_MEMBER_TYPES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final TypeVariableBinding [ ] NO_TYPE_VARIABLES = new TypeVariableBinding [ <NUM_LIT:0> ] ; public static final AnnotationBinding [ ] NO_ANNOTATIONS = new AnnotationBinding [ <NUM_LIT:0> ] ; public static final ElementValuePair [ ] NO_ELEMENT_VALUE_PAIRS = new ElementValuePair [ <NUM_LIT:0> ] ; public static final FieldBinding [ ] UNINITIALIZED_FIELDS = new FieldBinding [ <NUM_LIT:0> ] ; public static final MethodBinding [ ] UNINITIALIZED_METHODS = new MethodBinding [ <NUM_LIT:0> ] ; public static final ReferenceBinding [ ] UNINITIALIZED_REFERENCE_TYPES = new ReferenceBinding [ <NUM_LIT:0> ] ; public static final int NO_NULL_DEFAULT = <NUM_LIT:0> ; public static final int NULL_UNSPECIFIED_BY_DEFAULT = <NUM_LIT:1> ; public static final int NONNULL_BY_DEFAULT = <NUM_LIT:2> ; public abstract int kind ( ) ; public char [ ] computeUniqueKey ( ) { return computeUniqueKey ( true ) ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { return null ; } public long getAnnotationTagBits ( ) { return <NUM_LIT:0> ; } public void initializeDeprecatedAnnotationTagBits ( ) { } public final boolean isValidBinding ( ) { return problemId ( ) == ProblemReasons . NoError ; } public boolean isVolatile ( ) { return false ; } public boolean isParameter ( ) { return false ; } public int problemId ( ) { return ProblemReasons . NoError ; } public abstract char [ ] readableName ( ) ; public char [ ] shortReadableName ( ) { return readableName ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class MostSpecificExceptionMethodBinding extends MethodBinding { private MethodBinding originalMethod ; public MostSpecificExceptionMethodBinding ( MethodBinding originalMethod , ReferenceBinding [ ] mostSpecificExceptions ) { super ( originalMethod . modifiers , originalMethod . selector , originalMethod . returnType , originalMethod . parameters , mostSpecificExceptions , originalMethod . declaringClass ) ; this . originalMethod = originalMethod ; this . parameterNonNullness = originalMethod . parameterNonNullness ; } public MethodBinding original ( ) { return this . originalMethod . original ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; public class CatchParameterBinding extends LocalVariableBinding { TypeBinding [ ] preciseTypes = Binding . NO_EXCEPTIONS ; public CatchParameterBinding ( LocalDeclaration declaration , TypeBinding type , int modifiers , boolean isArgument ) { super ( declaration , type , modifiers , isArgument ) ; } public TypeBinding [ ] getPreciseTypes ( ) { return this . preciseTypes ; } public void setPreciseType ( TypeBinding raisedException ) { int length = this . preciseTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; ++ i ) { if ( this . preciseTypes [ i ] == raisedException ) return ; } System . arraycopy ( this . preciseTypes , <NUM_LIT:0> , this . preciseTypes = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; this . preciseTypes [ length ] = raisedException ; return ; } } </s>
<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 ) != <NUM_LIT: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 ) != <NUM_LIT: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 ) == <NUM_LIT:0> ) { this . modifiers &= ~ ExtraCompilerModifiers . AccGenericSignature ; } } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) && enclosingType ( ) . isParameterizedType ( ) ) { char [ ] typeSig = enclosingType ( ) . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT:.>' ) . append ( sourceName ( ) ) . append ( '<CHAR_LIT>' ) . append ( '<CHAR_LIT:>>' ) . append ( '<CHAR_LIT:;>' ) ; } else { sig . append ( genericType ( ) . computeUniqueKey ( false ) ) ; sig . insert ( sig . length ( ) - <NUM_LIT:1> , "<STR_LIT>" ) ; } int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT: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 ( <NUM_LIT:10> ) ; nameBuffer . append ( actualType ( ) . sourceName ( ) ) . append ( "<STR_LIT>" ) ; return nameBuffer . toString ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . genericTypeSignature = genericType ( ) . signature ( ) ; } else { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; char [ ] typeSig = enclosing . genericTypeSignature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; if ( ( enclosing . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { sig . append ( '<CHAR_LIT:.>' ) ; } else { sig . append ( '<CHAR_LIT>' ) ; } sig . append ( sourceName ( ) ) ; } else { char [ ] typeSig = genericType ( ) . signature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } sig . append ( '<CHAR_LIT:;>' ) ; int sigLength = sig . length ( ) ; this . genericTypeSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , this . genericTypeSignature , <NUM_LIT: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 = <NUM_LIT: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 , '<CHAR_LIT:.>' ) ; } else { readableName = CharOperation . concatWith ( actualType ( ) . compoundName , '<CHAR_LIT:.>' ) ; } return readableName ; } public char [ ] shortReadableName ( ) { char [ ] shortReadableName ; if ( isMemberType ( ) ) { shortReadableName = CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ; } else { shortReadableName = actualType ( ) . sourceName ; } return shortReadableName ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class LazilyResolvedMethodBinding extends MethodBinding { private boolean isGetter ; private String propertyName ; public LazilyResolvedMethodBinding ( boolean isGetter , String propertyName , int modifiers , char [ ] selector , ReferenceBinding [ ] thrownExceptions , ReferenceBinding declaringClass ) { super ( modifiers | ExtraCompilerModifiers . AccUnresolved , selector , null , null , thrownExceptions , declaringClass ) ; this . propertyName = propertyName ; this . isGetter = isGetter ; } private TypeBinding getTypeBinding ( ) { FieldBinding fBinding = this . declaringClass . getField ( this . propertyName . toCharArray ( ) , false ) ; if ( fBinding != null && ! ( fBinding . type instanceof MissingTypeBinding ) ) { return fBinding . type ; } return null ; } public TypeBinding getParameterTypeBinding ( ) { if ( this . isGetter ) { return null ; } else { return getTypeBinding ( ) ; } } public TypeBinding getReturnTypeBinding ( ) { if ( this . isGetter ) { return getTypeBinding ( ) ; } else { return TypeBinding . VOID ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class UnresolvedAnnotationBinding extends AnnotationBinding { private LookupEnvironment env ; private boolean typeUnresolved = true ; UnresolvedAnnotationBinding ( ReferenceBinding type , ElementValuePair [ ] pairs , LookupEnvironment env ) { super ( type , pairs ) ; this . env = env ; } public ReferenceBinding getAnnotationType ( ) { if ( this . typeUnresolved ) { this . type = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( this . type , this . env , false ) ; this . typeUnresolved = false ; } return this . type ; } public ElementValuePair [ ] getElementValuePairs ( ) { if ( this . env != null ) { if ( this . typeUnresolved ) { getAnnotationType ( ) ; } for ( int i = this . pairs . length ; -- i >= <NUM_LIT:0> ; ) { ElementValuePair pair = this . pairs [ i ] ; MethodBinding [ ] methods = this . type . getMethods ( pair . getName ( ) ) ; if ( methods != null && methods . length == <NUM_LIT:1> ) { pair . setMethodBinding ( methods [ <NUM_LIT:0> ] ) ; } Object value = pair . getValue ( ) ; if ( value instanceof UnresolvedReferenceBinding ) { pair . setValue ( ( ( UnresolvedReferenceBinding ) value ) . resolve ( this . env , false ) ) ; } } this . env = null ; } return this . pairs ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public class InferenceContext { private TypeBinding [ ] [ ] [ ] collectedSubstitutes ; MethodBinding genericMethod ; int depth ; int status ; TypeBinding expectedType ; boolean hasExplicitExpectedType ; public boolean isUnchecked ; TypeBinding [ ] substitutes ; final static int FAILED = <NUM_LIT:1> ; public InferenceContext ( MethodBinding genericMethod ) { this . genericMethod = genericMethod ; TypeVariableBinding [ ] typeVariables = genericMethod . typeVariables ; int varLength = typeVariables . length ; this . collectedSubstitutes = new TypeBinding [ varLength ] [ <NUM_LIT:3> ] [ ] ; this . substitutes = new TypeBinding [ varLength ] ; } public TypeBinding [ ] getSubstitutes ( TypeVariableBinding typeVariable , int constraint ) { return this . collectedSubstitutes [ typeVariable . rank ] [ constraint ] ; } public boolean hasUnresolvedTypeArgument ( ) { for ( int i = <NUM_LIT:0> , varLength = this . substitutes . length ; i < varLength ; i ++ ) { if ( this . substitutes [ i ] == null ) { return true ; } } return false ; } public void recordSubstitute ( TypeVariableBinding typeVariable , TypeBinding actualType , int constraint ) { TypeBinding [ ] [ ] variableSubstitutes = this . collectedSubstitutes [ typeVariable . rank ] ; insertLoop : { TypeBinding [ ] constraintSubstitutes = variableSubstitutes [ constraint ] ; int length ; if ( constraintSubstitutes == null ) { length = <NUM_LIT:0> ; constraintSubstitutes = new TypeBinding [ <NUM_LIT:1> ] ; } else { length = constraintSubstitutes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding substitute = constraintSubstitutes [ i ] ; if ( substitute == actualType ) return ; if ( substitute == null ) { constraintSubstitutes [ i ] = actualType ; break insertLoop ; } } System . arraycopy ( constraintSubstitutes , <NUM_LIT:0> , constraintSubstitutes = new TypeBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } constraintSubstitutes [ length ] = actualType ; variableSubstitutes [ constraint ] = constraintSubstitutes ; } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:20> ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . genericMethod . typeVariables . length ; i < length ; i ++ ) { buffer . append ( this . genericMethod . typeVariables [ i ] ) ; } buffer . append ( this . genericMethod ) ; buffer . append ( "<STR_LIT>" ) ; switch ( this . status ) { case <NUM_LIT:0> : buffer . append ( "<STR_LIT>" ) ; break ; case FAILED : buffer . append ( "<STR_LIT>" ) ; break ; } if ( this . expectedType == null ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) . append ( this . expectedType . shortReadableName ( ) ) . append ( '<CHAR_LIT:]>' ) ; } buffer . append ( "<STR_LIT>" ) . append ( this . depth ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . collectedSubstitutes == null ? <NUM_LIT:0> : this . collectedSubstitutes . length ; i < length ; i ++ ) { TypeBinding [ ] [ ] collected = this . collectedSubstitutes [ i ] ; for ( int j = TypeConstants . CONSTRAINT_EQUAL ; j <= TypeConstants . CONSTRAINT_SUPER ; j ++ ) { TypeBinding [ ] constraintCollected = collected [ j ] ; if ( constraintCollected != null ) { for ( int k = <NUM_LIT:0> , clength = constraintCollected . length ; k < clength ; k ++ ) { buffer . append ( "<STR_LIT>" ) . append ( this . genericMethod . typeVariables [ i ] . sourceName ) ; switch ( j ) { case TypeConstants . CONSTRAINT_EQUAL : buffer . append ( "<STR_LIT:=>" ) ; break ; case TypeConstants . CONSTRAINT_EXTENDS : buffer . append ( "<STR_LIT>" ) ; break ; case TypeConstants . CONSTRAINT_SUPER : buffer . append ( "<STR_LIT>" ) ; break ; } if ( constraintCollected [ k ] != null ) { buffer . append ( constraintCollected [ k ] . shortReadableName ( ) ) ; } } } } } buffer . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . substitutes == null ? <NUM_LIT:0> : this . substitutes . length ; i < length ; i ++ ) { if ( this . substitutes [ i ] == null ) continue ; count ++ ; buffer . append ( '<CHAR_LIT>' ) . append ( this . genericMethod . typeVariables [ i ] . sourceName ) ; buffer . append ( "<STR_LIT:=>" ) . append ( this . substitutes [ i ] . shortReadableName ( ) ) . append ( '<CHAR_LIT:}>' ) ; } if ( count == <NUM_LIT:0> ) buffer . append ( "<STR_LIT:{}>" ) ; buffer . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; public class ImportBinding extends Binding { public char [ ] [ ] compoundName ; public boolean onDemand ; public ImportReference reference ; public Binding resolvedImport ; public ImportBinding ( char [ ] [ ] compoundName , boolean isOnDemand , Binding binding , ImportReference reference ) { this . compoundName = compoundName ; this . onDemand = isOnDemand ; this . resolvedImport = binding ; this . reference = reference ; } public final int kind ( ) { return IMPORT ; } public boolean isStatic ( ) { return this . reference != null && this . reference . isStatic ( ) ; } public char [ ] readableName ( ) { if ( this . onDemand ) return CharOperation . concat ( CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) , "<STR_LIT>" . toCharArray ( ) ) ; else return CharOperation . concatWith ( this . compoundName , '<CHAR_LIT:.>' ) ; } public String toString ( ) { return "<STR_LIT>" + new String ( readableName ( ) ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; public class ParameterizedTypeBinding extends ReferenceBinding implements Substitution { private ReferenceBinding type ; public TypeBinding [ ] arguments ; public LookupEnvironment environment ; public char [ ] genericTypeSignature ; public ReferenceBinding superclass ; public ReferenceBinding [ ] superInterfaces ; public FieldBinding [ ] fields ; public ReferenceBinding [ ] memberTypes ; public MethodBinding [ ] methods ; private ReferenceBinding enclosingType ; public ParameterizedTypeBinding ( ReferenceBinding type , TypeBinding [ ] arguments , ReferenceBinding enclosingType , LookupEnvironment environment ) { this . environment = environment ; this . enclosingType = enclosingType ; initialize ( type , arguments ) ; if ( type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) type ) . addWrapper ( this , environment ) ; if ( arguments != null ) { for ( int i = <NUM_LIT:0> , l = arguments . length ; i < l ; i ++ ) if ( arguments [ i ] instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) arguments [ i ] ) . addWrapper ( this , environment ) ; } this . tagBits |= TagBits . HasUnresolvedTypeVariables ; } protected ReferenceBinding actualType ( ) { return this . type ; } public void boundCheck ( Scope scope , TypeReference [ ] argumentReferences ) { if ( ( this . tagBits & TagBits . PassedBoundCheck ) == <NUM_LIT:0> ) { boolean hasErrors = false ; TypeVariableBinding [ ] typeVariables = this . type . typeVariables ( ) ; if ( this . arguments != null && typeVariables != null ) { for ( int i = <NUM_LIT:0> , length = typeVariables . length ; i < length ; i ++ ) { if ( typeVariables [ i ] . boundCheck ( this , this . arguments [ i ] ) != TypeConstants . OK ) { hasErrors = true ; if ( ( this . arguments [ i ] . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . typeMismatchError ( this . arguments [ i ] , typeVariables [ i ] , this . type , argumentReferences [ i ] ) ; } } } } if ( ! hasErrors ) this . tagBits |= TagBits . PassedBoundCheck ; } } public boolean canBeInstantiated ( ) { return ( ( this . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) && super . canBeInstantiated ( ) ; } public TypeBinding capture ( Scope scope , int position ) { if ( ( this . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) return this ; TypeBinding [ ] originalArguments = this . arguments ; int length = originalArguments . length ; TypeBinding [ ] capturedArguments = new TypeBinding [ length ] ; ReferenceBinding contextType = scope . enclosingSourceType ( ) ; if ( contextType != null ) contextType = contextType . outermostEnclosingType ( ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = originalArguments [ i ] ; if ( argument . kind ( ) == Binding . WILDCARD_TYPE ) { capturedArguments [ i ] = new CaptureBinding ( ( WildcardBinding ) argument , contextType , position , scope . compilationUnitScope ( ) . nextCaptureID ( ) ) ; } else { capturedArguments [ i ] = argument ; } } ParameterizedTypeBinding capturedParameterizedType = this . environment . createParameterizedType ( this . type , capturedArguments , enclosingType ( ) ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding argument = capturedArguments [ i ] ; if ( argument . isCapture ( ) ) { ( ( CaptureBinding ) argument ) . initializeBounds ( scope , capturedParameterizedType ) ; } } return capturedParameterizedType ; } public List collectMissingTypes ( List missingTypes ) { if ( ( this . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( this . enclosingType != null ) { missingTypes = this . enclosingType . collectMissingTypes ( missingTypes ) ; } missingTypes = genericType ( ) . collectMissingTypes ( missingTypes ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { missingTypes = this . arguments [ i ] . collectMissingTypes ( missingTypes ) ; } } } return missingTypes ; } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { if ( ( this . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) { TypeBinding actualEquivalent = actualType . findSuperTypeOriginatingFrom ( this . type ) ; if ( actualEquivalent != null && actualEquivalent . isRawType ( ) ) { inferenceContext . isUnchecked = true ; } return ; } if ( actualType == TypeBinding . NULL ) return ; if ( ! ( actualType instanceof ReferenceBinding ) ) return ; TypeBinding formalEquivalent , actualEquivalent ; switch ( constraint ) { case TypeConstants . CONSTRAINT_EQUAL : case TypeConstants . CONSTRAINT_EXTENDS : formalEquivalent = this ; actualEquivalent = actualType . findSuperTypeOriginatingFrom ( this . type ) ; if ( actualEquivalent == null ) return ; break ; case TypeConstants . CONSTRAINT_SUPER : default : formalEquivalent = this . findSuperTypeOriginatingFrom ( actualType ) ; if ( formalEquivalent == null ) return ; actualEquivalent = actualType ; break ; } ReferenceBinding formalEnclosingType = formalEquivalent . enclosingType ( ) ; if ( formalEnclosingType != null ) { formalEnclosingType . collectSubstitutes ( scope , actualEquivalent . enclosingType ( ) , inferenceContext , constraint ) ; } if ( this . arguments == null ) return ; TypeBinding [ ] formalArguments ; switch ( formalEquivalent . kind ( ) ) { case Binding . GENERIC_TYPE : formalArguments = formalEquivalent . typeVariables ( ) ; break ; case Binding . PARAMETERIZED_TYPE : formalArguments = ( ( ParameterizedTypeBinding ) formalEquivalent ) . arguments ; break ; case Binding . RAW_TYPE : if ( inferenceContext . depth > <NUM_LIT:0> ) { inferenceContext . status = InferenceContext . FAILED ; } return ; default : return ; } TypeBinding [ ] actualArguments ; switch ( actualEquivalent . kind ( ) ) { case Binding . GENERIC_TYPE : actualArguments = actualEquivalent . typeVariables ( ) ; break ; case Binding . PARAMETERIZED_TYPE : actualArguments = ( ( ParameterizedTypeBinding ) actualEquivalent ) . arguments ; break ; case Binding . RAW_TYPE : if ( inferenceContext . depth > <NUM_LIT:0> ) { inferenceContext . status = InferenceContext . FAILED ; } else { inferenceContext . isUnchecked = true ; } return ; default : return ; } inferenceContext . depth ++ ; for ( int i = <NUM_LIT:0> , length = formalArguments . length ; i < length ; i ++ ) { TypeBinding formalArgument = formalArguments [ i ] ; TypeBinding actualArgument = actualArguments [ i ] ; if ( formalArgument . isWildcard ( ) ) { formalArgument . collectSubstitutes ( scope , actualArgument , inferenceContext , constraint ) ; continue ; } else if ( actualArgument . isWildcard ( ) ) { WildcardBinding actualWildcardArgument = ( WildcardBinding ) actualArgument ; if ( actualWildcardArgument . otherBounds == null ) { if ( constraint == TypeConstants . CONSTRAINT_SUPER ) { switch ( actualWildcardArgument . boundKind ) { case Wildcard . EXTENDS : formalArgument . collectSubstitutes ( scope , actualWildcardArgument . bound , inferenceContext , TypeConstants . CONSTRAINT_SUPER ) ; continue ; case Wildcard . SUPER : formalArgument . collectSubstitutes ( scope , actualWildcardArgument . bound , inferenceContext , TypeConstants . CONSTRAINT_EXTENDS ) ; continue ; default : continue ; } } else { continue ; } } } formalArgument . collectSubstitutes ( scope , actualArgument , inferenceContext , TypeConstants . CONSTRAINT_EQUAL ) ; } inferenceContext . depth -- ; } public void computeId ( ) { this . id = TypeIds . NoId ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; ReferenceBinding enclosing ; if ( isMemberType ( ) && ( ( enclosing = enclosingType ( ) ) . isParameterizedType ( ) || enclosing . isRawType ( ) ) ) { char [ ] typeSig = enclosing . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT:.>' ) . append ( sourceName ( ) ) ; } else if ( this . type . isLocalType ( ) ) { LocalTypeBinding localTypeBinding = ( LocalTypeBinding ) this . type ; enclosing = localTypeBinding . enclosingType ( ) ; ReferenceBinding temp ; while ( ( temp = enclosing . enclosingType ( ) ) != null ) enclosing = temp ; char [ ] typeSig = enclosing . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; sig . append ( '<CHAR_LIT>' ) ; sig . append ( localTypeBinding . sourceStart ) ; } else { char [ ] typeSig = this . type . computeUniqueKey ( false ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } ReferenceBinding captureSourceType = null ; if ( this . arguments != null ) { sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { TypeBinding typeBinding = this . arguments [ i ] ; sig . append ( typeBinding . computeUniqueKey ( false ) ) ; if ( typeBinding instanceof CaptureBinding ) captureSourceType = ( ( CaptureBinding ) typeBinding ) . sourceType ; } sig . append ( '<CHAR_LIT:>>' ) ; } sig . append ( '<CHAR_LIT:;>' ) ; if ( captureSourceType != null && captureSourceType != this . type ) { sig . insert ( <NUM_LIT:0> , "<STR_LIT:&>" ) ; sig . insert ( <NUM_LIT:0> , captureSourceType . computeUniqueKey ( false ) ) ; } int sigLength = sig . length ( ) ; char [ ] uniqueKey = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public char [ ] constantPoolName ( ) { return this . type . constantPoolName ( ) ; } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { return new ParameterizedMethodBinding ( this , originalMethod ) ; } public String debugName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( this . type instanceof UnresolvedReferenceBinding ) { nameBuffer . append ( this . type ) ; } else { nameBuffer . append ( this . type . sourceName ( ) ) ; } if ( this . arguments != null ) { nameBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( this . arguments [ i ] . debugName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; } return nameBuffer . toString ( ) ; } public ReferenceBinding enclosingType ( ) { return this . enclosingType ; } public LookupEnvironment environment ( ) { return this . environment ; } public TypeBinding erasure ( ) { return this . type . erasure ( ) ; } public int fieldCount ( ) { return this . type . fieldCount ( ) ; } public FieldBinding [ ] fields ( ) { if ( ( this . tagBits & TagBits . AreFieldsComplete ) != <NUM_LIT:0> ) return this . fields ; try { FieldBinding [ ] originalFields = this . type . fields ( ) ; int length = originalFields . length ; FieldBinding [ ] parameterizedFields = new FieldBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedFields [ i ] = new ParameterizedFieldBinding ( this , originalFields [ i ] ) ; this . fields = parameterizedFields ; } finally { if ( this . fields == null ) this . fields = Binding . NO_FIELDS ; this . tagBits |= TagBits . AreFieldsComplete ; } return this . fields ; } public ReferenceBinding genericType ( ) { if ( this . type instanceof UnresolvedReferenceBinding ) ( ( UnresolvedReferenceBinding ) this . type ) . resolve ( this . environment , false ) ; return this . type ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { if ( ( this . modifiers & ExtraCompilerModifiers . AccGenericSignature ) == <NUM_LIT:0> ) { this . genericTypeSignature = this . type . signature ( ) ; } else { StringBuffer sig = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; char [ ] typeSig = enclosing . genericTypeSignature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; if ( ( enclosing . modifiers & ExtraCompilerModifiers . AccGenericSignature ) != <NUM_LIT:0> ) { sig . append ( '<CHAR_LIT:.>' ) ; } else { sig . append ( '<CHAR_LIT>' ) ; } sig . append ( sourceName ( ) ) ; } else { char [ ] typeSig = this . type . signature ( ) ; sig . append ( typeSig , <NUM_LIT:0> , typeSig . length - <NUM_LIT:1> ) ; } if ( this . arguments != null ) { sig . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { sig . append ( this . arguments [ i ] . genericTypeSignature ( ) ) ; } sig . append ( '<CHAR_LIT:>>' ) ; } sig . append ( '<CHAR_LIT:;>' ) ; int sigLength = sig . length ( ) ; this . genericTypeSignature = new char [ sigLength ] ; sig . getChars ( <NUM_LIT:0> , sigLength , this . genericTypeSignature , <NUM_LIT:0> ) ; } } return this . genericTypeSignature ; } public long getAnnotationTagBits ( ) { return this . type . getAnnotationTagBits ( ) ; } public int getEnclosingInstancesSlotSize ( ) { return genericType ( ) . getEnclosingInstancesSlotSize ( ) ; } public MethodBinding getExactConstructor ( TypeBinding [ ] argumentTypes ) { int argCount = argumentTypes . length ; MethodBinding match = null ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( TypeConstants . INIT , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } } else { MethodBinding [ ] matchingMethods = getMethods ( TypeConstants . INIT ) ; nextMethod : for ( int m = matchingMethods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = matchingMethods [ m ] ; TypeBinding [ ] toMatch = method . parameters ; if ( toMatch . length == argCount ) { for ( int p = <NUM_LIT:0> ; p < argCount ; p ++ ) if ( toMatch [ p ] != argumentTypes [ p ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } return match ; } public MethodBinding getExactMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , CompilationUnitScope refScope ) { int argCount = argumentTypes . length ; boolean foundNothing = true ; MethodBinding match = null ; if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { nextMethod : for ( int imethod = ( int ) range , end = ( int ) ( range > > <NUM_LIT:32> ) ; imethod <= end ; imethod ++ ) { MethodBinding method = this . methods [ imethod ] ; foundNothing = false ; if ( method . parameters . length == argCount ) { TypeBinding [ ] toMatch = method . parameters ; for ( int iarg = <NUM_LIT:0> ; iarg < argCount ; iarg ++ ) if ( toMatch [ iarg ] != argumentTypes [ iarg ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } } else { MethodBinding [ ] matchingMethods = getMethods ( selector ) ; foundNothing = matchingMethods == Binding . NO_METHODS ; nextMethod : for ( int m = matchingMethods . length ; -- m >= <NUM_LIT:0> ; ) { MethodBinding method = matchingMethods [ m ] ; TypeBinding [ ] toMatch = method . parameters ; if ( toMatch . length == argCount ) { for ( int p = <NUM_LIT:0> ; p < argCount ; p ++ ) if ( toMatch [ p ] != argumentTypes [ p ] ) continue nextMethod ; if ( match != null ) return null ; match = method ; } } } if ( match != null ) { if ( match . hasSubstitutedParameters ( ) ) return null ; return match ; } if ( foundNothing && ( this . arguments == null || this . arguments . length <= <NUM_LIT:1> ) ) { if ( isInterface ( ) ) { if ( superInterfaces ( ) . length == <NUM_LIT:1> ) { if ( refScope != null ) refScope . recordTypeReference ( this . superInterfaces [ <NUM_LIT:0> ] ) ; return this . superInterfaces [ <NUM_LIT:0> ] . getExactMethod ( selector , argumentTypes , refScope ) ; } } else if ( superclass ( ) != null ) { if ( refScope != null ) refScope . recordTypeReference ( this . superclass ) ; return this . superclass . getExactMethod ( selector , argumentTypes , refScope ) ; } } return null ; } public FieldBinding getField ( char [ ] fieldName , boolean needResolve ) { fields ( ) ; return ReferenceBinding . binarySearch ( fieldName , this . fields ) ; } public ReferenceBinding getMemberType ( char [ ] typeName ) { memberTypes ( ) ; int typeLength = typeName . length ; for ( int i = this . memberTypes . length ; -- i >= <NUM_LIT:0> ; ) { ReferenceBinding memberType = this . memberTypes [ i ] ; if ( memberType . sourceName . length == typeLength && CharOperation . equals ( memberType . sourceName , typeName ) ) return memberType ; } return null ; } public MethodBinding [ ] getMethods ( char [ ] selector ) { if ( this . methods != null ) { long range ; if ( ( range = ReferenceBinding . binarySearch ( selector , this . methods ) ) >= <NUM_LIT:0> ) { int start = ( int ) range ; int length = ( int ) ( range > > <NUM_LIT:32> ) - start + <NUM_LIT:1> ; MethodBinding [ ] result ; System . arraycopy ( this . methods , start , result = new MethodBinding [ length ] , <NUM_LIT:0> , length ) ; return result ; } } if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return Binding . NO_METHODS ; MethodBinding [ ] parameterizedMethods = null ; try { MethodBinding [ ] originalMethods = this . type . getMethods ( selector ) ; int length = originalMethods . length ; if ( length == <NUM_LIT:0> ) return Binding . NO_METHODS ; parameterizedMethods = new MethodBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedMethods [ i ] = createParameterizedMethod ( originalMethods [ i ] ) ; if ( this . methods == null ) { MethodBinding [ ] temp = new MethodBinding [ length ] ; System . arraycopy ( parameterizedMethods , <NUM_LIT:0> , temp , <NUM_LIT:0> , length ) ; this . methods = temp ; } else { int total = length + this . methods . length ; MethodBinding [ ] temp = new MethodBinding [ total ] ; System . arraycopy ( parameterizedMethods , <NUM_LIT:0> , temp , <NUM_LIT:0> , length ) ; System . arraycopy ( this . methods , <NUM_LIT:0> , temp , length , this . methods . length ) ; if ( total > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( temp , <NUM_LIT:0> , total ) ; this . methods = temp ; } return parameterizedMethods ; } finally { if ( parameterizedMethods == null ) this . methods = parameterizedMethods = Binding . NO_METHODS ; } } public int getOuterLocalVariablesSlotSize ( ) { return genericType ( ) . getOuterLocalVariablesSlotSize ( ) ; } public boolean hasMemberTypes ( ) { return this . type . hasMemberTypes ( ) ; } public boolean hasTypeBit ( int bit ) { TypeBinding erasure = erasure ( ) ; if ( erasure instanceof ReferenceBinding ) return ( ( ReferenceBinding ) erasure ) . hasTypeBit ( bit ) ; return false ; } public boolean implementsMethod ( MethodBinding method ) { return this . type . implementsMethod ( method ) ; } void initialize ( ReferenceBinding someType , TypeBinding [ ] someArguments ) { this . type = someType ; this . sourceName = someType . sourceName ; this . compoundName = someType . compoundName ; this . fPackage = someType . fPackage ; this . fileName = someType . fileName ; this . modifiers = someType . modifiers & ~ ExtraCompilerModifiers . AccGenericSignature ; if ( someArguments != null ) { this . modifiers |= ExtraCompilerModifiers . AccGenericSignature ; } else if ( this . enclosingType != null ) { this . modifiers |= ( this . enclosingType . modifiers & ExtraCompilerModifiers . AccGenericSignature ) ; this . tagBits |= this . enclosingType . tagBits & ( TagBits . HasTypeVariable | TagBits . HasMissingType ) ; } if ( someArguments != null ) { this . arguments = someArguments ; for ( int i = <NUM_LIT:0> , length = someArguments . length ; i < length ; i ++ ) { TypeBinding someArgument = someArguments [ i ] ; switch ( someArgument . kind ( ) ) { case Binding . WILDCARD_TYPE : this . tagBits |= TagBits . HasDirectWildcard ; if ( ( ( WildcardBinding ) someArgument ) . boundKind != Wildcard . UNBOUND ) { this . tagBits |= TagBits . IsBoundParameterizedType ; } break ; case Binding . INTERSECTION_TYPE : this . tagBits |= TagBits . HasDirectWildcard | TagBits . IsBoundParameterizedType ; break ; default : this . tagBits |= TagBits . IsBoundParameterizedType ; break ; } this . tagBits |= someArgument . tagBits & ( TagBits . HasTypeVariable | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; } } this . tagBits |= someType . tagBits & ( TagBits . IsLocalType | TagBits . IsMemberType | TagBits . IsNestedType | TagBits . HasMissingType | TagBits . ContainsNestedTypeReferences ) ; this . tagBits &= ~ ( TagBits . AreFieldsComplete | TagBits . AreMethodsComplete ) ; } protected void initializeArguments ( ) { } void initializeForStaticImports ( ) { this . type . initializeForStaticImports ( ) ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == 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 . PARAMETERIZED_TYPE : ParameterizedTypeBinding otherParamType = ( ParameterizedTypeBinding ) otherType ; if ( this . type != otherParamType . type ) return false ; if ( ! isStatic ( ) ) { ReferenceBinding enclosing = enclosingType ( ) ; if ( enclosing != null ) { ReferenceBinding otherEnclosing = otherParamType . enclosingType ( ) ; if ( otherEnclosing == null ) return false ; if ( ( otherEnclosing . tagBits & TagBits . HasDirectWildcard ) == <NUM_LIT:0> ) { if ( enclosing != otherEnclosing ) return false ; } else { if ( ! enclosing . isEquivalentTo ( otherParamType . enclosingType ( ) ) ) return false ; } } } if ( this . arguments == null ) { return otherParamType . arguments == null ; } int length = this . arguments . length ; TypeBinding [ ] otherArguments = otherParamType . arguments ; if ( otherArguments == null || otherArguments . length != length ) return false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! this . arguments [ i ] . isTypeArgumentContainedBy ( otherArguments [ i ] ) ) return false ; } return true ; case Binding . RAW_TYPE : return erasure ( ) == otherType . erasure ( ) ; } if ( erasure ( ) == otherType ) { return true ; } return false ; } public boolean isHierarchyConnected ( ) { return this . superclass != null && this . superInterfaces != null ; } public boolean isRawSubstitution ( ) { return isRawType ( ) ; } public int kind ( ) { return PARAMETERIZED_TYPE ; } public ReferenceBinding [ ] memberTypes ( ) { if ( this . memberTypes == null ) { try { ReferenceBinding [ ] originalMemberTypes = this . type . memberTypes ( ) ; int length = originalMemberTypes . length ; ReferenceBinding [ ] parameterizedMemberTypes = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedMemberTypes [ i ] = this . environment . createParameterizedType ( originalMemberTypes [ i ] , null , this ) ; this . memberTypes = parameterizedMemberTypes ; } finally { if ( this . memberTypes == null ) this . memberTypes = Binding . NO_MEMBER_TYPES ; } } return this . memberTypes ; } public MethodBinding [ ] methods ( ) { if ( ( this . tagBits & TagBits . AreMethodsComplete ) != <NUM_LIT:0> ) return this . methods ; try { MethodBinding [ ] originalMethods = this . type . methods ( ) ; int length = originalMethods . length ; MethodBinding [ ] parameterizedMethods = new MethodBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) parameterizedMethods [ i ] = createParameterizedMethod ( originalMethods [ i ] ) ; this . methods = parameterizedMethods ; } finally { if ( this . methods == null ) this . methods = Binding . NO_METHODS ; this . tagBits |= TagBits . AreMethodsComplete ; } return this . methods ; } public int problemId ( ) { return this . type . problemId ( ) ; } public char [ ] qualifiedPackageName ( ) { return this . type . qualifiedPackageName ( ) ; } public char [ ] qualifiedSourceName ( ) { return this . type . qualifiedSourceName ( ) ; } public char [ ] readableName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { nameBuffer . append ( CharOperation . concat ( enclosingType ( ) . readableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ) ; } else { nameBuffer . append ( CharOperation . concatWith ( this . type . compoundName , '<CHAR_LIT:.>' ) ) ; } if ( this . arguments != null ) { nameBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( this . arguments [ i ] . readableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; } int nameLength = nameBuffer . length ( ) ; char [ ] readableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , readableName , <NUM_LIT:0> ) ; return readableName ; } ReferenceBinding resolve ( ) { if ( ( this . tagBits & TagBits . HasUnresolvedTypeVariables ) == <NUM_LIT:0> ) return this ; this . tagBits &= ~ TagBits . HasUnresolvedTypeVariables ; ReferenceBinding resolvedType = ( ReferenceBinding ) BinaryTypeBinding . resolveType ( this . type , this . environment , false ) ; this . tagBits |= resolvedType . tagBits & TagBits . ContainsNestedTypeReferences ; if ( this . arguments != null ) { int argLength = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding resolveType = BinaryTypeBinding . resolveType ( this . arguments [ i ] , this . environment , true ) ; this . arguments [ i ] = resolveType ; this . tagBits |= resolvedType . tagBits & TagBits . ContainsNestedTypeReferences ; } } return this ; } public char [ ] shortReadableName ( ) { StringBuffer nameBuffer = new StringBuffer ( <NUM_LIT:10> ) ; if ( isMemberType ( ) ) { nameBuffer . append ( CharOperation . concat ( enclosingType ( ) . shortReadableName ( ) , this . sourceName , '<CHAR_LIT:.>' ) ) ; } else { nameBuffer . append ( this . type . sourceName ) ; } if ( this . arguments != null ) { nameBuffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . arguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) nameBuffer . append ( '<CHAR_LIT:U+002C>' ) ; nameBuffer . append ( this . arguments [ i ] . shortReadableName ( ) ) ; } nameBuffer . append ( '<CHAR_LIT:>>' ) ; } int nameLength = nameBuffer . length ( ) ; char [ ] shortReadableName = new char [ nameLength ] ; nameBuffer . getChars ( <NUM_LIT:0> , nameLength , shortReadableName , <NUM_LIT:0> ) ; return shortReadableName ; } public char [ ] signature ( ) { if ( this . signature == null ) { this . signature = this . type . signature ( ) ; } return this . signature ; } public char [ ] sourceName ( ) { return this . type . sourceName ( ) ; } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { ParameterizedTypeBinding currentType = this ; while ( true ) { TypeVariableBinding [ ] typeVariables = currentType . type . typeVariables ( ) ; int length = typeVariables . length ; if ( originalVariable . rank < length && typeVariables [ originalVariable . rank ] == originalVariable ) { if ( currentType . arguments == null ) currentType . initializeArguments ( ) ; if ( currentType . arguments != null ) { if ( currentType . arguments . length == <NUM_LIT:0> ) { return originalVariable ; } return currentType . arguments [ originalVariable . rank ] ; } } if ( currentType . isStatic ( ) ) break ; ReferenceBinding enclosing = currentType . enclosingType ( ) ; if ( ! ( enclosing instanceof ParameterizedTypeBinding ) ) break ; currentType = ( ParameterizedTypeBinding ) enclosing ; } return originalVariable ; } public ReferenceBinding superclass ( ) { if ( this . superclass == null ) { ReferenceBinding genericSuperclass = this . type . superclass ( ) ; if ( genericSuperclass == null ) return null ; this . superclass = ( ReferenceBinding ) Scope . substitute ( this , genericSuperclass ) ; } return this . superclass ; } public ReferenceBinding [ ] superInterfaces ( ) { if ( this . superInterfaces == null ) { if ( this . type . isHierarchyBeingConnected ( ) ) return Binding . NO_SUPERINTERFACES ; this . superInterfaces = Scope . substitute ( this , this . type . superInterfaces ( ) ) ; } return this . superInterfaces ; } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment env ) { boolean update = false ; if ( this . type == unresolvedType ) { this . type = resolvedType ; update = true ; ReferenceBinding enclosing = resolvedType . enclosingType ( ) ; if ( enclosing != null ) { this . enclosingType = ( ReferenceBinding ) env . convertUnresolvedBinaryToRawType ( enclosing ) ; } } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , l = this . arguments . length ; i < l ; i ++ ) { if ( this . arguments [ i ] == unresolvedType ) { this . arguments [ i ] = env . convertUnresolvedBinaryToRawType ( resolvedType ) ; update = true ; } } } if ( update ) initialize ( this . type , this . arguments ) ; } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { return genericType ( ) . syntheticEnclosingInstanceTypes ( ) ; } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { return genericType ( ) . syntheticOuterLocalVariables ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:30> ) ; if ( this . type instanceof UnresolvedReferenceBinding ) { buffer . append ( debugName ( ) ) ; } else { if ( isDeprecated ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPublic ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isProtected ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isPrivate ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isAbstract ( ) && isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isStatic ( ) && isNestedType ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isFinal ( ) ) buffer . append ( "<STR_LIT>" ) ; if ( isEnum ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isAnnotationType ( ) ) buffer . append ( "<STR_LIT>" ) ; else if ( isClass ( ) ) buffer . append ( "<STR_LIT>" ) ; else buffer . append ( "<STR_LIT>" ) ; buffer . append ( debugName ( ) ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( ( this . superclass != null ) ? this . superclass . debugName ( ) : "<STR_LIT>" ) ; if ( this . superInterfaces != null ) { if ( this . superInterfaces != Binding . NO_SUPERINTERFACES ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . superInterfaces . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( ( this . superInterfaces [ i ] != null ) ? this . superInterfaces [ i ] . debugName ( ) : "<STR_LIT>" ) ; } } } else { buffer . append ( "<STR_LIT>" ) ; } if ( enclosingType ( ) != null ) { buffer . append ( "<STR_LIT>" ) ; buffer . append ( enclosingType ( ) . debugName ( ) ) ; } if ( this . fields != null ) { if ( this . fields != Binding . NO_FIELDS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . fields . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . fields [ i ] != null ) ? this . fields [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } if ( this . methods != null ) { if ( this . methods != Binding . NO_METHODS ) { buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , length = this . methods . length ; i < length ; i ++ ) buffer . append ( '<STR_LIT:\n>' ) . append ( ( this . methods [ i ] != null ) ? this . methods [ i ] . toString ( ) : "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( "<STR_LIT>" ) ; } return buffer . toString ( ) ; } public TypeVariableBinding [ ] typeVariables ( ) { if ( this . arguments == null ) { return this . type . typeVariables ( ) ; } return Binding . NO_TYPE_VARIABLES ; } public FieldBinding [ ] unResolvedFields ( ) { return this . fields ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; public class CaptureBinding extends TypeVariableBinding { public TypeBinding lowerBound ; public WildcardBinding wildcard ; public int captureID ; public ReferenceBinding sourceType ; public int position ; public CaptureBinding ( WildcardBinding wildcard , ReferenceBinding sourceType , int position , int captureID ) { super ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX , null , <NUM_LIT:0> , wildcard . environment ) ; this . wildcard = wildcard ; this . modifiers = ClassFileConstants . AccPublic | ExtraCompilerModifiers . AccGenericSignature ; this . fPackage = wildcard . fPackage ; this . sourceType = sourceType ; this . position = position ; this . captureID = captureID ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { StringBuffer buffer = new StringBuffer ( ) ; if ( isLeaf ) { buffer . append ( this . sourceType . computeUniqueKey ( false ) ) ; buffer . append ( '<CHAR_LIT>' ) ; } buffer . append ( TypeConstants . WILDCARD_CAPTURE ) ; buffer . append ( this . wildcard . computeUniqueKey ( false ) ) ; buffer . append ( this . position ) ; buffer . append ( '<CHAR_LIT:;>' ) ; int length = buffer . length ( ) ; char [ ] uniqueKey = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , uniqueKey , <NUM_LIT:0> ) ; return uniqueKey ; } public String debugName ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard . debugName ( ) ) ; return buffer . toString ( ) ; } return super . debugName ( ) ; } public char [ ] genericTypeSignature ( ) { if ( this . genericTypeSignature == null ) { this . genericTypeSignature = CharOperation . concat ( TypeConstants . WILDCARD_CAPTURE , this . wildcard . genericTypeSignature ( ) ) ; } return this . genericTypeSignature ; } public void initializeBounds ( Scope scope , ParameterizedTypeBinding capturedParameterizedType ) { TypeVariableBinding wildcardVariable = this . wildcard . typeVariable ( ) ; if ( wildcardVariable == null ) { TypeBinding originalWildcardBound = this . wildcard . bound ; switch ( this . wildcard . boundKind ) { case Wildcard . EXTENDS : TypeBinding capturedWildcardBound = originalWildcardBound . capture ( scope , this . position ) ; if ( originalWildcardBound . isInterface ( ) ) { this . superclass = scope . getJavaLangObject ( ) ; this . superInterfaces = new ReferenceBinding [ ] { ( ReferenceBinding ) capturedWildcardBound } ; } else { if ( capturedWildcardBound . isArrayType ( ) || capturedWildcardBound == this ) { this . superclass = scope . getJavaLangObject ( ) ; } else { this . superclass = ( ReferenceBinding ) capturedWildcardBound ; } this . superInterfaces = Binding . NO_SUPERINTERFACES ; } this . firstBound = capturedWildcardBound ; if ( ( capturedWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . UNBOUND : this . superclass = scope . getJavaLangObject ( ) ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . SUPER : this . superclass = scope . getJavaLangObject ( ) ; this . superInterfaces = Binding . NO_SUPERINTERFACES ; this . lowerBound = this . wildcard . bound ; if ( ( originalWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; } return ; } ReferenceBinding originalVariableSuperclass = wildcardVariable . superclass ; ReferenceBinding substitutedVariableSuperclass = ( ReferenceBinding ) Scope . substitute ( capturedParameterizedType , originalVariableSuperclass ) ; if ( substitutedVariableSuperclass == this ) substitutedVariableSuperclass = originalVariableSuperclass ; ReferenceBinding [ ] originalVariableInterfaces = wildcardVariable . superInterfaces ( ) ; ReferenceBinding [ ] substitutedVariableInterfaces = Scope . substitute ( capturedParameterizedType , originalVariableInterfaces ) ; if ( substitutedVariableInterfaces != originalVariableInterfaces ) { for ( int i = <NUM_LIT:0> , length = substitutedVariableInterfaces . length ; i < length ; i ++ ) { if ( substitutedVariableInterfaces [ i ] == this ) substitutedVariableInterfaces [ i ] = originalVariableInterfaces [ i ] ; } } TypeBinding originalWildcardBound = this . wildcard . bound ; switch ( this . wildcard . boundKind ) { case Wildcard . EXTENDS : TypeBinding capturedWildcardBound = originalWildcardBound . capture ( scope , this . position ) ; if ( originalWildcardBound . isInterface ( ) ) { this . superclass = substitutedVariableSuperclass ; if ( substitutedVariableInterfaces == Binding . NO_SUPERINTERFACES ) { this . superInterfaces = new ReferenceBinding [ ] { ( ReferenceBinding ) capturedWildcardBound } ; } else { int length = substitutedVariableInterfaces . length ; System . arraycopy ( substitutedVariableInterfaces , <NUM_LIT:0> , substitutedVariableInterfaces = new ReferenceBinding [ length + <NUM_LIT:1> ] , <NUM_LIT:1> , length ) ; substitutedVariableInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) capturedWildcardBound ; this . superInterfaces = Scope . greaterLowerBound ( substitutedVariableInterfaces ) ; } } else { if ( capturedWildcardBound . isArrayType ( ) || capturedWildcardBound == this ) { this . superclass = substitutedVariableSuperclass ; } else { this . superclass = ( ReferenceBinding ) capturedWildcardBound ; if ( this . superclass . isSuperclassOf ( substitutedVariableSuperclass ) ) { this . superclass = substitutedVariableSuperclass ; } } this . superInterfaces = substitutedVariableInterfaces ; } this . firstBound = capturedWildcardBound ; if ( ( capturedWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . UNBOUND : this . superclass = substitutedVariableSuperclass ; this . superInterfaces = substitutedVariableInterfaces ; this . tagBits &= ~ TagBits . HasTypeVariable ; break ; case Wildcard . SUPER : this . superclass = substitutedVariableSuperclass ; if ( wildcardVariable . firstBound == substitutedVariableSuperclass || originalWildcardBound == substitutedVariableSuperclass ) { this . firstBound = substitutedVariableSuperclass ; } this . superInterfaces = substitutedVariableInterfaces ; this . lowerBound = originalWildcardBound ; if ( ( originalWildcardBound . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> ) this . tagBits &= ~ TagBits . HasTypeVariable ; break ; } } public boolean isCapture ( ) { return true ; } public boolean isEquivalentTo ( TypeBinding otherType ) { if ( this == otherType ) return true ; if ( otherType == null ) return false ; if ( this . firstBound != null && this . firstBound . isArrayType ( ) ) { if ( this . firstBound . isCompatibleWith ( otherType ) ) return true ; } switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) otherType ) . boundCheck ( this ) ; } return false ; } public char [ ] readableName ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard . readableName ( ) ) ; int length = buffer . length ( ) ; char [ ] name = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , name , <NUM_LIT:0> ) ; return name ; } return super . readableName ( ) ; } public char [ ] shortReadableName ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard . shortReadableName ( ) ) ; int length = buffer . length ( ) ; char [ ] name = new char [ length ] ; buffer . getChars ( <NUM_LIT:0> , length , name , <NUM_LIT:0> ) ; return name ; } return super . shortReadableName ( ) ; } public String toString ( ) { if ( this . wildcard != null ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; buffer . append ( TypeConstants . WILDCARD_CAPTURE_NAME_PREFIX ) . append ( this . captureID ) . append ( TypeConstants . WILDCARD_CAPTURE_NAME_SUFFIX ) . append ( this . wildcard ) ; return buffer . toString ( ) ; } return super . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . util . * ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . ObjectVector ; import org . eclipse . jdt . internal . compiler . util . SimpleLookupTable ; import org . eclipse . jdt . internal . compiler . util . SimpleSet ; public abstract class Scope { public final static int BLOCK_SCOPE = <NUM_LIT:1> ; public final static int CLASS_SCOPE = <NUM_LIT:3> ; public final static int COMPILATION_UNIT_SCOPE = <NUM_LIT:4> ; public final static int METHOD_SCOPE = <NUM_LIT:2> ; public final static int NOT_COMPATIBLE = - <NUM_LIT:1> ; public final static int COMPATIBLE = <NUM_LIT:0> ; public final static int AUTOBOX_COMPATIBLE = <NUM_LIT:1> ; public final static int VARARGS_COMPATIBLE = <NUM_LIT:2> ; public static final int EQUAL_OR_MORE_SPECIFIC = - <NUM_LIT:1> ; public static final int NOT_RELATED = <NUM_LIT:0> ; public static final int MORE_GENERIC = <NUM_LIT:1> ; public int kind ; public Scope parent ; protected Scope ( int kind , Scope parent ) { this . kind = kind ; this . parent = parent ; } public static int compareTypes ( TypeBinding left , TypeBinding right ) { if ( left . isCompatibleWith ( right ) ) return Scope . EQUAL_OR_MORE_SPECIFIC ; if ( right . isCompatibleWith ( left ) ) return Scope . MORE_GENERIC ; return Scope . NOT_RELATED ; } public static TypeBinding convertEliminatingTypeVariables ( TypeBinding originalType , ReferenceBinding genericType , int rank , Set eliminatedVariables ) { if ( ( originalType . tagBits & TagBits . HasTypeVariable ) != <NUM_LIT:0> ) { switch ( originalType . kind ( ) ) { case Binding . ARRAY_TYPE : ArrayBinding originalArrayType = ( ArrayBinding ) originalType ; TypeBinding originalLeafComponentType = originalArrayType . leafComponentType ; TypeBinding substitute = convertEliminatingTypeVariables ( originalLeafComponentType , genericType , rank , eliminatedVariables ) ; if ( substitute != originalLeafComponentType ) { return originalArrayType . environment . createArrayType ( substitute . leafComponentType ( ) , substitute . dimensions ( ) + originalArrayType . dimensions ( ) ) ; } break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = ( ParameterizedTypeBinding ) originalType ; ReferenceBinding originalEnclosing = paramType . enclosingType ( ) ; ReferenceBinding substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) convertEliminatingTypeVariables ( originalEnclosing , genericType , rank , eliminatedVariables ) ; } TypeBinding [ ] originalArguments = paramType . arguments ; TypeBinding [ ] substitutedArguments = originalArguments ; for ( int i = <NUM_LIT:0> , length = originalArguments == null ? <NUM_LIT:0> : originalArguments . length ; i < length ; i ++ ) { TypeBinding originalArgument = originalArguments [ i ] ; TypeBinding substitutedArgument = convertEliminatingTypeVariables ( originalArgument , paramType . genericType ( ) , i , eliminatedVariables ) ; if ( substitutedArgument != originalArgument ) { if ( substitutedArguments == originalArguments ) { System . arraycopy ( originalArguments , <NUM_LIT:0> , substitutedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedArguments [ i ] = substitutedArgument ; } else if ( substitutedArguments != originalArguments ) { substitutedArguments [ i ] = originalArgument ; } } if ( originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments ) { return paramType . environment . createParameterizedType ( paramType . genericType ( ) , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . TYPE_PARAMETER : if ( genericType == null ) { break ; } TypeVariableBinding originalVariable = ( TypeVariableBinding ) originalType ; if ( eliminatedVariables != null && eliminatedVariables . contains ( originalType ) ) { return originalVariable . environment . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; } TypeBinding originalUpperBound = originalVariable . upperBound ( ) ; if ( eliminatedVariables == null ) { eliminatedVariables = new HashSet ( <NUM_LIT:2> ) ; } eliminatedVariables . add ( originalVariable ) ; TypeBinding substitutedUpperBound = convertEliminatingTypeVariables ( originalUpperBound , genericType , rank , eliminatedVariables ) ; eliminatedVariables . remove ( originalVariable ) ; return originalVariable . environment . createWildcard ( genericType , rank , substitutedUpperBound , null , Wildcard . EXTENDS ) ; case Binding . RAW_TYPE : break ; case Binding . GENERIC_TYPE : ReferenceBinding currentType = ( ReferenceBinding ) originalType ; originalEnclosing = currentType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) convertEliminatingTypeVariables ( originalEnclosing , genericType , rank , eliminatedVariables ) ; } originalArguments = currentType . typeVariables ( ) ; substitutedArguments = originalArguments ; for ( int i = <NUM_LIT:0> , length = originalArguments == null ? <NUM_LIT:0> : originalArguments . length ; i < length ; i ++ ) { TypeBinding originalArgument = originalArguments [ i ] ; TypeBinding substitutedArgument = convertEliminatingTypeVariables ( originalArgument , currentType , i , eliminatedVariables ) ; if ( substitutedArgument != originalArgument ) { if ( substitutedArguments == originalArguments ) { System . arraycopy ( originalArguments , <NUM_LIT:0> , substitutedArguments = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedArguments [ i ] = substitutedArgument ; } else if ( substitutedArguments != originalArguments ) { substitutedArguments [ i ] = originalArgument ; } } if ( originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments ) { return ( ( TypeVariableBinding ) originalArguments [ <NUM_LIT:0> ] ) . environment . createParameterizedType ( genericType , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . WILDCARD_TYPE : WildcardBinding wildcard = ( WildcardBinding ) originalType ; TypeBinding originalBound = wildcard . bound ; TypeBinding substitutedBound = originalBound ; if ( originalBound != null ) { substitutedBound = convertEliminatingTypeVariables ( originalBound , genericType , rank , eliminatedVariables ) ; if ( substitutedBound != originalBound ) { return wildcard . environment . createWildcard ( wildcard . genericType , wildcard . rank , substitutedBound , null , wildcard . boundKind ) ; } } break ; case Binding . INTERSECTION_TYPE : WildcardBinding intersection = ( WildcardBinding ) originalType ; originalBound = intersection . bound ; substitutedBound = originalBound ; if ( originalBound != null ) { substitutedBound = convertEliminatingTypeVariables ( originalBound , genericType , rank , eliminatedVariables ) ; } TypeBinding [ ] originalOtherBounds = intersection . otherBounds ; TypeBinding [ ] substitutedOtherBounds = originalOtherBounds ; for ( int i = <NUM_LIT:0> , length = originalOtherBounds == null ? <NUM_LIT:0> : originalOtherBounds . length ; i < length ; i ++ ) { TypeBinding originalOtherBound = originalOtherBounds [ i ] ; TypeBinding substitutedOtherBound = convertEliminatingTypeVariables ( originalOtherBound , genericType , rank , eliminatedVariables ) ; if ( substitutedOtherBound != originalOtherBound ) { if ( substitutedOtherBounds == originalOtherBounds ) { System . arraycopy ( originalOtherBounds , <NUM_LIT:0> , substitutedOtherBounds = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedOtherBounds [ i ] = substitutedOtherBound ; } else if ( substitutedOtherBounds != originalOtherBounds ) { substitutedOtherBounds [ i ] = originalOtherBound ; } } if ( substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds ) { return intersection . environment . createWildcard ( intersection . genericType , intersection . rank , substitutedBound , substitutedOtherBounds , intersection . boundKind ) ; } break ; } } return originalType ; } public static TypeBinding getBaseType ( char [ ] name ) { int length = name . length ; if ( length > <NUM_LIT:2> && length < <NUM_LIT:8> ) { switch ( name [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( length == <NUM_LIT:3> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' ) return TypeBinding . INT ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . VOID ; break ; case '<CHAR_LIT:b>' : if ( length == <NUM_LIT:7> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT:e>' && name [ <NUM_LIT:5> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:6> ] == '<CHAR_LIT>' ) return TypeBinding . BOOLEAN ; if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:e>' ) return TypeBinding . BYTE ; break ; case '<CHAR_LIT:c>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . CHAR ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:6> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:b>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' && name [ <NUM_LIT:5> ] == '<CHAR_LIT:e>' ) return TypeBinding . DOUBLE ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:5> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT:a>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' ) return TypeBinding . FLOAT ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:4> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' ) return TypeBinding . LONG ; break ; case '<CHAR_LIT>' : if ( length == <NUM_LIT:5> && name [ <NUM_LIT:1> ] == '<CHAR_LIT>' && name [ <NUM_LIT:2> ] == '<CHAR_LIT>' && name [ <NUM_LIT:3> ] == '<CHAR_LIT>' && name [ <NUM_LIT:4> ] == '<CHAR_LIT>' ) return TypeBinding . SHORT ; } } return null ; } public static ReferenceBinding [ ] greaterLowerBound ( ReferenceBinding [ ] types ) { if ( types == null ) return null ; int length = types . length ; if ( length == <NUM_LIT:0> ) return null ; ReferenceBinding [ ] result = types ; int removed = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding iType = result [ i ] ; if ( iType == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; ReferenceBinding jType = result [ j ] ; if ( jType == null ) continue ; if ( iType . isCompatibleWith ( jType ) ) { if ( result == types ) { System . arraycopy ( result , <NUM_LIT:0> , result = new ReferenceBinding [ length ] , <NUM_LIT:0> , length ) ; } result [ j ] = null ; removed ++ ; } } } if ( removed == <NUM_LIT:0> ) return result ; if ( length == removed ) return null ; ReferenceBinding [ ] trimmedResult = new ReferenceBinding [ length - removed ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding iType = result [ i ] ; if ( iType != null ) { trimmedResult [ index ++ ] = iType ; } } return trimmedResult ; } public static TypeBinding [ ] greaterLowerBound ( TypeBinding [ ] types ) { if ( types == null ) return null ; int length = types . length ; if ( length == <NUM_LIT:0> ) return null ; TypeBinding [ ] result = types ; int removed = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding iType = result [ i ] ; if ( iType == null ) continue ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { if ( i == j ) continue ; TypeBinding jType = result [ j ] ; if ( jType == null ) continue ; if ( iType . isCompatibleWith ( jType ) ) { if ( result == types ) { System . arraycopy ( result , <NUM_LIT:0> , result = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } result [ j ] = null ; removed ++ ; } } } if ( removed == <NUM_LIT:0> ) return result ; if ( length == removed ) return null ; TypeBinding [ ] trimmedResult = new TypeBinding [ length - removed ] ; for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding iType = result [ i ] ; if ( iType != null ) { trimmedResult [ index ++ ] = iType ; } } return trimmedResult ; } public static ReferenceBinding [ ] substitute ( Substitution substitution , ReferenceBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; ReferenceBinding [ ] substitutedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { ReferenceBinding originalType = originalTypes [ i ] ; TypeBinding substitutedType = substitute ( substitution , originalType ) ; if ( ! ( substitutedType instanceof ReferenceBinding ) ) { return null ; } if ( substitutedType != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , substitutedTypes = new ReferenceBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedTypes [ i ] = ( ReferenceBinding ) substitutedType ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; } public static TypeBinding substitute ( Substitution substitution , TypeBinding originalType ) { if ( originalType == null ) return null ; switch ( originalType . kind ( ) ) { case Binding . TYPE_PARAMETER : return substitution . substitute ( ( TypeVariableBinding ) originalType ) ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding originalParameterizedType = ( ParameterizedTypeBinding ) originalType ; ReferenceBinding originalEnclosing = originalType . enclosingType ( ) ; ReferenceBinding substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } TypeBinding [ ] originalArguments = originalParameterizedType . arguments ; TypeBinding [ ] substitutedArguments = originalArguments ; if ( originalArguments != null ) { if ( substitution . isRawSubstitution ( ) ) { return originalParameterizedType . environment . createRawType ( originalParameterizedType . genericType ( ) , substitutedEnclosing ) ; } substitutedArguments = substitute ( substitution , originalArguments ) ; } if ( substitutedArguments != originalArguments || substitutedEnclosing != originalEnclosing ) { return originalParameterizedType . environment . createParameterizedType ( originalParameterizedType . genericType ( ) , substitutedArguments , substitutedEnclosing ) ; } break ; case Binding . ARRAY_TYPE : ArrayBinding originalArrayType = ( ArrayBinding ) originalType ; TypeBinding originalLeafComponentType = originalArrayType . leafComponentType ; TypeBinding substitute = substitute ( substitution , originalLeafComponentType ) ; if ( substitute != originalLeafComponentType ) { return originalArrayType . environment . createArrayType ( substitute . leafComponentType ( ) , substitute . dimensions ( ) + originalType . dimensions ( ) ) ; } break ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : WildcardBinding wildcard = ( WildcardBinding ) originalType ; if ( wildcard . boundKind != Wildcard . UNBOUND ) { TypeBinding originalBound = wildcard . bound ; TypeBinding substitutedBound = substitute ( substitution , originalBound ) ; TypeBinding [ ] originalOtherBounds = wildcard . otherBounds ; TypeBinding [ ] substitutedOtherBounds = substitute ( substitution , originalOtherBounds ) ; if ( substitutedBound != originalBound || originalOtherBounds != substitutedOtherBounds ) { if ( originalOtherBounds != null ) { TypeBinding [ ] bounds = new TypeBinding [ <NUM_LIT:1> + substitutedOtherBounds . length ] ; bounds [ <NUM_LIT:0> ] = substitutedBound ; System . arraycopy ( substitutedOtherBounds , <NUM_LIT:0> , bounds , <NUM_LIT:1> , substitutedOtherBounds . length ) ; TypeBinding [ ] glb = Scope . greaterLowerBound ( bounds ) ; if ( glb != null && glb != bounds ) { substitutedBound = glb [ <NUM_LIT:0> ] ; if ( glb . length == <NUM_LIT:1> ) { substitutedOtherBounds = null ; } else { System . arraycopy ( glb , <NUM_LIT:1> , substitutedOtherBounds = new TypeBinding [ glb . length - <NUM_LIT:1> ] , <NUM_LIT:0> , glb . length - <NUM_LIT:1> ) ; } } } return wildcard . environment . createWildcard ( wildcard . genericType , wildcard . rank , substitutedBound , substitutedOtherBounds , wildcard . boundKind ) ; } } break ; case Binding . TYPE : if ( ! originalType . isMemberType ( ) ) break ; ReferenceBinding originalReferenceType = ( ReferenceBinding ) originalType ; originalEnclosing = originalType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } if ( substitutedEnclosing != originalEnclosing ) { return substitution . isRawSubstitution ( ) ? substitution . environment ( ) . createRawType ( originalReferenceType , substitutedEnclosing ) : substitution . environment ( ) . createParameterizedType ( originalReferenceType , null , substitutedEnclosing ) ; } break ; case Binding . GENERIC_TYPE : originalReferenceType = ( ReferenceBinding ) originalType ; originalEnclosing = originalType . enclosingType ( ) ; substitutedEnclosing = originalEnclosing ; if ( originalEnclosing != null ) { substitutedEnclosing = ( ReferenceBinding ) substitute ( substitution , originalEnclosing ) ; } if ( substitution . isRawSubstitution ( ) ) { return substitution . environment ( ) . createRawType ( originalReferenceType , substitutedEnclosing ) ; } originalArguments = originalReferenceType . typeVariables ( ) ; substitutedArguments = substitute ( substitution , originalArguments ) ; return substitution . environment ( ) . createParameterizedType ( originalReferenceType , substitutedArguments , substitutedEnclosing ) ; } return originalType ; } public static TypeBinding [ ] substitute ( Substitution substitution , TypeBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; TypeBinding [ ] substitutedTypes = originalTypes ; for ( int i = <NUM_LIT:0> , length = originalTypes . length ; i < length ; i ++ ) { TypeBinding originalType = originalTypes [ i ] ; TypeBinding substitutedParameter = substitute ( substitution , originalType ) ; if ( substitutedParameter != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , <NUM_LIT:0> , substitutedTypes = new TypeBinding [ length ] , <NUM_LIT:0> , i ) ; } substitutedTypes [ i ] = substitutedParameter ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; } public TypeBinding boxing ( TypeBinding type ) { if ( type . isBaseType ( ) ) return environment ( ) . computeBoxingType ( type ) ; return type ; } public final ClassScope classScope ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) return ( ClassScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return null ; } public final CompilationUnitScope compilationUnitScope ( ) { Scope lastScope = null ; Scope scope = this ; do { lastScope = scope ; scope = scope . parent ; } while ( scope != null ) ; return ( CompilationUnitScope ) lastScope ; } public final CompilerOptions compilerOptions ( ) { return compilationUnitScope ( ) . environment . globalOptions ; } protected final MethodBinding computeCompatibleMethod ( MethodBinding method , TypeBinding [ ] arguments , InvocationSite invocationSite ) { return computeCompatibleMethod ( method , arguments , invocationSite , false ) ; } protected final MethodBinding computeCompatibleMethod ( MethodBinding method , TypeBinding [ ] arguments , InvocationSite invocationSite , boolean tiebreakingVarargsMethods ) { TypeBinding [ ] genericTypeArguments = invocationSite . genericTypeArguments ( ) ; TypeBinding [ ] parameters = method . parameters ; TypeVariableBinding [ ] typeVariables = method . typeVariables ; if ( parameters == arguments && ( method . returnType . tagBits & TagBits . HasTypeVariable ) == <NUM_LIT:0> && genericTypeArguments == null && typeVariables == Binding . NO_TYPE_VARIABLES ) return method ; int argLength = arguments . length ; int paramLength = parameters . length ; boolean isVarArgs = method . isVarargs ( ) ; if ( argLength != paramLength ) if ( ! isVarArgs || argLength < paramLength - <NUM_LIT:1> ) return null ; CompilerOptions compilerOptions = this . compilerOptions ( ) ; if ( typeVariables != Binding . NO_TYPE_VARIABLES && compilerOptions . sourceLevel >= ClassFileConstants . JDK1_5 ) { TypeBinding [ ] newArgs = null ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding param = i < paramLength ? parameters [ i ] : parameters [ paramLength - <NUM_LIT:1> ] ; if ( arguments [ i ] . isBaseType ( ) != param . isBaseType ( ) ) { if ( newArgs == null ) { newArgs = new TypeBinding [ argLength ] ; System . arraycopy ( arguments , <NUM_LIT:0> , newArgs , <NUM_LIT:0> , argLength ) ; } newArgs [ i ] = environment ( ) . computeBoxingType ( arguments [ i ] ) ; } } if ( newArgs != null ) arguments = newArgs ; method = ParameterizedGenericMethodBinding . computeCompatibleMethod ( method , arguments , this , invocationSite ) ; if ( method == null ) return null ; if ( ! method . isValidBinding ( ) ) return method ; } else if ( genericTypeArguments != null && compilerOptions . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( method instanceof ParameterizedGenericMethodBinding ) { if ( ! ( ( ParameterizedGenericMethodBinding ) method ) . wasInferred ) return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . TypeArgumentsForRawGenericMethod ) ; } else if ( ! method . isOverriding ( ) || ! isOverriddenMethodGeneric ( method ) ) { return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . TypeParameterArityMismatch ) ; } } int compatibilityLevel ; if ( tiebreakingVarargsMethods ) { if ( CompilerOptions . tolerateIllegalAmbiguousVarargsInvocation && compilerOptions . complianceLevel < ClassFileConstants . JDK1_7 ) tiebreakingVarargsMethods = false ; } if ( ( compatibilityLevel = parameterCompatibilityLevel ( method , arguments , tiebreakingVarargsMethods ) ) > NOT_COMPATIBLE ) { if ( compatibilityLevel == VARARGS_COMPATIBLE ) { TypeBinding varargsElementType = method . parameters [ method . parameters . length - <NUM_LIT:1> ] . leafComponentType ( ) ; if ( varargsElementType instanceof ReferenceBinding ) { if ( ! ( ( ReferenceBinding ) varargsElementType ) . canBeSeenBy ( this ) ) { return new ProblemMethodBinding ( method , method . selector , genericTypeArguments , ProblemReasons . VarargsElementTypeNotVisible ) ; } } } if ( ( method . tagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) { return this . environment ( ) . createPolymorphicMethod ( method , arguments ) ; } return method ; } if ( genericTypeArguments != null && typeVariables != Binding . NO_TYPE_VARIABLES ) return new ProblemMethodBinding ( method , method . selector , arguments , ProblemReasons . ParameterizedMethodTypeMismatch ) ; return null ; } protected boolean connectTypeVariables ( TypeParameter [ ] typeParameters , boolean checkForErasedCandidateCollisions ) { if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) return true ; Map invocations = new HashMap ( <NUM_LIT:2> ) ; boolean noProblems = true ; for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; if ( typeVariable == null ) return false ; typeVariable . superclass = getJavaLangObject ( ) ; typeVariable . superInterfaces = Binding . NO_SUPERINTERFACES ; typeVariable . firstBound = null ; } nextVariable : for ( int i = <NUM_LIT:0> , paramLength = typeParameters . length ; i < paramLength ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding typeVariable = typeParameter . binding ; TypeReference typeRef = typeParameter . type ; if ( typeRef == null ) continue nextVariable ; boolean isFirstBoundTypeVariable = false ; TypeBinding superType = this . kind == METHOD_SCOPE ? typeRef . resolveType ( ( BlockScope ) this , false ) : typeRef . resolveType ( ( ClassScope ) this ) ; if ( superType == null ) { typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } else { typeRef . resolvedType = superType ; firstBound : { switch ( superType . kind ( ) ) { case Binding . ARRAY_TYPE : problemReporter ( ) . boundCannotBeArray ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; case Binding . TYPE_PARAMETER : isFirstBoundTypeVariable = true ; TypeVariableBinding varSuperType = ( TypeVariableBinding ) superType ; if ( varSuperType . rank >= typeVariable . rank && varSuperType . declaringElement == typeVariable . declaringElement ) { if ( compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_6 ) { problemReporter ( ) . forwardTypeVariableReference ( typeParameter , varSuperType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; } } if ( compilerOptions ( ) . complianceLevel > ClassFileConstants . JDK1_6 ) { if ( typeVariable . rank >= varSuperType . rank && varSuperType . declaringElement == typeVariable . declaringElement ) { SimpleSet set = new SimpleSet ( typeParameters . length ) ; set . add ( typeVariable ) ; ReferenceBinding superBinding = varSuperType ; while ( superBinding instanceof TypeVariableBinding ) { if ( set . includes ( superBinding ) ) { problemReporter ( ) . hierarchyCircularity ( typeVariable , varSuperType , typeRef ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; break firstBound ; } else { set . add ( superBinding ) ; superBinding = ( ( TypeVariableBinding ) superBinding ) . superclass ; } } } } break ; default : if ( ( ( ReferenceBinding ) superType ) . isFinal ( ) ) { problemReporter ( ) . finalVariableBound ( typeVariable , typeRef ) ; } break ; } ReferenceBinding superRefType = ( ReferenceBinding ) superType ; if ( ! superType . isInterface ( ) ) { typeVariable . superclass = superRefType ; } else { typeVariable . superInterfaces = new ReferenceBinding [ ] { superRefType } ; } typeVariable . tagBits |= superType . tagBits & TagBits . ContainsNestedTypeReferences ; typeVariable . firstBound = superRefType ; } } TypeReference [ ] boundRefs = typeParameter . bounds ; if ( boundRefs != null ) { nextBound : for ( int j = <NUM_LIT:0> , boundLength = boundRefs . length ; j < boundLength ; j ++ ) { typeRef = boundRefs [ j ] ; superType = this . kind == METHOD_SCOPE ? typeRef . resolveType ( ( BlockScope ) this , false ) : typeRef . resolveType ( ( ClassScope ) this ) ; if ( superType == null ) { typeVariable . tagBits |= TagBits . HierarchyHasProblems ; continue nextBound ; } else { typeVariable . tagBits |= superType . tagBits & TagBits . ContainsNestedTypeReferences ; boolean didAlreadyComplain = ! typeRef . resolvedType . isValidBinding ( ) ; if ( isFirstBoundTypeVariable && j == <NUM_LIT:0> ) { problemReporter ( ) . noAdditionalBoundAfterTypeVariable ( typeRef ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; didAlreadyComplain = true ; } else if ( superType . isArrayType ( ) ) { if ( ! didAlreadyComplain ) { problemReporter ( ) . boundCannotBeArray ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } continue nextBound ; } else { if ( ! superType . isInterface ( ) ) { if ( ! didAlreadyComplain ) { problemReporter ( ) . boundMustBeAnInterface ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; } continue nextBound ; } } if ( checkForErasedCandidateCollisions && typeVariable . firstBound == typeVariable . superclass ) { if ( hasErasedCandidatesCollisions ( superType , typeVariable . superclass , invocations , typeVariable , typeRef ) ) { continue nextBound ; } } ReferenceBinding superRefType = ( ReferenceBinding ) superType ; for ( int index = typeVariable . superInterfaces . length ; -- index >= <NUM_LIT:0> ; ) { ReferenceBinding previousInterface = typeVariable . superInterfaces [ index ] ; if ( previousInterface == superRefType ) { problemReporter ( ) . duplicateBounds ( typeRef , superType ) ; typeVariable . tagBits |= TagBits . HierarchyHasProblems ; continue nextBound ; } if ( checkForErasedCandidateCollisions ) { if ( hasErasedCandidatesCollisions ( superType , previousInterface , invocations , typeVariable , typeRef ) ) { continue nextBound ; } } } int size = typeVariable . superInterfaces . length ; System . arraycopy ( typeVariable . superInterfaces , <NUM_LIT:0> , typeVariable . superInterfaces = new ReferenceBinding [ size + <NUM_LIT:1> ] , <NUM_LIT:0> , size ) ; typeVariable . superInterfaces [ size ] = superRefType ; } } } noProblems &= ( typeVariable . tagBits & TagBits . HierarchyHasProblems ) == <NUM_LIT:0> ; } return noProblems ; } public ArrayBinding createArrayType ( TypeBinding type , int dimension ) { if ( type . isValidBinding ( ) ) return environment ( ) . createArrayType ( type , dimension ) ; return new ArrayBinding ( type , dimension , environment ( ) ) ; } public TypeVariableBinding [ ] createTypeVariables ( TypeParameter [ ] typeParameters , Binding declaringElement ) { if ( typeParameters == null || typeParameters . length == <NUM_LIT:0> ) return Binding . NO_TYPE_VARIABLES ; PackageBinding unitPackage = compilationUnitScope ( ) . fPackage ; int length = typeParameters . length ; TypeVariableBinding [ ] typeVariableBindings = new TypeVariableBinding [ length ] ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeParameter typeParameter = typeParameters [ i ] ; TypeVariableBinding parameterBinding = new TypeVariableBinding ( typeParameter . name , declaringElement , i , environment ( ) ) ; parameterBinding . fPackage = unitPackage ; typeParameter . binding = parameterBinding ; for ( int j = <NUM_LIT:0> ; j < count ; j ++ ) { TypeVariableBinding knownVar = typeVariableBindings [ j ] ; if ( CharOperation . equals ( knownVar . sourceName , typeParameter . name ) ) problemReporter ( ) . duplicateTypeParameterInType ( typeParameter ) ; } typeVariableBindings [ count ++ ] = parameterBinding ; } if ( count != length ) System . arraycopy ( typeVariableBindings , <NUM_LIT:0> , typeVariableBindings = new TypeVariableBinding [ count ] , <NUM_LIT:0> , count ) ; return typeVariableBindings ; } public final ClassScope enclosingClassScope ( ) { Scope scope = this ; while ( ( scope = scope . parent ) != null ) { if ( scope instanceof ClassScope ) return ( ClassScope ) scope ; } return null ; } public final MethodScope enclosingMethodScope ( ) { Scope scope = this ; while ( ( scope = scope . parent ) != null ) { if ( scope instanceof MethodScope ) return ( MethodScope ) scope ; } return null ; } public final ReferenceBinding enclosingReceiverType ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) { return environment ( ) . convertToParameterizedType ( ( ( ClassScope ) scope ) . referenceContext . binding ) ; } scope = scope . parent ; } while ( scope != null ) ; return null ; } public ReferenceContext enclosingReferenceContext ( ) { Scope current = this ; while ( ( current = current . parent ) != null ) { switch ( current . kind ) { case METHOD_SCOPE : return ( ( MethodScope ) current ) . referenceContext ; case CLASS_SCOPE : return ( ( ClassScope ) current ) . referenceContext ; case COMPILATION_UNIT_SCOPE : return ( ( CompilationUnitScope ) current ) . referenceContext ; } } return null ; } public final SourceTypeBinding enclosingSourceType ( ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) return ( ( ClassScope ) scope ) . referenceContext . binding ; scope = scope . parent ; } while ( scope != null ) ; return null ; } public final LookupEnvironment environment ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . environment ; } protected MethodBinding findDefaultAbstractMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , ReferenceBinding classHierarchyStart , ObjectVector found , MethodBinding concreteMatch ) { int startFoundSize = found . size ; ReferenceBinding currentType = classHierarchyStart ; while ( currentType != null ) { findMethodInSuperInterfaces ( currentType , selector , found , invocationSite ) ; currentType = currentType . superclass ( ) ; } MethodBinding [ ] candidates = null ; int candidatesCount = <NUM_LIT:0> ; MethodBinding problemMethod = null ; int foundSize = found . size ; if ( foundSize > startFoundSize ) { for ( int i = startFoundSize ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( concreteMatch != null && environment ( ) . methodVerifier ( ) . areMethodsCompatible ( concreteMatch , compatibleMethod ) ) continue ; if ( candidatesCount == <NUM_LIT:0> ) { candidates = new MethodBinding [ foundSize - startFoundSize + <NUM_LIT:1> ] ; if ( concreteMatch != null ) candidates [ candidatesCount ++ ] = concreteMatch ; } candidates [ candidatesCount ++ ] = compatibleMethod ; } else if ( problemMethod == null ) { problemMethod = compatibleMethod ; } } } } if ( candidatesCount < <NUM_LIT:2> ) { if ( concreteMatch == null ) { if ( candidatesCount == <NUM_LIT:0> ) return problemMethod ; concreteMatch = candidates [ <NUM_LIT:0> ] ; } compilationUnitScope ( ) . recordTypeReferences ( concreteMatch . thrownExceptions ) ; return concreteMatch ; } if ( compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) return mostSpecificMethodBinding ( candidates , candidatesCount , argumentTypes , invocationSite , receiverType ) ; return mostSpecificInterfaceMethodBinding ( candidates , candidatesCount , invocationSite ) ; } public ReferenceBinding findDirectMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { if ( ( enclosingType . tagBits & TagBits . HasNoMemberTypes ) != <NUM_LIT:0> ) return null ; ReferenceBinding enclosingReceiverType = enclosingReceiverType ( ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordReference ( enclosingType , typeName ) ; ReferenceBinding memberType = enclosingType . getMemberType ( typeName ) ; if ( memberType != null ) { unitScope . recordTypeReference ( memberType ) ; if ( enclosingReceiverType == null ) { if ( memberType . canBeSeenBy ( getCurrentPackage ( ) ) ) { return memberType ; } if ( this instanceof CompilationUnitScope ) { TypeDeclaration [ ] types = ( ( CompilationUnitScope ) this ) . referenceContext . types ; if ( types != null ) { for ( int i = <NUM_LIT:0> , max = types . length ; i < max ; i ++ ) { if ( memberType . canBeSeenBy ( enclosingType , types [ i ] . binding ) ) { return memberType ; } } } } } else if ( memberType . canBeSeenBy ( enclosingType , enclosingReceiverType ) ) { return memberType ; } return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , memberType , ProblemReasons . NotVisible ) ; } return null ; } public MethodBinding findExactMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReferences ( argumentTypes ) ; MethodBinding exactMethod = receiverType . getExactMethod ( selector , argumentTypes , unitScope ) ; if ( exactMethod != null && exactMethod . typeVariables == Binding . NO_TYPE_VARIABLES && ! exactMethod . isBridge ( ) ) { if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) for ( int i = argumentTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( isPossibleSubtypeOfRawType ( argumentTypes [ i ] ) ) return null ; unitScope . recordTypeReferences ( exactMethod . thrownExceptions ) ; if ( exactMethod . isAbstract ( ) && exactMethod . thrownExceptions != Binding . NO_EXCEPTIONS ) return null ; if ( receiverType . isInterface ( ) || exactMethod . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && exactMethod . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , exactMethod , this ) ; } if ( invocationSite . genericTypeArguments ( ) != null ) { exactMethod = computeCompatibleMethod ( exactMethod , argumentTypes , invocationSite ) ; } else if ( ( exactMethod . tagBits & TagBits . AnnotationPolymorphicSignature ) != <NUM_LIT:0> ) { return this . environment ( ) . createPolymorphicMethod ( exactMethod , argumentTypes ) ; } return exactMethod ; } } return null ; } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve ) { return findField ( receiverType , fieldName , invocationSite , needResolve , false ) ; } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite , boolean needResolve , boolean invisibleFieldsOk ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReference ( receiverType ) ; checkArrayField : { TypeBinding leafType ; switch ( receiverType . kind ( ) ) { case Binding . BASE_TYPE : return null ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . TYPE_PARAMETER : TypeBinding receiverErasure = receiverType . erasure ( ) ; if ( ! receiverErasure . isArrayType ( ) ) break checkArrayField ; leafType = receiverErasure . leafComponentType ( ) ; break ; case Binding . ARRAY_TYPE : leafType = receiverType . leafComponentType ( ) ; break ; default : break checkArrayField ; } if ( leafType instanceof ReferenceBinding ) if ( ! ( ( ReferenceBinding ) leafType ) . canBeSeenBy ( this ) ) return new ProblemFieldBinding ( ( ReferenceBinding ) leafType , fieldName , ProblemReasons . ReceiverTypeNotVisible ) ; if ( CharOperation . equals ( fieldName , TypeConstants . LENGTH ) ) { if ( ( leafType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { return new ProblemFieldBinding ( ArrayBinding . ArrayLength , null , fieldName , ProblemReasons . NotFound ) ; } return ArrayBinding . ArrayLength ; } return null ; } ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; if ( ! currentType . canBeSeenBy ( this ) ) return new ProblemFieldBinding ( currentType , fieldName , ProblemReasons . ReceiverTypeNotVisible ) ; currentType . initializeForStaticImports ( ) ; FieldBinding field = currentType . getField ( fieldName , needResolve ) ; boolean insideTypeAnnotations = this instanceof MethodScope && ( ( MethodScope ) this ) . insideTypeAnnotation ; if ( field != null ) { if ( invisibleFieldsOk ) { return field ; } if ( invocationSite == null || insideTypeAnnotations ? field . canBeSeenBy ( getCurrentPackage ( ) ) : field . canBeSeenBy ( currentType , invocationSite , this ) ) return field ; return new ProblemFieldBinding ( field , field . declaringClass , fieldName , ProblemReasons . NotVisible ) ; } ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; FieldBinding visibleField = null ; boolean keepLooking = true ; FieldBinding notVisibleField = null ; while ( keepLooking ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } if ( ( currentType = currentType . superclass ( ) ) == null ) break ; unitScope . recordTypeReference ( currentType ) ; currentType . initializeForStaticImports ( ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; if ( ( field = currentType . getField ( fieldName , needResolve ) ) != null ) { if ( invisibleFieldsOk ) { return field ; } keepLooking = false ; if ( field . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( visibleField == null ) visibleField = field ; else return new ProblemFieldBinding ( visibleField , visibleField . declaringClass , fieldName , ProblemReasons . Ambiguous ) ; } else { if ( notVisibleField == null ) notVisibleField = field ; } } } if ( interfacesToVisit != null ) { ProblemFieldBinding ambiguous = null ; done : for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; unitScope . recordTypeReference ( anInterface ) ; if ( ( field = anInterface . getField ( fieldName , true ) ) != null ) { if ( invisibleFieldsOk ) { return field ; } if ( visibleField == null ) { visibleField = field ; } else { ambiguous = new ProblemFieldBinding ( visibleField , visibleField . declaringClass , fieldName , ProblemReasons . Ambiguous ) ; break done ; } } else { ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ambiguous != null ) return ambiguous ; } if ( visibleField != null ) return visibleField ; if ( notVisibleField != null ) { return new ProblemFieldBinding ( notVisibleField , currentType , fieldName , ProblemReasons . NotVisible ) ; } return null ; } public ReferenceBinding findMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { if ( ( enclosingType . tagBits & TagBits . HasNoMemberTypes ) != <NUM_LIT:0> ) return null ; ReferenceBinding enclosingSourceType = enclosingSourceType ( ) ; PackageBinding currentPackage = getCurrentPackage ( ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordReference ( enclosingType , typeName ) ; ReferenceBinding memberType = enclosingType . getMemberType ( typeName ) ; if ( memberType != null ) { unitScope . recordTypeReference ( memberType ) ; if ( enclosingSourceType == null || ( this . parent == unitScope && ( enclosingSourceType . tagBits & TagBits . TypeVariablesAreConnected ) == <NUM_LIT:0> ) ? memberType . canBeSeenBy ( currentPackage ) : memberType . canBeSeenBy ( enclosingType , enclosingSourceType ) ) return memberType ; return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , memberType , ProblemReasons . NotVisible ) ; } ReferenceBinding currentType = enclosingType ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; ReferenceBinding visibleMemberType = null ; boolean keepLooking = true ; ReferenceBinding notVisible = null ; while ( keepLooking ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces == null ) { ReferenceBinding sourceType = currentType . isParameterizedType ( ) ? ( ( ParameterizedTypeBinding ) currentType ) . genericType ( ) : currentType ; if ( sourceType . isHierarchyBeingConnected ( ) ) return null ; ( ( SourceTypeBinding ) sourceType ) . scope . connectTypeHierarchy ( ) ; itsInterfaces = currentType . superInterfaces ( ) ; } if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } if ( ( currentType = currentType . superclass ( ) ) == null ) break ; unitScope . recordReference ( currentType , typeName ) ; if ( ( memberType = currentType . getMemberType ( typeName ) ) != null ) { unitScope . recordTypeReference ( memberType ) ; keepLooking = false ; if ( enclosingSourceType == null ? memberType . canBeSeenBy ( currentPackage ) : memberType . canBeSeenBy ( enclosingType , enclosingSourceType ) ) { if ( visibleMemberType == null ) visibleMemberType = memberType ; else return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , visibleMemberType , ProblemReasons . Ambiguous ) ; } else { notVisible = memberType ; } } } if ( interfacesToVisit != null ) { ProblemReferenceBinding ambiguous = null ; done : for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { ReferenceBinding anInterface = interfacesToVisit [ i ] ; unitScope . recordReference ( anInterface , typeName ) ; if ( ( memberType = anInterface . getMemberType ( typeName ) ) != null ) { unitScope . recordTypeReference ( memberType ) ; if ( visibleMemberType == null ) { visibleMemberType = memberType ; } else { ambiguous = new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , visibleMemberType , ProblemReasons . Ambiguous ) ; break done ; } } else { ReferenceBinding [ ] itsInterfaces = anInterface . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } if ( ambiguous != null ) return ambiguous ; } if ( visibleMemberType != null ) return visibleMemberType ; if ( notVisible != null ) return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , notVisible , ProblemReasons . NotVisible ) ; return null ; } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { return findMethod ( receiverType , selector , argumentTypes , invocationSite , false ) ; } public MethodBinding oneLastLook ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { MethodBinding [ ] extraMethods = receiverType . getAnyExtraMethods ( selector ) ; if ( extraMethods != null ) { return extraMethods [ <NUM_LIT:0> ] ; } else { return null ; } } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , boolean inStaticContext ) { ReferenceBinding currentType = receiverType ; boolean receiverTypeIsInterface = receiverType . isInterface ( ) ; ObjectVector found = new ObjectVector ( <NUM_LIT:3> ) ; CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordTypeReferences ( argumentTypes ) ; if ( receiverTypeIsInterface ) { unitScope . recordTypeReference ( receiverType ) ; MethodBinding [ ] receiverMethods = receiverType . getMethods ( selector , argumentTypes . length ) ; if ( receiverMethods . length > <NUM_LIT:0> ) found . addAll ( receiverMethods ) ; findMethodInSuperInterfaces ( receiverType , selector , found , invocationSite ) ; currentType = getJavaLangObject ( ) ; } long complianceLevel = compilerOptions ( ) . complianceLevel ; boolean isCompliant14 = complianceLevel >= ClassFileConstants . JDK1_4 ; boolean isCompliant15 = complianceLevel >= ClassFileConstants . JDK1_5 ; ReferenceBinding classHierarchyStart = currentType ; MethodVerifier verifier = environment ( ) . methodVerifier ( ) ; while ( currentType != null ) { unitScope . recordTypeReference ( currentType ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; MethodBinding [ ] currentMethods = currentType . getMethods ( selector , argumentTypes . length ) ; int currentLength = currentMethods . length ; if ( currentLength > <NUM_LIT:0> ) { if ( isCompliant14 && ( receiverTypeIsInterface || found . size > <NUM_LIT:0> ) ) { nextMethod : for ( int i = <NUM_LIT:0> , l = currentLength ; i < l ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod == null ) continue nextMethod ; if ( receiverTypeIsInterface && ! currentMethod . isPublic ( ) ) { currentLength -- ; currentMethods [ i ] = null ; continue nextMethod ; } for ( int j = <NUM_LIT:0> , max = found . size ; j < max ; j ++ ) { MethodBinding matchingMethod = ( MethodBinding ) found . elementAt ( j ) ; MethodBinding matchingOriginal = matchingMethod . original ( ) ; MethodBinding currentOriginal = matchingOriginal . findOriginalInheritedMethod ( currentMethod ) ; if ( currentOriginal != null && verifier . isParameterSubsignature ( matchingOriginal , currentOriginal ) ) { if ( isCompliant15 ) { if ( matchingMethod . isBridge ( ) && ! currentMethod . isBridge ( ) ) continue nextMethod ; } currentLength -- ; currentMethods [ i ] = null ; continue nextMethod ; } } } } if ( currentLength > <NUM_LIT:0> ) { if ( currentMethods . length == currentLength ) { found . addAll ( currentMethods ) ; } else { for ( int i = <NUM_LIT:0> , max = currentMethods . length ; i < max ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod != null ) found . add ( currentMethod ) ; } } } } currentType = currentType . superclass ( ) ; } int foundSize = found . size ; MethodBinding [ ] candidates = null ; int candidatesCount = <NUM_LIT:0> ; MethodBinding problemMethod = null ; boolean searchForDefaultAbstractMethod = isCompliant14 && ! receiverTypeIsInterface && ( receiverType . isAbstract ( ) || receiverType . isTypeVariable ( ) ) ; if ( foundSize > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; MethodBinding compatibleMethod = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( foundSize == <NUM_LIT:1> && compatibleMethod . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( searchForDefaultAbstractMethod ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , compatibleMethod ) ; unitScope . recordTypeReferences ( compatibleMethod . thrownExceptions ) ; return compatibleMethod ; } if ( candidatesCount == <NUM_LIT:0> ) candidates = new MethodBinding [ foundSize ] ; candidates [ candidatesCount ++ ] = compatibleMethod ; } else if ( problemMethod == null ) { problemMethod = compatibleMethod ; } } } } if ( candidatesCount == <NUM_LIT:0> ) { if ( problemMethod != null ) { switch ( problemMethod . problemId ( ) ) { case ProblemReasons . TypeArgumentsForRawGenericMethod : case ProblemReasons . TypeParameterArityMismatch : return problemMethod ; } } MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null ) return interfaceMethod ; if ( found . size == <NUM_LIT:0> ) return null ; if ( problemMethod != null ) return problemMethod ; int bestArgMatches = - <NUM_LIT:1> ; MethodBinding bestGuess = ( MethodBinding ) found . elementAt ( <NUM_LIT:0> ) ; int argLength = argumentTypes . length ; foundSize = found . size ; nextMethod : for ( int i = <NUM_LIT:0> ; i < foundSize ; i ++ ) { MethodBinding methodBinding = ( MethodBinding ) found . elementAt ( i ) ; TypeBinding [ ] params = methodBinding . parameters ; int paramLength = params . length ; int argMatches = <NUM_LIT:0> ; next : for ( int a = <NUM_LIT:0> ; a < argLength ; a ++ ) { TypeBinding arg = argumentTypes [ a ] ; for ( int p = a == <NUM_LIT:0> ? <NUM_LIT:0> : a - <NUM_LIT:1> ; p < paramLength && p < a + <NUM_LIT:1> ; p ++ ) { if ( params [ p ] == arg ) { argMatches ++ ; continue next ; } } } if ( argMatches < bestArgMatches ) continue nextMethod ; if ( argMatches == bestArgMatches ) { int diff1 = paramLength < argLength ? <NUM_LIT:2> * ( argLength - paramLength ) : paramLength - argLength ; int bestLength = bestGuess . parameters . length ; int diff2 = bestLength < argLength ? <NUM_LIT:2> * ( argLength - bestLength ) : bestLength - argLength ; if ( diff1 >= diff2 ) continue nextMethod ; } bestArgMatches = argMatches ; bestGuess = methodBinding ; } return new ProblemMethodBinding ( bestGuess , bestGuess . selector , argumentTypes , ProblemReasons . NotFound ) ; } int visiblesCount = <NUM_LIT:0> ; if ( receiverTypeIsInterface ) { if ( candidatesCount == <NUM_LIT:1> ) { unitScope . recordTypeReferences ( candidates [ <NUM_LIT:0> ] . thrownExceptions ) ; return candidates [ <NUM_LIT:0> ] ; } visiblesCount = candidatesCount ; } else { for ( int i = <NUM_LIT:0> ; i < candidatesCount ; i ++ ) { MethodBinding methodBinding = candidates [ i ] ; if ( methodBinding . canBeSeenBy ( receiverType , invocationSite , this ) ) { if ( visiblesCount != i ) { candidates [ i ] = null ; candidates [ visiblesCount ] = methodBinding ; } visiblesCount ++ ; } } switch ( visiblesCount ) { case <NUM_LIT:0> : MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null ) return interfaceMethod ; return new ProblemMethodBinding ( candidates [ <NUM_LIT:0> ] , candidates [ <NUM_LIT:0> ] . selector , candidates [ <NUM_LIT:0> ] . parameters , ProblemReasons . NotVisible ) ; case <NUM_LIT:1> : if ( searchForDefaultAbstractMethod ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , candidates [ <NUM_LIT:0> ] ) ; unitScope . recordTypeReferences ( candidates [ <NUM_LIT:0> ] . thrownExceptions ) ; return candidates [ <NUM_LIT:0> ] ; default : break ; } } if ( complianceLevel <= ClassFileConstants . JDK1_3 ) { ReferenceBinding declaringClass = candidates [ <NUM_LIT:0> ] . declaringClass ; return ! declaringClass . isInterface ( ) ? mostSpecificClassMethodBinding ( candidates , visiblesCount , invocationSite ) : mostSpecificInterfaceMethodBinding ( candidates , visiblesCount , invocationSite ) ; } if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { for ( int i = <NUM_LIT:0> ; i < visiblesCount ; i ++ ) { MethodBinding candidate = candidates [ i ] ; if ( candidate instanceof ParameterizedGenericMethodBinding ) candidate = ( ( ParameterizedGenericMethodBinding ) candidate ) . originalMethod ; if ( candidate . hasSubstitutedParameters ( ) ) { for ( int j = i + <NUM_LIT:1> ; j < visiblesCount ; j ++ ) { MethodBinding otherCandidate = candidates [ j ] ; if ( otherCandidate . hasSubstitutedParameters ( ) ) { if ( otherCandidate == candidate || ( candidate . declaringClass == otherCandidate . declaringClass && candidate . areParametersEqual ( otherCandidate ) ) ) { return new ProblemMethodBinding ( candidates [ i ] , candidates [ i ] . selector , candidates [ i ] . parameters , ProblemReasons . Ambiguous ) ; } } } } } } if ( inStaticContext ) { MethodBinding [ ] staticCandidates = new MethodBinding [ visiblesCount ] ; int staticCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < visiblesCount ; i ++ ) if ( candidates [ i ] . isStatic ( ) ) staticCandidates [ staticCount ++ ] = candidates [ i ] ; if ( staticCount == <NUM_LIT:1> ) return staticCandidates [ <NUM_LIT:0> ] ; if ( staticCount > <NUM_LIT:1> ) return mostSpecificMethodBinding ( staticCandidates , staticCount , argumentTypes , invocationSite , receiverType ) ; } MethodBinding mostSpecificMethod = mostSpecificMethodBinding ( candidates , visiblesCount , argumentTypes , invocationSite , receiverType ) ; if ( searchForDefaultAbstractMethod ) { if ( mostSpecificMethod . isValidBinding ( ) ) return findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , mostSpecificMethod ) ; MethodBinding interfaceMethod = findDefaultAbstractMethod ( receiverType , selector , argumentTypes , invocationSite , classHierarchyStart , found , null ) ; if ( interfaceMethod != null && interfaceMethod . isValidBinding ( ) ) return interfaceMethod ; } return mostSpecificMethod ; } public MethodBinding findMethodForArray ( ArrayBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { TypeBinding leafType = receiverType . leafComponentType ( ) ; if ( leafType instanceof ReferenceBinding ) { if ( ! ( ( ReferenceBinding ) leafType ) . canBeSeenBy ( this ) ) return new ProblemMethodBinding ( selector , Binding . NO_PARAMETERS , ( ReferenceBinding ) leafType , ProblemReasons . ReceiverTypeNotVisible ) ; } ReferenceBinding object = getJavaLangObject ( ) ; MethodBinding methodBinding = object . getExactMethod ( selector , argumentTypes , null ) ; if ( methodBinding != null ) { if ( argumentTypes == Binding . NO_PARAMETERS ) { switch ( selector [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:c>' : if ( CharOperation . equals ( selector , TypeConstants . CLONE ) ) { return environment ( ) . computeArrayClone ( methodBinding ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } break ; } } if ( methodBinding . canBeSeenBy ( receiverType , invocationSite , this ) ) return methodBinding ; } methodBinding = findMethod ( object , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; return methodBinding ; } protected void findMethodInSuperInterfaces ( ReferenceBinding currentType , char [ ] selector , ObjectVector found , InvocationSite invocationSite ) { ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { ReferenceBinding [ ] interfacesToVisit = itsInterfaces ; int nextPosition = interfacesToVisit . length ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; compilationUnitScope ( ) . recordTypeReference ( currentType ) ; currentType = ( ReferenceBinding ) currentType . capture ( this , invocationSite == null ? <NUM_LIT:0> : invocationSite . sourceEnd ( ) ) ; MethodBinding [ ] currentMethods = currentType . getMethods ( selector ) ; if ( currentMethods . length > <NUM_LIT:0> ) { int foundSize = found . size ; if ( foundSize > <NUM_LIT:0> ) { next : for ( int c = <NUM_LIT:0> , l = currentMethods . length ; c < l ; c ++ ) { MethodBinding current = currentMethods [ c ] ; for ( int f = <NUM_LIT:0> ; f < foundSize ; f ++ ) if ( current == found . elementAt ( f ) ) continue next ; found . add ( current ) ; } } else { found . addAll ( currentMethods ) ; } } if ( ( itsInterfaces = currentType . superInterfaces ( ) ) != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } } public ReferenceBinding findType ( char [ ] typeName , PackageBinding declarationPackage , PackageBinding invocationPackage ) { compilationUnitScope ( ) . recordReference ( declarationPackage . compoundName , typeName ) ; ReferenceBinding typeBinding = declarationPackage . getType ( typeName ) ; if ( typeBinding == null ) return null ; if ( typeBinding . isValidBinding ( ) ) { if ( declarationPackage != invocationPackage && ! typeBinding . canBeSeenBy ( invocationPackage ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { typeName } , typeBinding , ProblemReasons . NotVisible ) ; } return typeBinding ; } public LocalVariableBinding findVariable ( char [ ] variable ) { return null ; } public Binding getBinding ( char [ ] name , int mask , InvocationSite invocationSite , boolean needResolve ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; Binding binding = null ; FieldBinding problemField = null ; if ( ( mask & Binding . VARIABLE ) != <NUM_LIT:0> ) { boolean insideStaticContext = false ; boolean insideConstructorCall = false ; boolean insideTypeAnnotation = false ; FieldBinding foundField = null ; ProblemFieldBinding foundInsideProblem = null ; Scope scope = this ; int depth = <NUM_LIT:0> ; int foundDepth = <NUM_LIT:0> ; ReferenceBinding foundActualReceiverType = null ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; insideStaticContext |= methodScope . isStatic ; insideConstructorCall |= methodScope . isConstructorCall ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; case BLOCK_SCOPE : LocalVariableBinding variableBinding = scope . findVariable ( name ) ; if ( variableBinding != null ) { if ( foundField != null && foundField . isValidBinding ( ) ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; if ( depth > <NUM_LIT:0> ) invocationSite . setDepth ( depth ) ; return variableBinding ; } break ; case CLASS_SCOPE : ClassScope classScope = ( ClassScope ) scope ; ReferenceBinding receiverType = classScope . enclosingReceiverType ( ) ; if ( ! insideTypeAnnotation ) { FieldBinding fieldBinding = classScope . findField ( receiverType , name , invocationSite , needResolve ) ; if ( fieldBinding != null ) { if ( fieldBinding . problemId ( ) == ProblemReasons . Ambiguous ) { if ( foundField == null || foundField . problemId ( ) == ProblemReasons . NotVisible ) return fieldBinding ; return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } ProblemFieldBinding insideProblem = null ; if ( fieldBinding . isValidBinding ( ) ) { if ( ! fieldBinding . isStatic ( ) ) { if ( insideConstructorCall ) { insideProblem = new ProblemFieldBinding ( fieldBinding , fieldBinding . declaringClass , name , ProblemReasons . NonStaticReferenceInConstructorInvocation ) ; } else if ( insideStaticContext ) { insideProblem = new ProblemFieldBinding ( fieldBinding , fieldBinding . declaringClass , name , ProblemReasons . NonStaticReferenceInStaticContext ) ; } } if ( receiverType == fieldBinding . declaringClass || compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { if ( foundField == null ) { if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } return insideProblem == null ? fieldBinding : insideProblem ; } if ( foundField . isValidBinding ( ) ) if ( foundField . declaringClass != fieldBinding . declaringClass && foundField . declaringClass != foundActualReceiverType ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( foundField == null || ( foundField . problemId ( ) == ProblemReasons . NotVisible && fieldBinding . problemId ( ) != ProblemReasons . NotVisible ) ) { foundDepth = depth ; foundActualReceiverType = receiverType ; foundInsideProblem = insideProblem ; foundField = fieldBinding ; } } } insideTypeAnnotation = false ; depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = enclosingMethodScope == null ? false : enclosingMethodScope . isConstructorCall ; break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundInsideProblem != null ) return foundInsideProblem ; if ( foundField != null ) { if ( foundField . isValidBinding ( ) ) { if ( foundDepth > <NUM_LIT:0> ) { invocationSite . setDepth ( foundDepth ) ; invocationSite . setActualReceiverType ( foundActualReceiverType ) ; } return foundField ; } problemField = foundField ; foundField = null ; } if ( compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { unitScope . faultInImports ( ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) && ! importBinding . onDemand ) { if ( CharOperation . equals ( importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] , name ) ) { if ( unitScope . resolveSingleImport ( importBinding , Binding . TYPE | Binding . FIELD | Binding . METHOD ) != null && importBinding . resolvedImport instanceof FieldBinding ) { foundField = ( FieldBinding ) importBinding . resolvedImport ; ImportReference importReference = importBinding . reference ; if ( importReference != null && needResolve ) { importReference . bits |= ASTNode . Used ; } invocationSite . setActualReceiverType ( foundField . declaringClass ) ; if ( foundField . isValidBinding ( ) ) { return foundField ; } if ( problemField == null ) problemField = foundField ; } } } } boolean foundInImport = false ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) && importBinding . onDemand ) { Binding resolvedImport = importBinding . resolvedImport ; if ( resolvedImport instanceof ReferenceBinding ) { FieldBinding temp = findField ( ( ReferenceBinding ) resolvedImport , name , invocationSite , needResolve ) ; if ( temp != null ) { if ( ! temp . isValidBinding ( ) ) { if ( problemField == null ) problemField = temp ; } else if ( temp . isStatic ( ) ) { if ( foundField == temp ) continue ; ImportReference importReference = importBinding . reference ; if ( importReference != null && needResolve ) { importReference . bits |= ASTNode . Used ; } if ( foundInImport ) return new ProblemFieldBinding ( foundField , foundField . declaringClass , name , ProblemReasons . Ambiguous ) ; foundField = temp ; foundInImport = true ; } } } } } if ( foundField != null ) { invocationSite . setActualReceiverType ( foundField . declaringClass ) ; return foundField ; } } } } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { if ( ( binding = getBaseType ( name ) ) != null ) return binding ; binding = getTypeOrPackage ( name , ( mask & Binding . PACKAGE ) == <NUM_LIT:0> ? Binding . TYPE : Binding . TYPE | Binding . PACKAGE , needResolve ) ; if ( binding . isValidBinding ( ) || mask == Binding . TYPE ) return binding ; } else if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { unitScope . recordSimpleReference ( name ) ; if ( ( binding = env . getTopLevelPackage ( name ) ) != null ) return binding ; } if ( problemField != null ) return problemField ; if ( binding != null && binding . problemId ( ) != ProblemReasons . NotFound ) return binding ; return new ProblemBinding ( name , enclosingSourceType ( ) , ProblemReasons . NotFound ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public MethodBinding getConstructor ( ReferenceBinding receiverType , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; unitScope . recordTypeReference ( receiverType ) ; unitScope . recordTypeReferences ( argumentTypes ) ; MethodBinding methodBinding = receiverType . getExactConstructor ( argumentTypes ) ; if ( methodBinding != null && methodBinding . canBeSeenBy ( invocationSite , this ) ) { if ( invocationSite . genericTypeArguments ( ) != null ) methodBinding = computeCompatibleMethod ( methodBinding , argumentTypes , invocationSite ) ; return methodBinding ; } MethodBinding [ ] methods = receiverType . getMethods ( TypeConstants . INIT , argumentTypes . length ) ; if ( methods == Binding . NO_METHODS ) return new ProblemMethodBinding ( TypeConstants . INIT , argumentTypes , ProblemReasons . NotFound ) ; MethodBinding [ ] compatible = new MethodBinding [ methods . length ] ; int compatibleIndex = <NUM_LIT:0> ; MethodBinding problemMethod = null ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { MethodBinding compatibleMethod = computeCompatibleMethod ( methods [ i ] , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) compatible [ compatibleIndex ++ ] = compatibleMethod ; else if ( problemMethod == null ) problemMethod = compatibleMethod ; } } if ( compatibleIndex == <NUM_LIT:0> ) { if ( problemMethod == null ) return new ProblemMethodBinding ( methods [ <NUM_LIT:0> ] , TypeConstants . INIT , argumentTypes , ProblemReasons . NotFound ) ; return problemMethod ; } MethodBinding [ ] visible = new MethodBinding [ compatibleIndex ] ; int visibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < compatibleIndex ; i ++ ) { MethodBinding method = compatible [ i ] ; if ( method . canBeSeenBy ( invocationSite , this ) ) visible [ visibleIndex ++ ] = method ; } if ( visibleIndex == <NUM_LIT:1> ) return visible [ <NUM_LIT:0> ] ; if ( visibleIndex == <NUM_LIT:0> ) return new ProblemMethodBinding ( compatible [ <NUM_LIT:0> ] , TypeConstants . INIT , compatible [ <NUM_LIT:0> ] . parameters , ProblemReasons . NotVisible ) ; return mostSpecificMethodBinding ( visible , visibleIndex , argumentTypes , invocationSite , receiverType ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public final PackageBinding getCurrentPackage ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . fPackage ; } public int getDeclarationModifiers ( ) { switch ( this . kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( context != null ) return context . modifiers ; } else { SourceTypeBinding type = ( ( BlockScope ) this ) . referenceType ( ) . binding ; if ( methodScope . initializedField != null ) return methodScope . initializedField . modifiers ; if ( type != null ) return type . modifiers ; } break ; case Scope . CLASS_SCOPE : ReferenceBinding context = ( ( ClassScope ) this ) . referenceType ( ) . binding ; if ( context != null ) return context . modifiers ; break ; } return - <NUM_LIT:1> ; } public FieldBinding getField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { LookupEnvironment env = environment ( ) ; try { env . missingClassFileLocation = invocationSite ; FieldBinding field = findField ( receiverType , fieldName , invocationSite , true ) ; if ( field != null ) return field ; return new ProblemFieldBinding ( receiverType instanceof ReferenceBinding ? ( ReferenceBinding ) receiverType : null , fieldName , ProblemReasons . NotFound ) ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public MethodBinding getImplicitMethod ( char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { boolean insideStaticContext = false ; boolean insideConstructorCall = false ; boolean insideTypeAnnotation = false ; MethodBinding foundMethod = null ; MethodBinding foundProblem = null ; boolean foundProblemVisible = false ; Scope scope = this ; int depth = <NUM_LIT:0> ; CompilerOptions options ; boolean inheritedHasPrecedence = ( options = compilerOptions ( ) ) . complianceLevel >= ClassFileConstants . JDK1_4 ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; insideStaticContext |= methodScope . isStatic ; insideConstructorCall |= methodScope . isConstructorCall ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; break ; case CLASS_SCOPE : ClassScope classScope = ( ClassScope ) scope ; ReferenceBinding receiverType = classScope . enclosingReceiverType ( ) ; if ( ! insideTypeAnnotation ) { MethodBinding methodBinding = classScope . findExactMethod ( receiverType , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) methodBinding = classScope . findMethod ( receiverType , selector , argumentTypes , invocationSite ) ; if ( methodBinding != null ) { if ( foundMethod == null ) { if ( methodBinding . isValidBinding ( ) ) { if ( ! methodBinding . isStatic ( ) && ( insideConstructorCall || insideStaticContext ) ) { if ( foundProblem != null && foundProblem . problemId ( ) != ProblemReasons . NotVisible ) return foundProblem ; return new ProblemMethodBinding ( methodBinding , methodBinding . selector , methodBinding . parameters , insideConstructorCall ? ProblemReasons . NonStaticReferenceInConstructorInvocation : ProblemReasons . NonStaticReferenceInStaticContext ) ; } if ( inheritedHasPrecedence || receiverType == methodBinding . declaringClass || ( receiverType . getMethods ( selector ) ) != Binding . NO_METHODS ) { if ( foundProblemVisible ) { return foundProblem ; } if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } return methodBinding ; } if ( foundProblem == null || foundProblem . problemId ( ) == ProblemReasons . NotVisible ) { if ( foundProblem != null ) foundProblem = null ; if ( depth > <NUM_LIT:0> ) { invocationSite . setDepth ( depth ) ; invocationSite . setActualReceiverType ( receiverType ) ; } foundMethod = methodBinding ; } } else { if ( methodBinding . problemId ( ) != ProblemReasons . NotVisible && methodBinding . problemId ( ) != ProblemReasons . NotFound ) return methodBinding ; if ( foundProblem == null ) { foundProblem = methodBinding ; } if ( ! foundProblemVisible && methodBinding . problemId ( ) == ProblemReasons . NotFound ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) methodBinding ) . closestMatch ; if ( closestMatch != null && closestMatch . canBeSeenBy ( receiverType , invocationSite , this ) ) { foundProblem = methodBinding ; foundProblemVisible = true ; } } } } else { if ( methodBinding . problemId ( ) == ProblemReasons . Ambiguous || ( foundMethod . declaringClass != methodBinding . declaringClass && ( receiverType == methodBinding . declaringClass || receiverType . getMethods ( selector ) != Binding . NO_METHODS ) ) ) return new ProblemMethodBinding ( methodBinding , selector , argumentTypes , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } } insideTypeAnnotation = false ; depth ++ ; insideStaticContext |= receiverType . isStatic ( ) ; MethodScope enclosingMethodScope = scope . methodScope ( ) ; insideConstructorCall = enclosingMethodScope == null ? false : enclosingMethodScope . isConstructorCall ; break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( insideStaticContext && options . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( foundProblem != null ) { if ( foundProblem . declaringClass != null && foundProblem . declaringClass . id == TypeIds . T_JavaLangObject ) return foundProblem ; if ( foundProblem . problemId ( ) == ProblemReasons . NotFound && foundProblemVisible ) { return foundProblem ; } } CompilationUnitScope unitScope = ( CompilationUnitScope ) scope ; unitScope . faultInImports ( ) ; ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { ObjectVector visible = null ; boolean skipOnDemand = false ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) ) { Binding resolvedImport = importBinding . resolvedImport ; MethodBinding possible = null ; if ( importBinding . onDemand ) { if ( ! skipOnDemand && resolvedImport instanceof ReferenceBinding ) possible = findMethod ( ( ReferenceBinding ) resolvedImport , selector , argumentTypes , invocationSite , true ) ; } else { if ( resolvedImport instanceof MethodBinding ) { MethodBinding staticMethod = ( MethodBinding ) resolvedImport ; if ( CharOperation . equals ( staticMethod . selector , selector ) ) possible = findMethod ( staticMethod . declaringClass , selector , argumentTypes , invocationSite , true ) ; } else if ( resolvedImport instanceof FieldBinding ) { FieldBinding staticField = ( FieldBinding ) resolvedImport ; if ( CharOperation . equals ( staticField . name , selector ) ) { char [ ] [ ] importName = importBinding . reference . tokens ; TypeBinding referencedType = getType ( importName , importName . length - <NUM_LIT:1> ) ; if ( referencedType != null ) possible = findMethod ( ( ReferenceBinding ) referencedType , selector , argumentTypes , invocationSite , true ) ; } } } if ( possible != null && possible != foundProblem ) { if ( ! possible . isValidBinding ( ) ) { if ( foundProblem == null ) foundProblem = possible ; } else if ( possible . isStatic ( ) ) { MethodBinding compatibleMethod = computeCompatibleMethod ( possible , argumentTypes , invocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) { if ( compatibleMethod . canBeSeenBy ( unitScope . fPackage ) ) { if ( visible == null || ! visible . contains ( compatibleMethod ) ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( ! skipOnDemand && ! importBinding . onDemand ) { visible = null ; skipOnDemand = true ; } if ( visible == null ) visible = new ObjectVector ( <NUM_LIT:3> ) ; visible . add ( compatibleMethod ) ; } } else if ( foundProblem == null ) { foundProblem = new ProblemMethodBinding ( compatibleMethod , selector , compatibleMethod . parameters , ProblemReasons . NotVisible ) ; } } else if ( foundProblem == null ) { foundProblem = compatibleMethod ; } } else if ( foundProblem == null ) { foundProblem = new ProblemMethodBinding ( possible , selector , argumentTypes , ProblemReasons . NotFound ) ; } } } } } if ( visible != null ) { MethodBinding [ ] temp = new MethodBinding [ visible . size ] ; visible . copyInto ( temp ) ; foundMethod = mostSpecificMethodBinding ( temp , temp . length , argumentTypes , invocationSite , null ) ; } } } if ( foundMethod != null ) { invocationSite . setActualReceiverType ( foundMethod . declaringClass ) ; return foundMethod ; } if ( foundProblem != null ) return foundProblem ; return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; } public final ReferenceBinding getJavaIoSerializable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_IO_SERIALIZABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_IO_SERIALIZABLE , this ) ; } public final ReferenceBinding getJavaLangAnnotationAnnotation ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ANNOTATION_ANNOTATION , this ) ; } public final ReferenceBinding getJavaLangAssertionError ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ASSERTIONERROR ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ASSERTIONERROR , this ) ; } public final ReferenceBinding getJavaLangClass ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_CLASS ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_CLASS , this ) ; } public final ReferenceBinding getJavaLangCloneable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_CLONEABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_CLONEABLE , this ) ; } public final ReferenceBinding getJavaLangEnum ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ENUM ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ENUM , this ) ; } public final ReferenceBinding getJavaLangIterable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_ITERABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_ITERABLE , this ) ; } public final ReferenceBinding getJavaLangObject ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_OBJECT ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , this ) ; } public final ReferenceBinding getJavaLangString ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_STRING ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_STRING , this ) ; } public final ReferenceBinding getJavaLangThrowable ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_LANG_THROWABLE ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_LANG_THROWABLE , this ) ; } public final ReferenceBinding getJavaUtilIterator ( ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( TypeConstants . JAVA_UTIL_ITERATOR ) ; return unitScope . environment . getResolvedType ( TypeConstants . JAVA_UTIL_ITERATOR , this ) ; } public final ReferenceBinding getMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { ReferenceBinding memberType = findMemberType ( typeName , enclosingType ) ; if ( memberType != null ) return memberType ; char [ ] [ ] compoundName = new char [ ] [ ] { typeName } ; return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; } public MethodBinding getMethod ( TypeBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { CompilationUnitScope unitScope = compilationUnitScope ( ) ; LookupEnvironment env = unitScope . environment ; try { env . missingClassFileLocation = invocationSite ; switch ( receiverType . kind ( ) ) { case Binding . BASE_TYPE : return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; case Binding . ARRAY_TYPE : unitScope . recordTypeReference ( receiverType ) ; return findMethodForArray ( ( ArrayBinding ) receiverType , selector , argumentTypes , invocationSite ) ; } unitScope . recordTypeReference ( receiverType ) ; ReferenceBinding currentType = ( ReferenceBinding ) receiverType ; if ( ! currentType . canBeSeenBy ( this ) ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . ReceiverTypeNotVisible ) ; MethodBinding methodBinding = findExactMethod ( currentType , selector , argumentTypes , invocationSite ) ; if ( methodBinding != null ) return methodBinding ; methodBinding = findMethod ( currentType , selector , argumentTypes , invocationSite ) ; if ( methodBinding == null ) { methodBinding = oneLastLook ( currentType , selector , argumentTypes , invocationSite ) ; } if ( methodBinding == null ) return new ProblemMethodBinding ( selector , argumentTypes , ProblemReasons . NotFound ) ; if ( ! methodBinding . isValidBinding ( ) ) return methodBinding ; if ( argumentTypes == Binding . NO_PARAMETERS && CharOperation . equals ( selector , TypeConstants . GETCLASS ) && methodBinding . returnType . isParameterizedType ( ) ) { return environment ( ) . createGetClassMethod ( receiverType , methodBinding , this ) ; } return methodBinding ; } catch ( AbortCompilation e ) { e . updateContext ( invocationSite , referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public final Binding getPackage ( char [ ] [ ] compoundName ) { compilationUnitScope ( ) . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . TYPE | Binding . PACKAGE , true ) ; if ( binding == null ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , compoundName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , null , ProblemReasons . NotFound ) ; } return binding ; } if ( ! ( binding instanceof PackageBinding ) ) return null ; int currentIndex = <NUM_LIT:1> , length = compoundName . length ; PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) return packageBinding ; packageBinding = ( PackageBinding ) binding ; } return new ProblemReferenceBinding ( compoundName , null , ProblemReasons . NotFound ) ; } public final Binding getOnlyPackage ( char [ ] [ ] compoundName ) { compilationUnitScope ( ) . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . PACKAGE , true ) ; if ( binding == null || ! binding . isValidBinding ( ) ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , null , ProblemReasons . NotFound ) ; } if ( ! ( binding instanceof PackageBinding ) ) { return null ; } int currentIndex = <NUM_LIT:1> , length = compoundName . length ; PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < length ) { binding = packageBinding . getPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; } packageBinding = ( PackageBinding ) binding ; } return packageBinding ; } public final TypeBinding getType ( char [ ] name ) { TypeBinding binding = getBaseType ( name ) ; if ( binding != null ) return binding ; return ( ReferenceBinding ) getTypeOrPackage ( name , Binding . TYPE , true ) ; } public final TypeBinding getType ( char [ ] name , PackageBinding packageBinding ) { if ( packageBinding == null ) return getType ( name ) ; Binding binding = packageBinding . getTypeOrPackage ( name ) ; if ( binding == null ) { return new ProblemReferenceBinding ( CharOperation . arrayConcat ( packageBinding . compoundName , name ) , null , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { return new ProblemReferenceBinding ( binding instanceof ReferenceBinding ? ( ( ReferenceBinding ) binding ) . compoundName : CharOperation . arrayConcat ( packageBinding . compoundName , name ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( typeBinding . compoundName , typeBinding , ProblemReasons . NotVisible ) ; return typeBinding ; } public final TypeBinding getType ( char [ ] [ ] compoundName , int typeNameLength ) { if ( typeNameLength == <NUM_LIT:1> ) { TypeBinding binding = getBaseType ( compoundName [ <NUM_LIT:0> ] ) ; if ( binding != null ) return binding ; } CompilationUnitScope unitScope = compilationUnitScope ( ) ; unitScope . recordQualifiedReference ( compoundName ) ; Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , typeNameLength == <NUM_LIT:1> ? Binding . TYPE : Binding . TYPE | Binding . PACKAGE , true ) ; if ( binding == null ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( compilationUnitScope ( ) . getCurrentPackage ( ) , qName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) { if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = new char [ ] [ ] { compoundName [ <NUM_LIT:0> ] } ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , qName ) , ProblemReasons . NotFound ) ; } return ( ReferenceBinding ) binding ; } int currentIndex = <NUM_LIT:1> ; boolean checkVisibility = false ; if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < typeNameLength ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) { char [ ] [ ] qName = CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( packageBinding , qName ) , ProblemReasons . NotFound ) ; } if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) break ; packageBinding = ( PackageBinding ) binding ; } if ( binding instanceof PackageBinding ) { char [ ] [ ] qName = CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) ; return new ProblemReferenceBinding ( qName , environment ( ) . createMissingType ( null , qName ) , ProblemReasons . NotFound ) ; } checkVisibility = true ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; unitScope . recordTypeReference ( typeBinding ) ; if ( checkVisibility ) if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotVisible ) ; while ( currentIndex < typeNameLength ) { typeBinding = getMemberType ( compoundName [ currentIndex ++ ] , typeBinding ) ; if ( ! typeBinding . isValidBinding ( ) ) { if ( typeBinding instanceof ProblemReferenceBinding ) { ProblemReferenceBinding problemBinding = ( ProblemReferenceBinding ) typeBinding ; return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , problemBinding . closestReferenceMatch ( ) , typeBinding . problemId ( ) ) ; } return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) , typeBinding . problemId ( ) ) ; } } return typeBinding ; } final Binding getTypeOrPackage ( char [ ] name , int mask , boolean needResolve ) { Scope scope = this ; ReferenceBinding foundType = null ; boolean insideStaticContext = false ; boolean insideTypeAnnotation = false ; if ( ( mask & Binding . TYPE ) == <NUM_LIT:0> ) { Scope next = scope ; while ( ( next = scope . parent ) != null ) scope = next ; } else { boolean inheritedHasPrecedence = compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ; done : while ( true ) { switch ( scope . kind ) { case METHOD_SCOPE : MethodScope methodScope = ( MethodScope ) scope ; AbstractMethodDeclaration methodDecl = methodScope . referenceMethod ( ) ; if ( methodDecl != null ) { if ( methodDecl . binding != null ) { TypeVariableBinding typeVariable = methodDecl . binding . getTypeVariable ( name ) ; if ( typeVariable != null ) return typeVariable ; } else { TypeParameter [ ] params = methodDecl . typeParameters ( ) ; for ( int i = params == null ? <NUM_LIT:0> : params . length ; -- i >= <NUM_LIT:0> ; ) if ( CharOperation . equals ( params [ i ] . name , name ) ) if ( params [ i ] . binding != null && params [ i ] . binding . isValidBinding ( ) ) return params [ i ] . binding ; } } insideStaticContext |= methodScope . isStatic ; insideTypeAnnotation = methodScope . insideTypeAnnotation ; case BLOCK_SCOPE : ReferenceBinding localType = ( ( BlockScope ) scope ) . findLocalType ( name ) ; if ( localType != null ) { if ( foundType != null && foundType != localType ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; return localType ; } break ; case CLASS_SCOPE : SourceTypeBinding sourceType = ( ( ClassScope ) scope ) . referenceContext . binding ; if ( scope == this && ( sourceType . tagBits & TagBits . TypeVariablesAreConnected ) == <NUM_LIT:0> ) { TypeVariableBinding typeVariable = sourceType . getTypeVariable ( name ) ; if ( typeVariable != null ) return typeVariable ; if ( CharOperation . equals ( name , sourceType . sourceName ) ) return sourceType ; insideStaticContext |= sourceType . isStatic ( ) ; break ; } if ( ! insideTypeAnnotation ) { ReferenceBinding memberType = findMemberType ( name , sourceType ) ; if ( memberType != null ) { if ( memberType . problemId ( ) == ProblemReasons . Ambiguous ) { if ( foundType == null || foundType . problemId ( ) == ProblemReasons . NotVisible ) return memberType ; return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; } if ( memberType . isValidBinding ( ) ) { if ( sourceType == memberType . enclosingType ( ) || inheritedHasPrecedence ) { if ( insideStaticContext && ! memberType . isStatic ( ) && sourceType . isGenericType ( ) ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , memberType , ProblemReasons . NonStaticReferenceInStaticContext ) ; if ( foundType == null || ( inheritedHasPrecedence && foundType . problemId ( ) == ProblemReasons . NotVisible ) ) return memberType ; if ( foundType . isValidBinding ( ) && foundType != memberType ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( foundType == null || ( foundType . problemId ( ) == ProblemReasons . NotVisible && memberType . problemId ( ) != ProblemReasons . NotVisible ) ) foundType = memberType ; } } TypeVariableBinding typeVariable = sourceType . getTypeVariable ( name ) ; if ( typeVariable != null ) { if ( insideStaticContext ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , typeVariable , ProblemReasons . NonStaticReferenceInStaticContext ) ; return typeVariable ; } insideStaticContext |= sourceType . isStatic ( ) ; insideTypeAnnotation = false ; if ( CharOperation . equals ( sourceType . sourceName , name ) ) { if ( foundType != null && foundType != sourceType && foundType . problemId ( ) != ProblemReasons . NotVisible ) return new ProblemReferenceBinding ( new char [ ] [ ] { name } , foundType , ProblemReasons . InheritedNameHidesEnclosingName ) ; return sourceType ; } break ; case COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( foundType != null && foundType . problemId ( ) != ProblemReasons . NotVisible ) return foundType ; } CompilationUnitScope unitScope = ( CompilationUnitScope ) scope ; HashtableOfObject typeOrPackageCache = unitScope . typeOrPackageCache ; if ( typeOrPackageCache != null ) { Binding cachedBinding = ( Binding ) typeOrPackageCache . get ( name ) ; if ( cachedBinding != null ) { if ( cachedBinding instanceof ImportBinding ) { ImportReference importReference = ( ( ImportBinding ) cachedBinding ) . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( cachedBinding instanceof ImportConflictBinding ) typeOrPackageCache . put ( name , cachedBinding = ( ( ImportConflictBinding ) cachedBinding ) . conflictingTypeBinding ) ; else typeOrPackageCache . put ( name , cachedBinding = ( ( ImportBinding ) cachedBinding ) . resolvedImport ) ; } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { if ( foundType != null && foundType . problemId ( ) != ProblemReasons . NotVisible && cachedBinding . problemId ( ) != ProblemReasons . Ambiguous ) return foundType ; if ( cachedBinding instanceof ReferenceBinding ) return cachedBinding ; } if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> && cachedBinding instanceof PackageBinding ) return cachedBinding ; } } if ( ( mask & Binding . TYPE ) != <NUM_LIT:0> ) { ImportBinding [ ] imports = unitScope . imports ; if ( imports != null && typeOrPackageCache == null ) { nextImport : for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( ! importBinding . onDemand ) { if ( CharOperation . equals ( getSimpleName ( importBinding ) , name ) ) { Binding resolvedImport = unitScope . resolveSingleImport ( importBinding , Binding . TYPE ) ; if ( resolvedImport == null ) continue nextImport ; if ( resolvedImport instanceof TypeBinding ) { ImportReference importReference = importBinding . reference ; if ( importReference != null ) importReference . bits |= ASTNode . Used ; return resolvedImport ; } } } } } if ( imports != null ) { ReferenceBinding type = null ; nextImport : for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding importBinding = imports [ i ] ; if ( importBinding . isStatic ( ) ) { ReferenceBinding temp = null ; if ( CharOperation . equals ( importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] , name ) ) { Binding resolvedImport = importBinding . resolvedImport ; if ( resolvedImport == null ) continue nextImport ; if ( resolvedImport instanceof MethodBinding || resolvedImport instanceof FieldBinding ) { char [ ] [ ] importName = importBinding . reference . tokens ; TypeBinding referencedType = getType ( importName , importName . length - <NUM_LIT:1> ) ; if ( referencedType != null && referencedType instanceof ReferenceBinding ) { temp = findMemberType ( name , ( ReferenceBinding ) referencedType ) ; } } if ( temp != null && temp . isStatic ( ) && temp != type ) { if ( temp . isValidBinding ( ) ) { if ( ! temp . canBeSeenBy ( unitScope . fPackage ) ) { foundType = new ProblemReferenceBinding ( new char [ ] [ ] { name } , type , ProblemReasons . NotVisible ) ; } else { ImportReference importReference = importBinding . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } type = temp ; } } else if ( foundType == null ) { foundType = temp ; } } } } } if ( type != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , type ) ; return type ; } } PackageBinding currentPackage = unitScope . fPackage ; unitScope . recordReference ( currentPackage . compoundName , name ) ; Binding binding = currentPackage . getTypeOrPackage ( name ) ; if ( binding instanceof ReferenceBinding ) { ReferenceBinding referenceType = ( ReferenceBinding ) binding ; if ( ( referenceType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , referenceType ) ; return referenceType ; } } if ( imports != null ) { boolean foundInImport = false ; ReferenceBinding type = null ; for ( int i = <NUM_LIT:0> , length = imports . length ; i < length ; i ++ ) { ImportBinding someImport = imports [ i ] ; if ( someImport . onDemand ) { Binding resolvedImport = someImport . resolvedImport ; ReferenceBinding temp = null ; if ( resolvedImport instanceof PackageBinding ) { temp = findType ( name , ( PackageBinding ) resolvedImport , currentPackage ) ; } else if ( someImport . isStatic ( ) ) { temp = findMemberType ( name , ( ReferenceBinding ) resolvedImport ) ; if ( temp != null && ! temp . isStatic ( ) ) temp = null ; } else { temp = findDirectMemberType ( name , ( ReferenceBinding ) resolvedImport ) ; } if ( temp != type && temp != null ) { if ( temp . isValidBinding ( ) ) { boolean conflict = true ; if ( this . parent != null && foundInImport ) { CompilationUnitScope cuScope = compilationUnitScope ( ) ; if ( cuScope != null ) { ReferenceBinding chosenBinding = cuScope . selectBinding ( temp , type , someImport . reference != null ) ; if ( chosenBinding != null ) { conflict = false ; foundInImport = true ; type = chosenBinding ; } } } if ( conflict ) { ImportReference importReference = someImport . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } if ( foundInImport ) { temp = new ProblemReferenceBinding ( new char [ ] [ ] { name } , type , ProblemReasons . Ambiguous ) ; if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , temp ) ; return temp ; } type = temp ; foundInImport = true ; } } else if ( foundType == null ) { foundType = temp ; } } } } if ( type != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , type ) ; return type ; } } } unitScope . recordSimpleReference ( name ) ; if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding != null ) { if ( typeOrPackageCache != null ) typeOrPackageCache . put ( name , packageBinding ) ; return packageBinding ; } } if ( foundType == null ) { char [ ] [ ] qName = new char [ ] [ ] { name } ; ReferenceBinding closestMatch = null ; if ( ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { if ( needResolve ) { closestMatch = environment ( ) . createMissingType ( unitScope . fPackage , qName ) ; } } else { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding == null || ! packageBinding . isValidBinding ( ) ) { if ( needResolve ) { closestMatch = environment ( ) . createMissingType ( unitScope . fPackage , qName ) ; } } } foundType = new ProblemReferenceBinding ( qName , closestMatch , ProblemReasons . NotFound ) ; if ( typeOrPackageCache != null && ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) { typeOrPackageCache . put ( name , foundType ) ; } } else if ( ( foundType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { char [ ] [ ] qName = new char [ ] [ ] { name } ; foundType = new ProblemReferenceBinding ( qName , foundType , ProblemReasons . NotFound ) ; if ( typeOrPackageCache != null && ( mask & Binding . PACKAGE ) != <NUM_LIT:0> ) typeOrPackageCache . put ( name , foundType ) ; } return foundType ; } public final Binding getTypeOrPackage ( char [ ] [ ] compoundName ) { int nameLength = compoundName . length ; if ( nameLength == <NUM_LIT:1> ) { TypeBinding binding = getBaseType ( compoundName [ <NUM_LIT:0> ] ) ; if ( binding != null ) return binding ; } Binding binding = getTypeOrPackage ( compoundName [ <NUM_LIT:0> ] , Binding . TYPE | Binding . PACKAGE , true ) ; if ( ! binding . isValidBinding ( ) ) return binding ; int currentIndex = <NUM_LIT:1> ; boolean checkVisibility = false ; if ( binding instanceof PackageBinding ) { PackageBinding packageBinding = ( PackageBinding ) binding ; while ( currentIndex < nameLength ) { binding = packageBinding . getTypeOrPackage ( compoundName [ currentIndex ++ ] ) ; if ( binding == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , null , ProblemReasons . NotFound ) ; if ( ! binding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , binding instanceof ReferenceBinding ? ( ReferenceBinding ) ( ( ReferenceBinding ) binding ) . closestMatch ( ) : null , binding . problemId ( ) ) ; if ( ! ( binding instanceof PackageBinding ) ) break ; packageBinding = ( PackageBinding ) binding ; } if ( binding instanceof PackageBinding ) return binding ; checkVisibility = true ; } ReferenceBinding typeBinding = ( ReferenceBinding ) binding ; ReferenceBinding qualifiedType = ( ReferenceBinding ) environment ( ) . convertToRawType ( typeBinding , false ) ; if ( checkVisibility ) if ( ! typeBinding . canBeSeenBy ( this ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , typeBinding , ProblemReasons . NotVisible ) ; while ( currentIndex < nameLength ) { typeBinding = getMemberType ( compoundName [ currentIndex ++ ] , typeBinding ) ; if ( ! typeBinding . isValidBinding ( ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , <NUM_LIT:0> , currentIndex ) , ( ReferenceBinding ) typeBinding . closestMatch ( ) , typeBinding . problemId ( ) ) ; if ( typeBinding . isGenericType ( ) ) { qualifiedType = environment ( ) . createRawType ( typeBinding , qualifiedType ) ; } else { qualifiedType = ( qualifiedType != null && ( qualifiedType . isRawType ( ) || qualifiedType . isParameterizedType ( ) ) ) ? environment ( ) . createParameterizedType ( typeBinding , null , qualifiedType ) : typeBinding ; } } return qualifiedType ; } protected boolean hasErasedCandidatesCollisions ( TypeBinding one , TypeBinding two , Map invocations , ReferenceBinding type , ASTNode typeRef ) { invocations . clear ( ) ; TypeBinding [ ] mecs = minimalErasedCandidates ( new TypeBinding [ ] { one , two } , invocations ) ; if ( mecs != null ) { nextCandidate : for ( int k = <NUM_LIT:0> , max = mecs . length ; k < max ; k ++ ) { TypeBinding mec = mecs [ k ] ; if ( mec == null ) continue nextCandidate ; Object value = invocations . get ( mec ) ; if ( value instanceof TypeBinding [ ] ) { TypeBinding [ ] invalidInvocations = ( TypeBinding [ ] ) value ; problemReporter ( ) . superinterfacesCollide ( invalidInvocations [ <NUM_LIT:0> ] . erasure ( ) , typeRef , invalidInvocations [ <NUM_LIT:0> ] , invalidInvocations [ <NUM_LIT:1> ] ) ; type . tagBits |= TagBits . HierarchyHasProblems ; return true ; } } } return false ; } protected char [ ] getSimpleName ( ImportBinding importBinding ) { if ( importBinding . reference == null ) { return importBinding . compoundName [ importBinding . compoundName . length - <NUM_LIT:1> ] ; } else { return importBinding . reference . getSimpleName ( ) ; } } public CaseStatement innermostSwitchCase ( ) { Scope scope = this ; do { if ( scope instanceof BlockScope ) return ( ( BlockScope ) scope ) . enclosingCase ; scope = scope . parent ; } while ( scope != null ) ; return null ; } protected boolean isAcceptableMethod ( MethodBinding one , MethodBinding two ) { TypeBinding [ ] oneParams = one . parameters ; TypeBinding [ ] twoParams = two . parameters ; int oneParamsLength = oneParams . length ; int twoParamsLength = twoParams . length ; if ( oneParamsLength == twoParamsLength ) { boolean applyErasure = environment ( ) . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 ; next : for ( int i = <NUM_LIT:0> ; i < oneParamsLength ; i ++ ) { TypeBinding oneParam = applyErasure ? oneParams [ i ] . erasure ( ) : oneParams [ i ] ; TypeBinding twoParam = applyErasure ? twoParams [ i ] . erasure ( ) : twoParams [ i ] ; if ( oneParam == twoParam || oneParam . isCompatibleWith ( twoParam ) ) { if ( two . declaringClass . isRawType ( ) ) continue next ; TypeBinding leafComponentType = two . original ( ) . parameters [ i ] . leafComponentType ( ) ; TypeBinding originalTwoParam = applyErasure ? leafComponentType . erasure ( ) : leafComponentType ; switch ( originalTwoParam . kind ( ) ) { case Binding . TYPE_PARAMETER : if ( ( ( TypeVariableBinding ) originalTwoParam ) . hasOnlyRawBounds ( ) ) continue next ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : case Binding . PARAMETERIZED_TYPE : TypeBinding originalOneParam = one . original ( ) . parameters [ i ] . leafComponentType ( ) ; switch ( originalOneParam . kind ( ) ) { case Binding . TYPE : case Binding . GENERIC_TYPE : TypeBinding inheritedTwoParam = oneParam . findSuperTypeOriginatingFrom ( twoParam ) ; if ( inheritedTwoParam == null || ! inheritedTwoParam . leafComponentType ( ) . isRawType ( ) ) break ; return false ; case Binding . TYPE_PARAMETER : if ( ! ( ( TypeVariableBinding ) originalOneParam ) . upperBound ( ) . isRawType ( ) ) break ; return false ; case Binding . RAW_TYPE : return false ; } } } else { if ( i == oneParamsLength - <NUM_LIT:1> && one . isVarargs ( ) && two . isVarargs ( ) ) { TypeBinding oType = ( ( ArrayBinding ) oneParam ) . elementsType ( ) ; TypeBinding eType = ( ( ArrayBinding ) twoParam ) . elementsType ( ) ; if ( CompilerOptions . tolerateIllegalAmbiguousVarargsInvocation && this . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( oneParam == eType || oneParam . isCompatibleWith ( eType ) ) return true ; } else { if ( oType == eType || oType . isCompatibleWith ( eType ) ) return true ; } } return false ; } } return true ; } if ( one . isVarargs ( ) && two . isVarargs ( ) ) { if ( CompilerOptions . tolerateIllegalAmbiguousVarargsInvocation && this . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 && oneParamsLength > twoParamsLength ) { if ( ( ( ArrayBinding ) twoParams [ twoParamsLength - <NUM_LIT:1> ] ) . elementsType ( ) . id != TypeIds . T_JavaLangObject ) return false ; } for ( int i = ( oneParamsLength > twoParamsLength ? twoParamsLength : oneParamsLength ) - <NUM_LIT:2> ; i >= <NUM_LIT:0> ; i -- ) if ( oneParams [ i ] != twoParams [ i ] && ! oneParams [ i ] . isCompatibleWith ( twoParams [ i ] ) ) return false ; if ( parameterCompatibilityLevel ( one , twoParams , true ) == NOT_COMPATIBLE && parameterCompatibilityLevel ( two , oneParams , true ) == VARARGS_COMPATIBLE ) return true ; } return false ; } public boolean isBoxingCompatibleWith ( TypeBinding expressionType , TypeBinding targetType ) { LookupEnvironment environment = environment ( ) ; if ( environment . globalOptions . sourceLevel < ClassFileConstants . JDK1_5 || expressionType . isBaseType ( ) == targetType . isBaseType ( ) ) return false ; TypeBinding convertedType = environment . computeBoxingType ( expressionType ) ; return convertedType == targetType || convertedType . isCompatibleWith ( targetType ) ; } public final boolean isDefinedInField ( FieldBinding field ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) { MethodScope methodScope = ( MethodScope ) scope ; if ( methodScope . initializedField == field ) return true ; } scope = scope . parent ; } while ( scope != null ) ; return false ; } public final boolean isDefinedInMethod ( MethodBinding method ) { method = method . original ( ) ; Scope scope = this ; do { if ( scope instanceof MethodScope ) { ReferenceContext refContext = ( ( MethodScope ) scope ) . referenceContext ; if ( refContext instanceof AbstractMethodDeclaration ) if ( ( ( AbstractMethodDeclaration ) refContext ) . binding == method ) return true ; } scope = scope . parent ; } while ( scope != null ) ; return false ; } public final boolean isDefinedInSameUnit ( ReferenceBinding type ) { ReferenceBinding enclosingType = type ; while ( ( type = enclosingType . enclosingType ( ) ) != null ) enclosingType = type ; Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; SourceTypeBinding [ ] topLevelTypes = ( ( CompilationUnitScope ) unitScope ) . topLevelTypes ; for ( int i = topLevelTypes . length ; -- i >= <NUM_LIT:0> ; ) if ( topLevelTypes [ i ] == enclosingType . original ( ) ) return true ; return false ; } public final boolean isDefinedInType ( ReferenceBinding type ) { Scope scope = this ; do { if ( scope instanceof ClassScope ) if ( ( ( ClassScope ) scope ) . referenceContext . binding == type ) return true ; scope = scope . parent ; } while ( scope != null ) ; return false ; } public boolean isInsideCase ( CaseStatement caseStatement ) { Scope scope = this ; do { switch ( scope . kind ) { case Scope . BLOCK_SCOPE : if ( ( ( BlockScope ) scope ) . enclosingCase == caseStatement ) { return true ; } } scope = scope . parent ; } while ( scope != null ) ; return false ; } public boolean isInsideDeprecatedCode ( ) { switch ( this . kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( context != null && context . isViewedAsDeprecated ( ) ) return true ; } else if ( methodScope . initializedField != null && methodScope . initializedField . isViewedAsDeprecated ( ) ) { return true ; } SourceTypeBinding declaringType = ( ( BlockScope ) this ) . referenceType ( ) . binding ; if ( declaringType != null ) { declaringType . initializeDeprecatedAnnotationTagBits ( ) ; if ( declaringType . isViewedAsDeprecated ( ) ) return true ; } break ; case Scope . CLASS_SCOPE : ReferenceBinding context = ( ( ClassScope ) this ) . referenceType ( ) . binding ; if ( context != null ) { context . initializeDeprecatedAnnotationTagBits ( ) ; if ( context . isViewedAsDeprecated ( ) ) return true ; } break ; case Scope . COMPILATION_UNIT_SCOPE : CompilationUnitDeclaration unit = referenceCompilationUnit ( ) ; if ( unit . types != null && unit . types . length > <NUM_LIT:0> ) { SourceTypeBinding type = unit . types [ <NUM_LIT:0> ] . binding ; if ( type != null ) { type . initializeDeprecatedAnnotationTagBits ( ) ; if ( type . isViewedAsDeprecated ( ) ) return true ; } } } return false ; } private boolean isOverriddenMethodGeneric ( MethodBinding method ) { MethodVerifier verifier = environment ( ) . methodVerifier ( ) ; ReferenceBinding currentType = method . declaringClass . superclass ( ) ; while ( currentType != null ) { MethodBinding [ ] currentMethods = currentType . getMethods ( method . selector ) ; for ( int i = <NUM_LIT:0> , l = currentMethods . length ; i < l ; i ++ ) { MethodBinding currentMethod = currentMethods [ i ] ; if ( currentMethod != null && currentMethod . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) if ( verifier . doesMethodOverride ( method , currentMethod ) ) return true ; } currentType = currentType . superclass ( ) ; } return false ; } public boolean isPossibleSubtypeOfRawType ( TypeBinding paramType ) { TypeBinding t = paramType . leafComponentType ( ) ; if ( t . isBaseType ( ) ) return false ; ReferenceBinding currentType = ( ReferenceBinding ) t ; ReferenceBinding [ ] interfacesToVisit = null ; int nextPosition = <NUM_LIT:0> ; do { if ( currentType . isRawType ( ) ) return true ; if ( ! currentType . isHierarchyConnected ( ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { if ( interfacesToVisit == null ) { interfacesToVisit = itsInterfaces ; nextPosition = interfacesToVisit . length ; } else { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } } while ( ( currentType = currentType . superclass ( ) ) != null ) ; for ( int i = <NUM_LIT:0> ; i < nextPosition ; i ++ ) { currentType = interfacesToVisit [ i ] ; if ( currentType . isRawType ( ) ) return true ; ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null && itsInterfaces != Binding . NO_SUPERINTERFACES ) { int itsLength = itsInterfaces . length ; if ( nextPosition + itsLength >= interfacesToVisit . length ) System . arraycopy ( interfacesToVisit , <NUM_LIT:0> , interfacesToVisit = new ReferenceBinding [ nextPosition + itsLength + <NUM_LIT:5> ] , <NUM_LIT:0> , nextPosition ) ; nextInterface : for ( int a = <NUM_LIT:0> ; a < itsLength ; a ++ ) { ReferenceBinding next = itsInterfaces [ a ] ; for ( int b = <NUM_LIT:0> ; b < nextPosition ; b ++ ) if ( next == interfacesToVisit [ b ] ) continue nextInterface ; interfacesToVisit [ nextPosition ++ ] = next ; } } } return false ; } private TypeBinding leastContainingInvocation ( TypeBinding mec , Object invocationData , List lubStack ) { if ( invocationData == null ) return mec ; if ( invocationData instanceof TypeBinding ) { return ( TypeBinding ) invocationData ; } TypeBinding [ ] invocations = ( TypeBinding [ ] ) invocationData ; int dim = mec . dimensions ( ) ; mec = mec . leafComponentType ( ) ; int argLength = mec . typeVariables ( ) . length ; if ( argLength == <NUM_LIT:0> ) return mec ; TypeBinding [ ] bestArguments = new TypeBinding [ argLength ] ; for ( int i = <NUM_LIT:0> , length = invocations . length ; i < length ; i ++ ) { TypeBinding invocation = invocations [ i ] . leafComponentType ( ) ; switch ( invocation . kind ( ) ) { case Binding . GENERIC_TYPE : TypeVariableBinding [ ] invocationVariables = invocation . typeVariables ( ) ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeBinding bestArgument = leastContainingTypeArgument ( bestArguments [ j ] , invocationVariables [ j ] , ( ReferenceBinding ) mec , j , lubStack ) ; if ( bestArgument == null ) return null ; bestArguments [ j ] = bestArgument ; } break ; case Binding . PARAMETERIZED_TYPE : ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) invocation ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeBinding bestArgument = leastContainingTypeArgument ( bestArguments [ j ] , parameterizedType . arguments [ j ] , ( ReferenceBinding ) mec , j , lubStack ) ; if ( bestArgument == null ) return null ; bestArguments [ j ] = bestArgument ; } break ; case Binding . RAW_TYPE : return dim == <NUM_LIT:0> ? invocation : environment ( ) . createArrayType ( invocation , dim ) ; } } TypeBinding least = environment ( ) . createParameterizedType ( ( ReferenceBinding ) mec . erasure ( ) , bestArguments , mec . enclosingType ( ) ) ; return dim == <NUM_LIT:0> ? least : environment ( ) . createArrayType ( least , dim ) ; } private TypeBinding leastContainingTypeArgument ( TypeBinding u , TypeBinding v , ReferenceBinding genericType , int rank , List lubStack ) { if ( u == null ) return v ; if ( u == v ) return u ; if ( v . isWildcard ( ) ) { WildcardBinding wildV = ( WildcardBinding ) v ; if ( u . isWildcard ( ) ) { WildcardBinding wildU = ( WildcardBinding ) u ; switch ( wildU . boundKind ) { case Wildcard . EXTENDS : switch ( wildV . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { wildU . bound , wildV . bound } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : if ( wildU . bound == wildV . bound ) return wildU . bound ; return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; } break ; case Wildcard . SUPER : if ( wildU . boundKind == Wildcard . SUPER ) { TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { wildU . bound , wildV . bound } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; } } } else { switch ( wildV . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { u , wildV . bound } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { u , wildV . bound } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; case Wildcard . UNBOUND : } } } else if ( u . isWildcard ( ) ) { WildcardBinding wildU = ( WildcardBinding ) u ; switch ( wildU . boundKind ) { case Wildcard . EXTENDS : TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { wildU . bound , v } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; case Wildcard . SUPER : TypeBinding [ ] glb = greaterLowerBound ( new TypeBinding [ ] { wildU . bound , v } ) ; if ( glb == null ) return null ; return environment ( ) . createWildcard ( genericType , rank , glb [ <NUM_LIT:0> ] , null , Wildcard . SUPER ) ; case Wildcard . UNBOUND : } } TypeBinding lub = lowerUpperBound ( new TypeBinding [ ] { u , v } , lubStack ) ; if ( lub == null ) return null ; if ( lub == TypeBinding . INT ) return environment ( ) . createWildcard ( genericType , rank , null , null , Wildcard . UNBOUND ) ; return environment ( ) . createWildcard ( genericType , rank , lub , null , Wildcard . EXTENDS ) ; } public TypeBinding lowerUpperBound ( TypeBinding [ ] types ) { int typeLength = types . length ; if ( typeLength == <NUM_LIT:1> ) { TypeBinding type = types [ <NUM_LIT:0> ] ; return type == null ? TypeBinding . VOID : type ; } return lowerUpperBound ( types , new ArrayList ( <NUM_LIT:1> ) ) ; } private TypeBinding lowerUpperBound ( TypeBinding [ ] types , List lubStack ) { int typeLength = types . length ; if ( typeLength == <NUM_LIT:1> ) { TypeBinding type = types [ <NUM_LIT:0> ] ; return type == null ? TypeBinding . VOID : type ; } int stackLength = lubStack . size ( ) ; nextLubCheck : for ( int i = <NUM_LIT:0> ; i < stackLength ; i ++ ) { TypeBinding [ ] lubTypes = ( TypeBinding [ ] ) lubStack . get ( i ) ; int lubTypeLength = lubTypes . length ; if ( lubTypeLength < typeLength ) continue nextLubCheck ; nextTypeCheck : for ( int j = <NUM_LIT:0> ; j < typeLength ; j ++ ) { TypeBinding type = types [ j ] ; if ( type == null ) continue nextTypeCheck ; for ( int k = <NUM_LIT:0> ; k < lubTypeLength ; k ++ ) { TypeBinding lubType = lubTypes [ k ] ; if ( lubType == null ) continue ; if ( lubType == type || lubType . isEquivalentTo ( type ) ) continue nextTypeCheck ; } continue nextLubCheck ; } return TypeBinding . INT ; } lubStack . add ( types ) ; Map invocations = new HashMap ( <NUM_LIT:1> ) ; TypeBinding [ ] mecs = minimalErasedCandidates ( types , invocations ) ; if ( mecs == null ) return null ; int length = mecs . length ; if ( length == <NUM_LIT:0> ) return TypeBinding . VOID ; int count = <NUM_LIT:0> ; TypeBinding firstBound = null ; int commonDim = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding mec = mecs [ i ] ; if ( mec == null ) continue ; mec = leastContainingInvocation ( mec , invocations . get ( mec ) , lubStack ) ; if ( mec == null ) return null ; int dim = mec . dimensions ( ) ; if ( commonDim == - <NUM_LIT:1> ) { commonDim = dim ; } else if ( dim != commonDim ) { return null ; } if ( firstBound == null && ! mec . leafComponentType ( ) . isInterface ( ) ) firstBound = mec . leafComponentType ( ) ; mecs [ count ++ ] = mec ; } switch ( count ) { case <NUM_LIT:0> : return TypeBinding . VOID ; case <NUM_LIT:1> : return mecs [ <NUM_LIT:0> ] ; case <NUM_LIT:2> : if ( ( commonDim == <NUM_LIT:0> ? mecs [ <NUM_LIT:1> ] . id : mecs [ <NUM_LIT:1> ] . leafComponentType ( ) . id ) == TypeIds . T_JavaLangObject ) return mecs [ <NUM_LIT:0> ] ; if ( ( commonDim == <NUM_LIT:0> ? mecs [ <NUM_LIT:0> ] . id : mecs [ <NUM_LIT:0> ] . leafComponentType ( ) . id ) == TypeIds . T_JavaLangObject ) return mecs [ <NUM_LIT:1> ] ; } TypeBinding [ ] otherBounds = new TypeBinding [ count - <NUM_LIT:1> ] ; int rank = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { TypeBinding mec = commonDim == <NUM_LIT:0> ? mecs [ i ] : mecs [ i ] . leafComponentType ( ) ; if ( mec . isInterface ( ) ) { otherBounds [ rank ++ ] = mec ; } } TypeBinding intersectionType = environment ( ) . createWildcard ( null , <NUM_LIT:0> , firstBound , otherBounds , Wildcard . EXTENDS ) ; return commonDim == <NUM_LIT:0> ? intersectionType : environment ( ) . createArrayType ( intersectionType , commonDim ) ; } public final MethodScope methodScope ( ) { Scope scope = this ; do { if ( scope instanceof MethodScope ) return ( MethodScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return null ; } protected TypeBinding [ ] minimalErasedCandidates ( TypeBinding [ ] types , Map allInvocations ) { int length = types . length ; int indexOfFirst = - <NUM_LIT:1> , actualLength = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding type = types [ i ] ; if ( type == null ) continue ; if ( type . isBaseType ( ) ) return null ; if ( indexOfFirst < <NUM_LIT:0> ) indexOfFirst = i ; actualLength ++ ; } switch ( actualLength ) { case <NUM_LIT:0> : return Binding . NO_TYPES ; case <NUM_LIT:1> : return types ; } TypeBinding firstType = types [ indexOfFirst ] ; if ( firstType . isBaseType ( ) ) return null ; ArrayList typesToVisit = new ArrayList ( <NUM_LIT:5> ) ; int dim = firstType . dimensions ( ) ; TypeBinding leafType = firstType . leafComponentType ( ) ; TypeBinding firstErasure ; switch ( leafType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : case Binding . ARRAY_TYPE : firstErasure = firstType . erasure ( ) ; break ; default : firstErasure = firstType ; break ; } if ( firstErasure != firstType ) { allInvocations . put ( firstErasure , firstType ) ; } typesToVisit . add ( firstType ) ; int max = <NUM_LIT:1> ; ReferenceBinding currentType ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { TypeBinding typeToVisit = ( TypeBinding ) typesToVisit . get ( i ) ; dim = typeToVisit . dimensions ( ) ; if ( dim > <NUM_LIT:0> ) { leafType = typeToVisit . leafComponentType ( ) ; switch ( leafType . id ) { case TypeIds . T_JavaLangObject : if ( dim > <NUM_LIT:1> ) { TypeBinding elementType = ( ( ArrayBinding ) typeToVisit ) . elementsType ( ) ; if ( ! typesToVisit . contains ( elementType ) ) { typesToVisit . add ( elementType ) ; max ++ ; } continue ; } case TypeIds . T_byte : case TypeIds . T_short : case TypeIds . T_char : case TypeIds . T_boolean : case TypeIds . T_int : case TypeIds . T_long : case TypeIds . T_float : case TypeIds . T_double : TypeBinding superType = getJavaIoSerializable ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } superType = getJavaLangCloneable ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } superType = getJavaLangObject ( ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; } continue ; default : } typeToVisit = leafType ; } currentType = ( ReferenceBinding ) typeToVisit ; if ( currentType . isCapture ( ) ) { TypeBinding firstBound = ( ( CaptureBinding ) currentType ) . firstBound ; if ( firstBound != null && firstBound . isArrayType ( ) ) { TypeBinding superType = dim == <NUM_LIT:0> ? firstBound : ( TypeBinding ) environment ( ) . createArrayType ( firstBound , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( firstBound . isTypeVariable ( ) || firstBound . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } continue ; } } ReferenceBinding [ ] itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != null ) { for ( int j = <NUM_LIT:0> , count = itsInterfaces . length ; j < count ; j ++ ) { TypeBinding itsInterface = itsInterfaces [ j ] ; TypeBinding superType = dim == <NUM_LIT:0> ? itsInterface : ( TypeBinding ) environment ( ) . createArrayType ( itsInterface , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( itsInterface . isTypeVariable ( ) || itsInterface . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } } } TypeBinding itsSuperclass = currentType . superclass ( ) ; if ( itsSuperclass != null ) { TypeBinding superType = dim == <NUM_LIT:0> ? itsSuperclass : ( TypeBinding ) environment ( ) . createArrayType ( itsSuperclass , dim ) ; if ( ! typesToVisit . contains ( superType ) ) { typesToVisit . add ( superType ) ; max ++ ; TypeBinding superTypeErasure = ( itsSuperclass . isTypeVariable ( ) || itsSuperclass . isWildcard ( ) ) ? superType : superType . erasure ( ) ; if ( superTypeErasure != superType ) { allInvocations . put ( superTypeErasure , superType ) ; } } } } int superLength = typesToVisit . size ( ) ; TypeBinding [ ] erasedSuperTypes = new TypeBinding [ superLength ] ; int rank = <NUM_LIT:0> ; for ( Iterator iter = typesToVisit . iterator ( ) ; iter . hasNext ( ) ; ) { TypeBinding type = ( TypeBinding ) iter . next ( ) ; leafType = type . leafComponentType ( ) ; erasedSuperTypes [ rank ++ ] = ( leafType . isTypeVariable ( ) || leafType . isWildcard ( ) ) ? type : type . erasure ( ) ; } int remaining = superLength ; nextOtherType : for ( int i = indexOfFirst + <NUM_LIT:1> ; i < length ; i ++ ) { TypeBinding otherType = types [ i ] ; if ( otherType == null ) continue nextOtherType ; if ( otherType . isArrayType ( ) ) { nextSuperType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ j ] ; if ( erasedSuperType == null || erasedSuperType == otherType ) continue nextSuperType ; TypeBinding match ; if ( ( match = otherType . findSuperTypeOriginatingFrom ( erasedSuperType ) ) == null ) { erasedSuperTypes [ j ] = null ; if ( -- remaining == <NUM_LIT:0> ) return null ; continue nextSuperType ; } Object invocationData = allInvocations . get ( erasedSuperType ) ; if ( invocationData == null ) { allInvocations . put ( erasedSuperType , match ) ; } else if ( invocationData instanceof TypeBinding ) { if ( match != invocationData ) { TypeBinding [ ] someInvocations = { ( TypeBinding ) invocationData , match , } ; allInvocations . put ( erasedSuperType , someInvocations ) ; } } else { TypeBinding [ ] someInvocations = ( TypeBinding [ ] ) invocationData ; checkExisting : { int invocLength = someInvocations . length ; for ( int k = <NUM_LIT:0> ; k < invocLength ; k ++ ) { if ( someInvocations [ k ] == match ) break checkExisting ; } System . arraycopy ( someInvocations , <NUM_LIT:0> , someInvocations = new TypeBinding [ invocLength + <NUM_LIT:1> ] , <NUM_LIT:0> , invocLength ) ; allInvocations . put ( erasedSuperType , someInvocations ) ; someInvocations [ invocLength ] = match ; } } } continue nextOtherType ; } nextSuperType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ j ] ; if ( erasedSuperType == null ) continue nextSuperType ; TypeBinding match ; if ( erasedSuperType == otherType || erasedSuperType . id == TypeIds . T_JavaLangObject && otherType . isInterface ( ) ) { match = erasedSuperType ; } else { if ( erasedSuperType . isArrayType ( ) ) { match = null ; } else { match = otherType . findSuperTypeOriginatingFrom ( erasedSuperType ) ; } if ( match == null ) { erasedSuperTypes [ j ] = null ; if ( -- remaining == <NUM_LIT:0> ) return null ; continue nextSuperType ; } } Object invocationData = allInvocations . get ( erasedSuperType ) ; if ( invocationData == null ) { allInvocations . put ( erasedSuperType , match ) ; } else if ( invocationData instanceof TypeBinding ) { if ( match != invocationData ) { TypeBinding [ ] someInvocations = { ( TypeBinding ) invocationData , match , } ; allInvocations . put ( erasedSuperType , someInvocations ) ; } } else { TypeBinding [ ] someInvocations = ( TypeBinding [ ] ) invocationData ; checkExisting : { int invocLength = someInvocations . length ; for ( int k = <NUM_LIT:0> ; k < invocLength ; k ++ ) { if ( someInvocations [ k ] == match ) break checkExisting ; } System . arraycopy ( someInvocations , <NUM_LIT:0> , someInvocations = new TypeBinding [ invocLength + <NUM_LIT:1> ] , <NUM_LIT:0> , invocLength ) ; allInvocations . put ( erasedSuperType , someInvocations ) ; someInvocations [ invocLength ] = match ; } } } } if ( remaining > <NUM_LIT:1> ) { nextType : for ( int i = <NUM_LIT:0> ; i < superLength ; i ++ ) { TypeBinding erasedSuperType = erasedSuperTypes [ i ] ; if ( erasedSuperType == null ) continue nextType ; nextOtherType : for ( int j = <NUM_LIT:0> ; j < superLength ; j ++ ) { if ( i == j ) continue nextOtherType ; TypeBinding otherType = erasedSuperTypes [ j ] ; if ( otherType == null ) continue nextOtherType ; if ( erasedSuperType instanceof ReferenceBinding ) { if ( otherType . id == TypeIds . T_JavaLangObject && erasedSuperType . isInterface ( ) ) continue nextOtherType ; if ( erasedSuperType . findSuperTypeOriginatingFrom ( otherType ) != null ) { erasedSuperTypes [ j ] = null ; remaining -- ; } } else if ( erasedSuperType . isArrayType ( ) ) { if ( otherType . isArrayType ( ) && otherType . leafComponentType ( ) . id == TypeIds . T_JavaLangObject && otherType . dimensions ( ) == erasedSuperType . dimensions ( ) && erasedSuperType . leafComponentType ( ) . isInterface ( ) ) continue nextOtherType ; if ( erasedSuperType . findSuperTypeOriginatingFrom ( otherType ) != null ) { erasedSuperTypes [ j ] = null ; remaining -- ; } } } } } return erasedSuperTypes ; } protected final MethodBinding mostSpecificClassMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { MethodBinding previous = null ; nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding method = visible [ i ] ; if ( previous != null && method . declaringClass != previous . declaringClass ) break ; if ( ! method . isStatic ( ) ) previous = method ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j ) continue ; if ( ! visible [ j ] . areParametersCompatibleWith ( method . parameters ) ) continue nextVisible ; } compilationUnitScope ( ) . recordTypeReferences ( method . thrownExceptions ) ; return method ; } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } protected final MethodBinding mostSpecificInterfaceMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding method = visible [ i ] ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j ) continue ; if ( ! visible [ j ] . areParametersCompatibleWith ( method . parameters ) ) continue nextVisible ; } compilationUnitScope ( ) . recordTypeReferences ( method . thrownExceptions ) ; return method ; } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } protected final MethodBinding mostSpecificMethodBinding ( MethodBinding [ ] visible , int visibleSize , TypeBinding [ ] argumentTypes , final InvocationSite invocationSite , ReferenceBinding receiverType ) { int [ ] compatibilityLevels = new int [ visibleSize ] ; for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) compatibilityLevels [ i ] = parameterCompatibilityLevel ( visible [ i ] , argumentTypes ) ; InvocationSite tieBreakInvocationSite = new InvocationSite ( ) { public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public boolean isSuperAccess ( ) { return invocationSite . isSuperAccess ( ) ; } public boolean isTypeAccess ( ) { return invocationSite . isTypeAccess ( ) ; } public void setActualReceiverType ( ReferenceBinding actualReceiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public int sourceStart ( ) { return invocationSite . sourceStart ( ) ; } public int sourceEnd ( ) { return invocationSite . sourceStart ( ) ; } public TypeBinding expectedType ( ) { return invocationSite . expectedType ( ) ; } } ; MethodBinding [ ] moreSpecific = new MethodBinding [ visibleSize ] ; int count = <NUM_LIT:0> ; for ( int level = <NUM_LIT:0> , max = VARARGS_COMPATIBLE ; level <= max ; level ++ ) { nextVisible : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { if ( compatibilityLevels [ i ] != level ) continue nextVisible ; max = level ; MethodBinding current = visible [ i ] ; MethodBinding original = current . original ( ) ; MethodBinding tiebreakMethod = current . tiebreakMethod ( ) ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { if ( i == j || compatibilityLevels [ j ] != level ) continue ; MethodBinding next = visible [ j ] ; if ( original == next . original ( ) ) { compatibilityLevels [ j ] = - <NUM_LIT:1> ; continue ; } MethodBinding methodToTest = next ; if ( next instanceof ParameterizedGenericMethodBinding ) { ParameterizedGenericMethodBinding pNext = ( ParameterizedGenericMethodBinding ) next ; if ( pNext . isRaw && ! pNext . isStatic ( ) ) { } else { methodToTest = pNext . originalMethod ; } } MethodBinding acceptable = computeCompatibleMethod ( methodToTest , tiebreakMethod . parameters , tieBreakInvocationSite , level == VARARGS_COMPATIBLE ) ; if ( acceptable == null || ! acceptable . isValidBinding ( ) ) continue nextVisible ; if ( ! isAcceptableMethod ( tiebreakMethod , acceptable ) ) continue nextVisible ; if ( current . isBridge ( ) && ! next . isBridge ( ) ) if ( tiebreakMethod . areParametersEqual ( acceptable ) ) continue nextVisible ; } moreSpecific [ i ] = current ; count ++ ; } } if ( count == <NUM_LIT:1> ) { for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { if ( moreSpecific [ i ] != null ) { compilationUnitScope ( ) . recordTypeReferences ( visible [ i ] . thrownExceptions ) ; return visible [ i ] ; } } } else if ( count == <NUM_LIT:0> ) { return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } if ( receiverType != null ) receiverType = receiverType instanceof CaptureBinding ? receiverType : ( ReferenceBinding ) receiverType . erasure ( ) ; nextSpecific : for ( int i = <NUM_LIT:0> ; i < visibleSize ; i ++ ) { MethodBinding current = moreSpecific [ i ] ; if ( current != null ) { ReferenceBinding [ ] mostSpecificExceptions = null ; MethodBinding original = current . original ( ) ; boolean shouldIntersectExceptions = original . declaringClass . isAbstract ( ) && original . thrownExceptions != Binding . NO_EXCEPTIONS ; for ( int j = <NUM_LIT:0> ; j < visibleSize ; j ++ ) { MethodBinding next = moreSpecific [ j ] ; if ( next == null || i == j ) continue ; MethodBinding original2 = next . original ( ) ; if ( original . declaringClass == original2 . declaringClass ) break nextSpecific ; if ( ! original . isAbstract ( ) ) { if ( original2 . isAbstract ( ) ) continue ; original2 = original . findOriginalInheritedMethod ( original2 ) ; if ( original2 == null ) continue nextSpecific ; if ( current . hasSubstitutedParameters ( ) || original . typeVariables != Binding . NO_TYPE_VARIABLES ) { if ( ! environment ( ) . methodVerifier ( ) . isParameterSubsignature ( original , original2 ) ) continue nextSpecific ; } } else if ( receiverType != null ) { TypeBinding superType = receiverType . findSuperTypeOriginatingFrom ( original . declaringClass . erasure ( ) ) ; if ( original . declaringClass == superType || ! ( superType instanceof ReferenceBinding ) ) { } else { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( original . selector , argumentTypes . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) { if ( superMethods [ m ] . original ( ) == original ) { original = superMethods [ m ] ; break ; } } } superType = receiverType . findSuperTypeOriginatingFrom ( original2 . declaringClass . erasure ( ) ) ; if ( original2 . declaringClass == superType || ! ( superType instanceof ReferenceBinding ) ) { } else { MethodBinding [ ] superMethods = ( ( ReferenceBinding ) superType ) . getMethods ( original2 . selector , argumentTypes . length ) ; for ( int m = <NUM_LIT:0> , l = superMethods . length ; m < l ; m ++ ) { if ( superMethods [ m ] . original ( ) == original2 ) { original2 = superMethods [ m ] ; break ; } } } if ( original . typeVariables != Binding . NO_TYPE_VARIABLES ) original2 = original . computeSubstitutedMethod ( original2 , environment ( ) ) ; if ( original2 == null || ! original . areParameterErasuresEqual ( original2 ) ) continue nextSpecific ; if ( original . returnType != original2 . returnType ) { if ( next . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) { if ( original . returnType . erasure ( ) . findSuperTypeOriginatingFrom ( original2 . returnType . erasure ( ) ) == null ) continue nextSpecific ; } else if ( ! current . returnType . isCompatibleWith ( next . returnType ) ) { continue nextSpecific ; } } if ( shouldIntersectExceptions && original2 . declaringClass . isInterface ( ) ) { if ( current . thrownExceptions != next . thrownExceptions ) { if ( next . thrownExceptions == Binding . NO_EXCEPTIONS ) { mostSpecificExceptions = Binding . NO_EXCEPTIONS ; } else { if ( mostSpecificExceptions == null ) { mostSpecificExceptions = current . thrownExceptions ; } int mostSpecificLength = mostSpecificExceptions . length ; int nextLength = next . thrownExceptions . length ; SimpleSet temp = new SimpleSet ( mostSpecificLength ) ; boolean changed = false ; nextException : for ( int t = <NUM_LIT:0> ; t < mostSpecificLength ; t ++ ) { ReferenceBinding exception = mostSpecificExceptions [ t ] ; for ( int s = <NUM_LIT:0> ; s < nextLength ; s ++ ) { ReferenceBinding nextException = next . thrownExceptions [ s ] ; if ( exception . isCompatibleWith ( nextException ) ) { temp . add ( exception ) ; continue nextException ; } else if ( nextException . isCompatibleWith ( exception ) ) { temp . add ( nextException ) ; changed = true ; continue nextException ; } else { changed = true ; } } } if ( changed ) { mostSpecificExceptions = temp . elementSize == <NUM_LIT:0> ? Binding . NO_EXCEPTIONS : new ReferenceBinding [ temp . elementSize ] ; temp . asArray ( mostSpecificExceptions ) ; } } } } } } if ( mostSpecificExceptions != null && mostSpecificExceptions != current . thrownExceptions ) { return new MostSpecificExceptionMethodBinding ( current , mostSpecificExceptions ) ; } return current ; } } return new ProblemMethodBinding ( visible [ <NUM_LIT:0> ] , visible [ <NUM_LIT:0> ] . selector , visible [ <NUM_LIT:0> ] . parameters , ProblemReasons . Ambiguous ) ; } public final ClassScope outerMostClassScope ( ) { ClassScope lastClassScope = null ; Scope scope = this ; do { if ( scope instanceof ClassScope ) lastClassScope = ( ClassScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return lastClassScope ; } public final MethodScope outerMostMethodScope ( ) { MethodScope lastMethodScope = null ; Scope scope = this ; do { if ( scope instanceof MethodScope ) lastMethodScope = ( MethodScope ) scope ; scope = scope . parent ; } while ( scope != null ) ; return lastMethodScope ; } public int parameterCompatibilityLevel ( MethodBinding method , TypeBinding [ ] arguments ) { return parameterCompatibilityLevel ( method , arguments , false ) ; } public int parameterCompatibilityLevel ( MethodBinding method , TypeBinding [ ] arguments , boolean tiebreakingVarargsMethods ) { TypeBinding [ ] parameters = method . parameters ; int paramLength = parameters . length ; int argLength = arguments . length ; CompilerOptions compilerOptions = compilerOptions ( ) ; if ( compilerOptions . sourceLevel < ClassFileConstants . JDK1_5 ) { if ( paramLength != argLength ) return NOT_COMPATIBLE ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeBinding param = parameters [ i ] ; TypeBinding arg = arguments [ i ] ; if ( arg != param && ! arg . isCompatibleWith ( param . erasure ( ) ) ) return NOT_COMPATIBLE ; } return COMPATIBLE ; } if ( tiebreakingVarargsMethods ) { if ( CompilerOptions . tolerateIllegalAmbiguousVarargsInvocation && compilerOptions . complianceLevel < ClassFileConstants . JDK1_7 ) { tiebreakingVarargsMethods = false ; } } int level = COMPATIBLE ; int lastIndex = argLength ; LookupEnvironment env = environment ( ) ; if ( method . isVarargs ( ) ) { lastIndex = paramLength - <NUM_LIT:1> ; if ( paramLength == argLength ) { TypeBinding param = parameters [ lastIndex ] ; TypeBinding arg = arguments [ lastIndex ] ; if ( param != arg ) { level = parameterCompatibilityLevel ( arg , param , env , tiebreakingVarargsMethods ) ; if ( level == NOT_COMPATIBLE ) { param = ( ( ArrayBinding ) param ) . elementsType ( ) ; if ( tiebreakingVarargsMethods ) { arg = ( ( ArrayBinding ) arg ) . elementsType ( ) ; } if ( parameterCompatibilityLevel ( arg , param , env , tiebreakingVarargsMethods ) == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; level = VARARGS_COMPATIBLE ; } } } else { if ( paramLength < argLength ) { TypeBinding param = ( ( ArrayBinding ) parameters [ lastIndex ] ) . elementsType ( ) ; for ( int i = lastIndex ; i < argLength ; i ++ ) { TypeBinding arg = ( tiebreakingVarargsMethods && ( i == ( argLength - <NUM_LIT:1> ) ) ) ? ( ( ArrayBinding ) arguments [ i ] ) . elementsType ( ) : arguments [ i ] ; if ( param != arg && parameterCompatibilityLevel ( arg , param , env , tiebreakingVarargsMethods ) == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; } } else if ( lastIndex != argLength ) { return NOT_COMPATIBLE ; } level = VARARGS_COMPATIBLE ; } } else if ( paramLength != argLength ) { return NOT_COMPATIBLE ; } for ( int i = <NUM_LIT:0> ; i < lastIndex ; i ++ ) { TypeBinding param = parameters [ i ] ; TypeBinding arg = ( tiebreakingVarargsMethods && ( i == ( argLength - <NUM_LIT:1> ) ) ) ? ( ( ArrayBinding ) arguments [ i ] ) . elementsType ( ) : arguments [ i ] ; if ( arg != param ) { int newLevel = parameterCompatibilityLevel ( arg , param , env , tiebreakingVarargsMethods ) ; if ( newLevel == NOT_COMPATIBLE ) return NOT_COMPATIBLE ; if ( newLevel > level ) level = newLevel ; } } return level ; } private int parameterCompatibilityLevel ( TypeBinding arg , TypeBinding param , LookupEnvironment env , boolean tieBreakingVarargsMethods ) { if ( arg . isCompatibleWith ( param ) ) return COMPATIBLE ; if ( tieBreakingVarargsMethods && ( this . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_7 || ! CompilerOptions . tolerateIllegalAmbiguousVarargsInvocation ) ) { return NOT_COMPATIBLE ; } if ( arg . isBaseType ( ) != param . isBaseType ( ) ) { TypeBinding convertedType = env . computeBoxingType ( arg ) ; if ( convertedType == param || convertedType . isCompatibleWith ( param ) ) return AUTOBOX_COMPATIBLE ; } return NOT_COMPATIBLE ; } public abstract ProblemReporter problemReporter ( ) ; public final CompilationUnitDeclaration referenceCompilationUnit ( ) { Scope scope , unitScope = this ; while ( ( scope = unitScope . parent ) != null ) unitScope = scope ; return ( ( CompilationUnitScope ) unitScope ) . referenceContext ; } public ReferenceContext referenceContext ( ) { Scope current = this ; do { switch ( current . kind ) { case METHOD_SCOPE : return ( ( MethodScope ) current ) . referenceContext ; case CLASS_SCOPE : return ( ( ClassScope ) current ) . referenceContext ; case COMPILATION_UNIT_SCOPE : return ( ( CompilationUnitScope ) current ) . referenceContext ; } } while ( ( current = current . parent ) != null ) ; return null ; } public void deferBoundCheck ( TypeReference typeRef ) { if ( this . kind == CLASS_SCOPE ) { ClassScope classScope = ( ClassScope ) this ; if ( classScope . deferredBoundChecks == null ) { classScope . deferredBoundChecks = new ArrayList ( <NUM_LIT:3> ) ; classScope . deferredBoundChecks . add ( typeRef ) ; } else if ( ! classScope . deferredBoundChecks . contains ( typeRef ) ) { classScope . deferredBoundChecks . add ( typeRef ) ; } } } int startIndex ( ) { return <NUM_LIT:0> ; } public MethodBinding getStaticFactory ( ReferenceBinding allocationType , ReferenceBinding originalEnclosingType , TypeBinding [ ] argumentTypes , final InvocationSite allocationSite ) { TypeVariableBinding [ ] classTypeVariables = allocationType . typeVariables ( ) ; int classTypeVariablesArity = classTypeVariables . length ; MethodBinding [ ] methods = allocationType . getMethods ( TypeConstants . INIT , argumentTypes . length ) ; MethodBinding [ ] staticFactories = new MethodBinding [ methods . length ] ; int sfi = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = methods . length ; i < length ; i ++ ) { MethodBinding method = methods [ i ] ; int paramLength = method . parameters . length ; boolean isVarArgs = method . isVarargs ( ) ; if ( argumentTypes . length != paramLength ) if ( ! isVarArgs || argumentTypes . length < paramLength - <NUM_LIT:1> ) continue ; TypeVariableBinding [ ] methodTypeVariables = method . typeVariables ( ) ; int methodTypeVariablesArity = methodTypeVariables . length ; MethodBinding staticFactory = new MethodBinding ( method . modifiers | ClassFileConstants . AccStatic , TypeConstants . SYNTHETIC_STATIC_FACTORY , null , null , null , method . declaringClass ) ; staticFactory . typeVariables = new TypeVariableBinding [ classTypeVariablesArity + methodTypeVariablesArity ] ; final SimpleLookupTable map = new SimpleLookupTable ( classTypeVariablesArity + methodTypeVariablesArity ) ; final LookupEnvironment environment = environment ( ) ; for ( int j = <NUM_LIT:0> ; j < classTypeVariablesArity ; j ++ ) { map . put ( classTypeVariables [ j ] , staticFactory . typeVariables [ j ] = new TypeVariableBinding ( CharOperation . concat ( classTypeVariables [ j ] . sourceName , "<STR_LIT:'>" . toCharArray ( ) ) , staticFactory , j , environment ) ) ; } for ( int j = classTypeVariablesArity , max = classTypeVariablesArity + methodTypeVariablesArity ; j < max ; j ++ ) { map . put ( methodTypeVariables [ j - classTypeVariablesArity ] , ( staticFactory . typeVariables [ j ] = new TypeVariableBinding ( CharOperation . concat ( methodTypeVariables [ j - classTypeVariablesArity ] . sourceName , "<STR_LIT>" . toCharArray ( ) ) , staticFactory , j , environment ) ) ) ; } ReferenceBinding enclosingType = originalEnclosingType ; while ( enclosingType != null ) { if ( enclosingType . kind ( ) == Binding . PARAMETERIZED_TYPE ) { final ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) enclosingType ; final ReferenceBinding genericType = parameterizedType . genericType ( ) ; TypeVariableBinding [ ] enclosingClassTypeVariables = genericType . typeVariables ( ) ; int enclosingClassTypeVariablesArity = enclosingClassTypeVariables . length ; for ( int j = <NUM_LIT:0> ; j < enclosingClassTypeVariablesArity ; j ++ ) { map . put ( enclosingClassTypeVariables [ j ] , parameterizedType . arguments [ j ] ) ; } } enclosingType = enclosingType . enclosingType ( ) ; } final Scope scope = this ; Substitution substitution = new Substitution ( ) { public LookupEnvironment environment ( ) { return scope . environment ( ) ; } public boolean isRawSubstitution ( ) { return false ; } public TypeBinding substitute ( TypeVariableBinding typeVariable ) { TypeBinding retVal = ( TypeBinding ) map . get ( typeVariable ) ; return retVal != null ? retVal : typeVariable ; } } ; for ( int j = <NUM_LIT:0> , max = classTypeVariablesArity + methodTypeVariablesArity ; j < max ; j ++ ) { TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables [ j ] : methodTypeVariables [ j - classTypeVariablesArity ] ; TypeBinding substitutedType = ( TypeBinding ) map . get ( originalVariable ) ; if ( substitutedType instanceof TypeVariableBinding ) { TypeVariableBinding substitutedVariable = ( TypeVariableBinding ) substitutedType ; TypeBinding substitutedSuperclass = Scope . substitute ( substitution , originalVariable . superclass ) ; ReferenceBinding [ ] substitutedInterfaces = Scope . substitute ( substitution , originalVariable . superInterfaces ) ; if ( originalVariable . firstBound != null ) { substitutedVariable . firstBound = originalVariable . firstBound == originalVariable . superclass ? substitutedSuperclass : substitutedInterfaces [ <NUM_LIT:0> ] ; } switch ( substitutedSuperclass . kind ( ) ) { case Binding . ARRAY_TYPE : substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; substitutedVariable . superInterfaces = substitutedInterfaces ; break ; default : if ( substitutedSuperclass . isInterface ( ) ) { substitutedVariable . superclass = environment . getResolvedType ( TypeConstants . JAVA_LANG_OBJECT , null ) ; int interfaceCount = substitutedInterfaces . length ; System . arraycopy ( substitutedInterfaces , <NUM_LIT:0> , substitutedInterfaces = new ReferenceBinding [ interfaceCount + <NUM_LIT:1> ] , <NUM_LIT:1> , interfaceCount ) ; substitutedInterfaces [ <NUM_LIT:0> ] = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } else { substitutedVariable . superclass = ( ReferenceBinding ) substitutedSuperclass ; substitutedVariable . superInterfaces = substitutedInterfaces ; } } } } TypeVariableBinding [ ] returnTypeParameters = new TypeVariableBinding [ classTypeVariablesArity ] ; for ( int j = <NUM_LIT:0> ; j < classTypeVariablesArity ; j ++ ) { returnTypeParameters [ j ] = ( TypeVariableBinding ) map . get ( classTypeVariables [ j ] ) ; } staticFactory . returnType = environment . createParameterizedType ( allocationType , returnTypeParameters , allocationType . enclosingType ( ) ) ; staticFactory . parameters = Scope . substitute ( substitution , method . parameters ) ; staticFactory . thrownExceptions = Scope . substitute ( substitution , method . thrownExceptions ) ; if ( staticFactory . thrownExceptions == null ) { staticFactory . thrownExceptions = Binding . NO_EXCEPTIONS ; } staticFactories [ sfi ++ ] = new ParameterizedMethodBinding ( ( ParameterizedTypeBinding ) environment . convertToParameterizedType ( staticFactory . declaringClass ) , staticFactory ) ; } if ( sfi == <NUM_LIT:0> ) return null ; if ( sfi != methods . length ) { System . arraycopy ( staticFactories , <NUM_LIT:0> , staticFactories = new MethodBinding [ sfi ] , <NUM_LIT:0> , sfi ) ; } MethodBinding [ ] compatible = new MethodBinding [ sfi ] ; int compatibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < sfi ; i ++ ) { MethodBinding compatibleMethod = computeCompatibleMethod ( staticFactories [ i ] , argumentTypes , allocationSite ) ; if ( compatibleMethod != null ) { if ( compatibleMethod . isValidBinding ( ) ) compatible [ compatibleIndex ++ ] = compatibleMethod ; } } if ( compatibleIndex == <NUM_LIT:0> ) { return null ; } MethodBinding [ ] visible = new MethodBinding [ compatibleIndex ] ; int visibleIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < compatibleIndex ; i ++ ) { MethodBinding method = compatible [ i ] ; if ( method . canBeSeenBy ( allocationSite , this ) ) visible [ visibleIndex ++ ] = method ; } if ( visibleIndex == <NUM_LIT:0> ) { return null ; } return visibleIndex == <NUM_LIT:1> ? visible [ <NUM_LIT:0> ] : mostSpecificMethodBinding ( visible , visibleIndex , argumentTypes , allocationSite , allocationType ) ; } public void validateNullAnnotation ( long tagBits , TypeReference typeRef , Annotation [ ] annotations ) { long nullAnnotationTagBit = tagBits & ( TagBits . AnnotationNonNull | TagBits . AnnotationNullable ) ; if ( nullAnnotationTagBit != <NUM_LIT:0> ) { TypeBinding type = typeRef . resolvedType ; if ( type != null && type . isBaseType ( ) ) { char [ ] [ ] annotationName = ( nullAnnotationTagBit == TagBits . AnnotationNonNull ) ? environment ( ) . getNonNullAnnotationName ( ) : environment ( ) . getNullableAnnotationName ( ) ; problemReporter ( ) . illegalAnnotationForBaseType ( typeRef , annotations , annotationName [ annotationName . length - <NUM_LIT:1> ] , nullAnnotationTagBit ) ; } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . lookup ; public interface TypeConstants { char [ ] JAVA = "<STR_LIT>" . toCharArray ( ) ; char [ ] JAVAX = "<STR_LIT>" . toCharArray ( ) ; char [ ] LANG = "<STR_LIT>" . toCharArray ( ) ; char [ ] IO = "<STR_LIT>" . toCharArray ( ) ; char [ ] UTIL = "<STR_LIT>" . toCharArray ( ) ; char [ ] ZIP = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANNOTATION = "<STR_LIT>" . toCharArray ( ) ; char [ ] REFLECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] LENGTH = "<STR_LIT>" . toCharArray ( ) ; char [ ] CLONE = "<STR_LIT>" . toCharArray ( ) ; char [ ] EQUALS = "<STR_LIT>" . toCharArray ( ) ; char [ ] GETCLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] HASHCODE = "<STR_LIT>" . toCharArray ( ) ; char [ ] OBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] MAIN = "<STR_LIT>" . toCharArray ( ) ; char [ ] SERIALVERSIONUID = "<STR_LIT>" . toCharArray ( ) ; char [ ] SERIALPERSISTENTFIELDS = "<STR_LIT>" . toCharArray ( ) ; char [ ] READRESOLVE = "<STR_LIT>" . toCharArray ( ) ; char [ ] WRITEREPLACE = "<STR_LIT>" . toCharArray ( ) ; char [ ] READOBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] WRITEOBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_OBJECT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_ENUM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_LANG_ANNOTATION_ANNOTATION = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTINPUTSTREAM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTOUTPUTSTREAM = "<STR_LIT>" . toCharArray ( ) ; char [ ] CharArray_JAVA_IO_OBJECTSTREAMFIELD = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANONYM_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANONYM_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_NAME = { '<CHAR_LIT>' } ; char [ ] WILDCARD_SUPER = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_EXTENDS = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_MINUS = { '<CHAR_LIT:->' } ; char [ ] WILDCARD_STAR = { '<CHAR_LIT>' } ; char [ ] WILDCARD_PLUS = { '<CHAR_LIT>' } ; char [ ] WILDCARD_CAPTURE_NAME_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_CAPTURE_NAME_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] WILDCARD_CAPTURE = { '<CHAR_LIT>' } ; char [ ] BYTE = "<STR_LIT>" . toCharArray ( ) ; char [ ] SHORT = "<STR_LIT>" . toCharArray ( ) ; char [ ] INT = "<STR_LIT:int>" . toCharArray ( ) ; char [ ] LONG = "<STR_LIT:long>" . toCharArray ( ) ; char [ ] FLOAT = "<STR_LIT:float>" . toCharArray ( ) ; char [ ] DOUBLE = "<STR_LIT:double>" . toCharArray ( ) ; char [ ] CHAR = "<STR_LIT>" . toCharArray ( ) ; char [ ] BOOLEAN = "<STR_LIT:boolean>" . toCharArray ( ) ; char [ ] NULL = "<STR_LIT:null>" . toCharArray ( ) ; char [ ] VOID = "<STR_LIT>" . toCharArray ( ) ; char [ ] VALUE = "<STR_LIT:value>" . toCharArray ( ) ; char [ ] VALUES = "<STR_LIT>" . toCharArray ( ) ; char [ ] VALUEOF = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_SOURCE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_CLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_RUNTIME = "<STR_LIT>" . toCharArray ( ) ; char [ ] ANNOTATION_PREFIX = "<STR_LIT:@>" . toCharArray ( ) ; char [ ] ANNOTATION_SUFFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] TYPE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_FIELD = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_METHOD = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_PARAMETER = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_CONSTRUCTOR = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_LOCAL_VARIABLE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_ANNOTATION_TYPE = "<STR_LIT>" . toCharArray ( ) ; char [ ] UPPER_PACKAGE = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] JAVA_LANG = { JAVA , LANG } ; char [ ] [ ] JAVA_IO = { JAVA , IO } ; char [ ] [ ] JAVA_LANG_ANNOTATION_ANNOTATION = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ASSERTIONERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLASS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLASSNOTFOUNDEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CLONEABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ENUM = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_EXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ILLEGALARGUMENTEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ITERABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_NOCLASSDEFERROR = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_OBJECT = { JAVA , LANG , OBJECT } ; char [ ] [ ] JAVA_LANG_STRING = { JAVA , LANG , "<STR_LIT:String>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_STRINGBUFFER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_STRINGBUILDER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SYSTEM = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_RUNTIMEEXCEPTION = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_THROWABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_CONSTRUCTOR = { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_PRINTSTREAM = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_SERIALIZABLE = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_BYTE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SHORT = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_CHARACTER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_INTEGER = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_LONG = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_FLOAT = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_DOUBLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_BOOLEAN = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_VOID = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_UTIL_COLLECTION = { JAVA , UTIL , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_UTIL_ITERATOR = { JAVA , UTIL , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_DEPRECATED = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_INHERITED = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_OVERRIDE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_RETENTION = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_SUPPRESSWARNINGS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_TARGET = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = { JAVA , LANG , ANNOTATION , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_FIELD = new char [ ] [ ] { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_REFLECT_METHOD = new char [ ] [ ] { JAVA , LANG , REFLECT , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_CLOSEABLE = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTSTREAMEXCEPTION = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_EXTERNALIZABLE = { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_IOEXCEPTION = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTOUTPUTSTREAM = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_IO_OBJECTINPUTSTREAM = new char [ ] [ ] { JAVA , IO , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVAX_RMI_CORBA_STUB = new char [ ] [ ] { JAVAX , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; char [ ] [ ] JAVA_LANG_SAFEVARARGS = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] INVOKE = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = { JAVA , LANG , INVOKE , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_INVOKE_METHODHANDLE_$_POLYMORPHICSIGNATURE = { JAVA , LANG , INVOKE , "<STR_LIT>" . toCharArray ( ) } ; char [ ] [ ] JAVA_LANG_AUTOCLOSEABLE = { JAVA , LANG , "<STR_LIT>" . toCharArray ( ) } ; char [ ] CLOSE = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] JAVA_IO_WRAPPER_CLOSEABLES = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; char [ ] [ ] JAVA_UTIL_ZIP_WRAPPER_CLOSEABLES = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; char [ ] [ ] [ ] OTHER_WRAPPER_CLOSEABLES = new char [ ] [ ] [ ] { { JAVA , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } , { JAVA , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } , { JAVA , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } , { JAVA , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } , { JAVAX , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } , } ; char [ ] [ ] JAVA_IO_RESOURCE_FREE_CLOSEABLES = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; char [ ] ORG = "<STR_LIT>" . toCharArray ( ) ; char [ ] ECLIPSE = "<STR_LIT>" . toCharArray ( ) ; char [ ] CORE = "<STR_LIT>" . toCharArray ( ) ; char [ ] RUNTIME = "<STR_LIT>" . toCharArray ( ) ; char [ ] [ ] ORG_ECLIPSE_CORE_RUNTIME_ASSERT = new char [ ] [ ] { ORG , ECLIPSE , CORE , RUNTIME , "<STR_LIT>" . toCharArray ( ) } ; int CONSTRAINT_EQUAL = <NUM_LIT:0> ; int CONSTRAINT_EXTENDS = <NUM_LIT:1> ; int CONSTRAINT_SUPER = <NUM_LIT:2> ; int OK = <NUM_LIT:0> ; int UNCHECKED = <NUM_LIT:1> ; int MISMATCH = <NUM_LIT:2> ; char [ ] INIT = "<STR_LIT>" . toCharArray ( ) ; char [ ] CLINIT = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_SWITCH_ENUM_TABLE = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENUM_VALUES = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ASSERT_DISABLED = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_CLASS = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_OUTER_LOCAL_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ACCESS_METHOD_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX = "<STR_LIT>" . toCharArray ( ) ; char [ ] SYNTHETIC_STATIC_FACTORY = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] PACKAGE_INFO_NAME = "<STR_LIT>" . toCharArray ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler ; public interface IDebugRequestor { void acceptDebugResult ( CompilationResult result ) ; boolean isActive ( ) ; void activate ( ) ; void deactivate ( ) ; void reset ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler ; public class DefaultErrorHandlingPolicies { public static IErrorHandlingPolicy exitAfterAllProblems ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return false ; } public boolean proceedOnErrors ( ) { return false ; } } ; } public static IErrorHandlingPolicy exitOnFirstError ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return true ; } public boolean proceedOnErrors ( ) { return false ; } } ; } public static IErrorHandlingPolicy proceedOnFirstError ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return true ; } public boolean proceedOnErrors ( ) { return true ; } } ; } public static IErrorHandlingPolicy proceedWithAllProblems ( ) { return new IErrorHandlingPolicy ( ) { public boolean stopOnFirstError ( ) { return false ; } public boolean proceedOnErrors ( ) { return true ; } } ; } } </s>
<s> package org . eclipse . jdt . internal . compiler ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . * ; import org . eclipse . jdt . internal . compiler . problem . * ; import org . eclipse . jdt . internal . compiler . util . * ; import java . io . * ; import java . util . * ; public class Compiler implements ITypeRequestor , ProblemSeverities { public Parser parser ; public ICompilerRequestor requestor ; public CompilerOptions options ; public ProblemReporter problemReporter ; protected PrintWriter out ; public CompilerStats stats ; public CompilationProgress progress ; public int remainingIterations = <NUM_LIT:1> ; public CompilationUnitDeclaration [ ] unitsToProcess ; public int totalUnits ; public LookupEnvironment lookupEnvironment ; public static boolean DEBUG = false ; public int parseThreshold = - <NUM_LIT:1> ; public AbstractAnnotationProcessorManager annotationProcessorManager ; public int annotationProcessorStartIndex = <NUM_LIT:0> ; public ReferenceBinding [ ] referenceBindings ; public boolean useSingleThread = true ; public static IDebugRequestor DebugRequestor = null ; public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { this ( environment , policy , new CompilerOptions ( settings ) , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory , boolean parseLiteralExpressionsAsConstants ) { this ( environment , policy , new CompilerOptions ( settings , parseLiteralExpressionsAsConstants ) , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { this ( environment , policy , options , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out ) { this ( environment , policy , options , requestor , problemFactory , out , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out , CompilationProgress progress ) { this . options = options ; this . progress = progress ; if ( this . options . buildGroovyFiles == <NUM_LIT:0> ) { this . options . buildGroovyFiles = <NUM_LIT:1> ; this . options . groovyFlags = <NUM_LIT:0> ; } if ( DebugRequestor == null ) { this . requestor = requestor ; } else { this . requestor = new ICompilerRequestor ( ) { public void acceptResult ( CompilationResult result ) { if ( DebugRequestor . isActive ( ) ) { DebugRequestor . acceptDebugResult ( result ) ; } requestor . acceptResult ( result ) ; } } ; } this . problemReporter = new ProblemReporter ( policy , this . options , problemFactory ) ; this . lookupEnvironment = new LookupEnvironment ( this , this . options , this . problemReporter , environment ) ; this . out = out == null ? new PrintWriter ( System . out , true ) : out ; this . stats = new CompilerStats ( ) ; initializeParser ( ) ; } public void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { if ( this . options . verbose ) { this . out . println ( Messages . bind ( Messages . compilation_loadBinary , new String ( binaryType . getName ( ) ) ) ) ; } this . lookupEnvironment . createBinaryTypeFrom ( binaryType , packageBinding , accessRestriction ) ; } public void accept ( ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { CompilationResult unitResult = new CompilationResult ( sourceUnit , this . totalUnits , this . totalUnits , this . options . maxProblemsPerUnit ) ; unitResult . checkSecondaryTypes = true ; try { if ( this . options . verbose ) { String count = String . valueOf ( this . totalUnits + <NUM_LIT:1> ) ; this . out . println ( Messages . bind ( Messages . compilation_request , new String [ ] { count , count , new String ( sourceUnit . getFileName ( ) ) } ) ) ; } CompilationUnitDeclaration parsedUnit ; if ( this . totalUnits < this . parseThreshold ) { parsedUnit = this . parser . parse ( sourceUnit , unitResult ) ; } else { parsedUnit = this . parser . dietParse ( sourceUnit , unitResult ) ; } parsedUnit . bits |= ASTNode . IsImplicitUnit ; this . lookupEnvironment . buildTypeBindings ( parsedUnit , accessRestriction ) ; addCompilationUnit ( sourceUnit , parsedUnit ) ; this . lookupEnvironment . completeTypeBindings ( parsedUnit ) ; } catch ( AbortCompilationUnit e ) { if ( unitResult . compilationUnit == sourceUnit ) { this . requestor . acceptResult ( unitResult . tagAsAccepted ( ) ) ; } else { throw e ; } } } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { this . problemReporter . abortDueToInternalError ( Messages . bind ( Messages . abort_againstSourceModel , new String [ ] { String . valueOf ( sourceTypes [ <NUM_LIT:0> ] . getName ( ) ) , String . valueOf ( sourceTypes [ <NUM_LIT:0> ] . getFileName ( ) ) } ) ) ; } protected synchronized void addCompilationUnit ( ICompilationUnit sourceUnit , CompilationUnitDeclaration parsedUnit ) { if ( this . unitsToProcess == null ) return ; int size = this . unitsToProcess . length ; if ( this . totalUnits == size ) System . arraycopy ( this . unitsToProcess , <NUM_LIT:0> , ( this . unitsToProcess = new CompilationUnitDeclaration [ size * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . totalUnits ) ; this . unitsToProcess [ this . totalUnits ++ ] = parsedUnit ; } protected void beginToCompile ( ICompilationUnit [ ] sourceUnits ) { int maxUnits = sourceUnits . length ; this . totalUnits = <NUM_LIT:0> ; this . unitsToProcess = new CompilationUnitDeclaration [ maxUnits ] ; internalBeginToCompile ( sourceUnits , maxUnits ) ; } protected void reportProgress ( String taskDecription ) { if ( this . progress != null ) { if ( this . progress . isCanceled ( ) ) { throw new AbortCompilation ( true , null ) ; } this . progress . setTaskName ( taskDecription ) ; } } protected void reportWorked ( int workIncrement , int currentUnitIndex ) { if ( this . progress != null ) { if ( this . progress . isCanceled ( ) ) { throw new AbortCompilation ( true , null ) ; } this . progress . worked ( workIncrement , ( this . totalUnits * this . remainingIterations ) - currentUnitIndex - <NUM_LIT:1> ) ; } } public void compile ( ICompilationUnit [ ] sourceUnits ) { this . stats . startTime = System . currentTimeMillis ( ) ; if ( this . options . buildGroovyFiles == <NUM_LIT:2> ) { int groovyFileIndex = - <NUM_LIT:1> ; for ( int u = <NUM_LIT:0> , max = sourceUnits . length ; u < max ; u ++ ) { char [ ] fn = sourceUnits [ u ] . getFileName ( ) ; boolean isDotJava = fn [ fn . length - <NUM_LIT:1> ] == '<CHAR_LIT:a>' ; if ( isDotJava ) { if ( groovyFileIndex != - <NUM_LIT:1> ) { ICompilationUnit swap = sourceUnits [ groovyFileIndex ] ; sourceUnits [ groovyFileIndex ] = sourceUnits [ u ] ; sourceUnits [ u ] = swap ; int newGroovyFileIndex = - <NUM_LIT:1> ; for ( int g = groovyFileIndex ; g <= u ; g ++ ) { char [ ] fn2 = sourceUnits [ g ] . getFileName ( ) ; boolean isDotGroovy = fn2 [ fn2 . length - <NUM_LIT:1> ] == '<CHAR_LIT>' ; if ( isDotGroovy ) { newGroovyFileIndex = g ; break ; } } groovyFileIndex = newGroovyFileIndex ; } } else { if ( groovyFileIndex == - <NUM_LIT:1> ) { groovyFileIndex = u ; } } } } CompilationUnitDeclaration unit = null ; ProcessTaskManager processingTask = null ; try { reportProgress ( Messages . compilation_beginningToCompile ) ; if ( this . annotationProcessorManager == null ) { beginToCompile ( sourceUnits ) ; } else { ICompilationUnit [ ] originalUnits = ( ICompilationUnit [ ] ) sourceUnits . clone ( ) ; try { beginToCompile ( sourceUnits ) ; processAnnotations ( ) ; if ( ! this . options . generateClassFiles ) { return ; } } catch ( SourceTypeCollisionException e ) { reset ( ) ; int originalLength = originalUnits . length ; int newProcessedLength = e . newAnnotationProcessorUnits . length ; ICompilationUnit [ ] combinedUnits = new ICompilationUnit [ originalLength + newProcessedLength ] ; System . arraycopy ( originalUnits , <NUM_LIT:0> , combinedUnits , <NUM_LIT:0> , originalLength ) ; System . arraycopy ( e . newAnnotationProcessorUnits , <NUM_LIT:0> , combinedUnits , originalLength , newProcessedLength ) ; this . annotationProcessorStartIndex = originalLength ; compile ( combinedUnits ) ; return ; } } if ( this . useSingleThread ) { for ( int i = <NUM_LIT:0> ; i < this . totalUnits ; i ++ ) { unit = this . unitsToProcess [ i ] ; reportProgress ( Messages . bind ( Messages . compilation_processing , new String ( unit . getFileName ( ) ) ) ) ; try { if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_process , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( this . totalUnits ) , new String ( this . unitsToProcess [ i ] . getFileName ( ) ) } ) ) ; process ( unit , i ) ; } finally { unit . cleanUp ( ) ; } this . unitsToProcess [ i ] = null ; reportWorked ( <NUM_LIT:1> , i ) ; this . stats . lineCount += unit . compilationResult . lineSeparatorPositions . length ; long acceptStart = System . currentTimeMillis ( ) ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; this . stats . generateTime += System . currentTimeMillis ( ) - acceptStart ; if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_done , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( this . totalUnits ) , new String ( unit . getFileName ( ) ) } ) ) ; } } else { processingTask = new ProcessTaskManager ( this ) ; int acceptedCount = <NUM_LIT:0> ; while ( true ) { try { unit = processingTask . removeNextUnit ( ) ; } catch ( Error e ) { unit = processingTask . unitToProcess ; throw e ; } catch ( RuntimeException e ) { unit = processingTask . unitToProcess ; throw e ; } if ( unit == null ) break ; reportWorked ( <NUM_LIT:1> , acceptedCount ++ ) ; this . stats . lineCount += unit . compilationResult . lineSeparatorPositions . length ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_done , new String [ ] { String . valueOf ( acceptedCount ) , String . valueOf ( this . totalUnits ) , new String ( unit . getFileName ( ) ) } ) ) ; } } } catch ( AbortCompilation e ) { this . handleInternalException ( e , unit ) ; } catch ( Error e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } catch ( RuntimeException e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } finally { if ( processingTask != null ) { processingTask . shutdown ( ) ; processingTask = null ; } reset ( ) ; this . annotationProcessorStartIndex = <NUM_LIT:0> ; this . stats . endTime = System . currentTimeMillis ( ) ; } if ( this . options . verbose ) { if ( this . totalUnits > <NUM_LIT:1> ) { this . out . println ( Messages . bind ( Messages . compilation_units , String . valueOf ( this . totalUnits ) ) ) ; } else { this . out . println ( Messages . bind ( Messages . compilation_unit , String . valueOf ( this . totalUnits ) ) ) ; } } } public synchronized CompilationUnitDeclaration getUnitToProcess ( int next ) { if ( next < this . totalUnits ) { CompilationUnitDeclaration unit = this . unitsToProcess [ next ] ; this . unitsToProcess [ next ] = null ; return unit ; } return null ; } public void setBinaryTypes ( ReferenceBinding [ ] binaryTypes ) { this . referenceBindings = binaryTypes ; } protected void handleInternalException ( Throwable internalException , CompilationUnitDeclaration unit , CompilationResult result ) { if ( result == null && unit != null ) { result = unit . compilationResult ; } if ( result == null && this . lookupEnvironment . unitBeingCompleted != null ) { result = this . lookupEnvironment . unitBeingCompleted . compilationResult ; } if ( result == null ) { synchronized ( this ) { if ( this . unitsToProcess != null && this . totalUnits > <NUM_LIT:0> ) result = this . unitsToProcess [ this . totalUnits - <NUM_LIT:1> ] . compilationResult ; } } boolean needToPrint = true ; if ( result != null ) { String [ ] pbArguments = new String [ ] { Messages . bind ( Messages . compilation_internalError , Util . getExceptionSummary ( internalException ) ) , } ; result . record ( this . problemReporter . createProblem ( result . getFileName ( ) , IProblem . Unclassified , pbArguments , pbArguments , Error , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) , unit , true ) ; if ( ! result . hasBeenAccepted ) { this . requestor . acceptResult ( result . tagAsAccepted ( ) ) ; needToPrint = false ; } } if ( needToPrint ) { internalException . printStackTrace ( ) ; } } protected void handleInternalException ( AbortCompilation abortException , CompilationUnitDeclaration unit ) { if ( abortException . isSilent ) { if ( abortException . silentException == null ) { return ; } throw abortException . silentException ; } CompilationResult result = abortException . compilationResult ; if ( result == null && unit != null ) { result = unit . compilationResult ; } if ( result == null && this . lookupEnvironment . unitBeingCompleted != null ) { result = this . lookupEnvironment . unitBeingCompleted . compilationResult ; } if ( result == null ) { synchronized ( this ) { if ( this . unitsToProcess != null && this . totalUnits > <NUM_LIT:0> ) result = this . unitsToProcess [ this . totalUnits - <NUM_LIT:1> ] . compilationResult ; } } if ( result != null && ! result . hasBeenAccepted ) { if ( abortException . problem != null ) { recordDistantProblem : { CategorizedProblem distantProblem = abortException . problem ; CategorizedProblem [ ] knownProblems = result . problems ; for ( int i = <NUM_LIT:0> ; i < result . problemCount ; i ++ ) { if ( knownProblems [ i ] == distantProblem ) { break recordDistantProblem ; } } if ( distantProblem instanceof DefaultProblem ) { ( ( DefaultProblem ) distantProblem ) . setOriginatingFileName ( result . getFileName ( ) ) ; } result . record ( distantProblem , unit , true ) ; } } else { if ( abortException . exception != null ) { this . handleInternalException ( abortException . exception , null , result ) ; return ; } } if ( ! result . hasBeenAccepted ) { this . requestor . acceptResult ( result . tagAsAccepted ( ) ) ; } } else { abortException . printStackTrace ( ) ; } } public void initializeParser ( ) { this . parser = LanguageSupportFactory . getParser ( this , this . lookupEnvironment == null ? null : this . lookupEnvironment . globalOptions , this . problemReporter , this . options . parseLiteralExpressionsAsConstants , <NUM_LIT:1> ) ; } protected void internalBeginToCompile ( ICompilationUnit [ ] sourceUnits , int maxUnits ) { if ( ! this . useSingleThread && maxUnits >= ReadManager . THRESHOLD ) this . parser . readManager = new ReadManager ( sourceUnits , maxUnits ) ; for ( int i = <NUM_LIT:0> ; i < maxUnits ; i ++ ) { CompilationResult unitResult = null ; try { if ( this . options . verbose ) { this . out . println ( Messages . bind ( Messages . compilation_request , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( maxUnits ) , new String ( sourceUnits [ i ] . getFileName ( ) ) } ) ) ; } CompilationUnitDeclaration parsedUnit ; unitResult = new CompilationResult ( sourceUnits [ i ] , i , maxUnits , this . options . maxProblemsPerUnit ) ; long parseStart = System . currentTimeMillis ( ) ; if ( this . totalUnits < this . parseThreshold ) { parsedUnit = this . parser . parse ( sourceUnits [ i ] , unitResult ) ; } else { parsedUnit = this . parser . dietParse ( sourceUnits [ i ] , unitResult ) ; } long resolveStart = System . currentTimeMillis ( ) ; this . stats . parseTime += resolveStart - parseStart ; this . lookupEnvironment . buildTypeBindings ( parsedUnit , null ) ; this . stats . resolveTime += System . currentTimeMillis ( ) - resolveStart ; addCompilationUnit ( sourceUnits [ i ] , parsedUnit ) ; ImportReference currentPackage = parsedUnit . currentPackage ; if ( currentPackage != null ) { unitResult . recordPackageName ( currentPackage . tokens ) ; } } catch ( AbortCompilation a ) { if ( a . compilationResult == null ) a . compilationResult = unitResult ; throw a ; } finally { sourceUnits [ i ] = null ; } } if ( this . parser . readManager != null ) { this . parser . readManager . shutdown ( ) ; this . parser . readManager = null ; } this . lookupEnvironment . completeTypeBindings ( ) ; } public void process ( CompilationUnitDeclaration unit , int i ) { this . lookupEnvironment . unitBeingCompleted = unit ; long parseStart = System . currentTimeMillis ( ) ; this . parser . getMethodBodies ( unit ) ; long resolveStart = System . currentTimeMillis ( ) ; this . stats . parseTime += resolveStart - parseStart ; if ( unit . scope != null ) unit . scope . faultInTypes ( ) ; if ( unit . scope != null ) unit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; unit . resolve ( ) ; long analyzeStart = System . currentTimeMillis ( ) ; this . stats . resolveTime += analyzeStart - resolveStart ; if ( ! this . options . ignoreMethodBodies ) unit . analyseCode ( ) ; long generateStart = System . currentTimeMillis ( ) ; this . stats . analyzeTime += generateStart - analyzeStart ; if ( ! this . options . ignoreMethodBodies ) unit . generateCode ( ) ; if ( this . options . produceReferenceInfo && unit . scope != null ) unit . scope . storeDependencyInfo ( ) ; unit . finalizeProblems ( ) ; this . stats . generateTime += System . currentTimeMillis ( ) - generateStart ; unit . compilationResult . totalUnitsKnown = this . totalUnits ; this . lookupEnvironment . unitBeingCompleted = null ; } protected void processAnnotations ( ) { int newUnitSize = <NUM_LIT:0> ; int newClassFilesSize = <NUM_LIT:0> ; int bottom = this . annotationProcessorStartIndex ; int top = this . totalUnits ; ReferenceBinding [ ] binaryTypeBindingsTemp = this . referenceBindings ; if ( top == <NUM_LIT:0> && binaryTypeBindingsTemp == null ) return ; this . referenceBindings = null ; do { int length = top - bottom ; CompilationUnitDeclaration [ ] currentUnits = new CompilationUnitDeclaration [ length ] ; int index = <NUM_LIT:0> ; for ( int i = bottom ; i < top ; i ++ ) { CompilationUnitDeclaration currentUnit = this . unitsToProcess [ i ] ; if ( ( currentUnit . bits & ASTNode . IsImplicitUnit ) == <NUM_LIT:0> ) { currentUnits [ index ++ ] = currentUnit ; } } if ( index != length ) { System . arraycopy ( currentUnits , <NUM_LIT:0> , ( currentUnits = new CompilationUnitDeclaration [ index ] ) , <NUM_LIT:0> , index ) ; } this . annotationProcessorManager . processAnnotations ( currentUnits , binaryTypeBindingsTemp , false ) ; ICompilationUnit [ ] newUnits = this . annotationProcessorManager . getNewUnits ( ) ; newUnitSize = newUnits . length ; ReferenceBinding [ ] newClassFiles = this . annotationProcessorManager . getNewClassFiles ( ) ; binaryTypeBindingsTemp = newClassFiles ; newClassFilesSize = newClassFiles . length ; if ( newUnitSize != <NUM_LIT:0> ) { ICompilationUnit [ ] newProcessedUnits = ( ICompilationUnit [ ] ) newUnits . clone ( ) ; try { this . lookupEnvironment . isProcessingAnnotations = true ; internalBeginToCompile ( newUnits , newUnitSize ) ; } catch ( SourceTypeCollisionException e ) { e . newAnnotationProcessorUnits = newProcessedUnits ; throw e ; } finally { this . lookupEnvironment . isProcessingAnnotations = false ; this . annotationProcessorManager . reset ( ) ; } bottom = top ; top = this . totalUnits ; } else { bottom = top ; this . annotationProcessorManager . reset ( ) ; } } while ( newUnitSize != <NUM_LIT:0> || newClassFilesSize != <NUM_LIT:0> ) ; this . annotationProcessorManager . processAnnotations ( null , null , true ) ; ICompilationUnit [ ] newUnits = this . annotationProcessorManager . getNewUnits ( ) ; newUnitSize = newUnits . length ; if ( newUnitSize != <NUM_LIT:0> ) { ICompilationUnit [ ] newProcessedUnits = ( ICompilationUnit [ ] ) newUnits . clone ( ) ; try { this . lookupEnvironment . isProcessingAnnotations = true ; internalBeginToCompile ( newUnits , newUnitSize ) ; } catch ( SourceTypeCollisionException e ) { e . newAnnotationProcessorUnits = newProcessedUnits ; throw e ; } finally { this . lookupEnvironment . isProcessingAnnotations = false ; this . annotationProcessorManager . reset ( ) ; } } else { this . annotationProcessorManager . reset ( ) ; } } public void reset ( ) { this . lookupEnvironment . reset ( ) ; this . parser . reset ( ) ; this . parser . scanner . source = null ; this . unitsToProcess = null ; if ( DebugRequestor != null ) DebugRequestor . reset ( ) ; this . problemReporter . reset ( ) ; } public CompilationUnitDeclaration resolve ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { try { if ( unit == null ) { this . parseThreshold = <NUM_LIT:0> ; beginToCompile ( new ICompilationUnit [ ] { sourceUnit } ) ; for ( int i = <NUM_LIT:0> ; i < this . totalUnits ; i ++ ) { if ( this . unitsToProcess [ i ] != null && this . unitsToProcess [ i ] . compilationResult . compilationUnit == sourceUnit ) { unit = this . unitsToProcess [ i ] ; break ; } } if ( unit == null ) unit = this . unitsToProcess [ <NUM_LIT:0> ] ; } else { this . lookupEnvironment . buildTypeBindings ( unit , null ) ; this . lookupEnvironment . completeTypeBindings ( ) ; } this . lookupEnvironment . unitBeingCompleted = unit ; this . parser . getMethodBodies ( unit ) ; if ( unit . scope != null ) { unit . scope . faultInTypes ( ) ; if ( unit . scope != null && verifyMethods ) { unit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; } unit . resolve ( ) ; if ( analyzeCode ) unit . analyseCode ( ) ; if ( generateCode ) unit . generateCode ( ) ; unit . finalizeProblems ( ) ; } if ( this . unitsToProcess != null ) this . unitsToProcess [ <NUM_LIT:0> ] = null ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; return unit ; } catch ( AbortCompilation e ) { this . handleInternalException ( e , unit ) ; return unit == null ? this . unitsToProcess [ <NUM_LIT:0> ] : unit ; } catch ( Error e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } catch ( RuntimeException e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } finally { } } public CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { return resolve ( null , sourceUnit , verifyMethods , analyzeCode , generateCode ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . HashtableOfObject ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ConstantPool implements ClassFileConstants , TypeIds { public static final int DOUBLE_INITIAL_SIZE = <NUM_LIT:5> ; public static final int FLOAT_INITIAL_SIZE = <NUM_LIT:3> ; public static final int INT_INITIAL_SIZE = <NUM_LIT> ; public static final int LONG_INITIAL_SIZE = <NUM_LIT:5> ; public static final int UTF8_INITIAL_SIZE = <NUM_LIT> ; public static final int STRING_INITIAL_SIZE = <NUM_LIT> ; public static final int METHODS_AND_FIELDS_INITIAL_SIZE = <NUM_LIT> ; public static final int CLASS_INITIAL_SIZE = <NUM_LIT> ; public static final int NAMEANDTYPE_INITIAL_SIZE = <NUM_LIT> ; public static final int CONSTANTPOOL_INITIAL_SIZE = <NUM_LIT> ; public static final int CONSTANTPOOL_GROW_SIZE = <NUM_LIT> ; protected DoubleCache doubleCache ; protected FloatCache floatCache ; protected IntegerCache intCache ; protected LongCache longCache ; public CharArrayCache UTF8Cache ; protected CharArrayCache stringCache ; protected HashtableOfObject methodsAndFieldsCache ; protected CharArrayCache classCache ; protected HashtableOfObject nameAndTypeCacheForFieldsAndMethods ; public byte [ ] poolContent ; public int currentIndex = <NUM_LIT:1> ; public int currentOffset ; public int [ ] offsets ; public ClassFile classFile ; public static final char [ ] Append = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ARRAY_NEWINSTANCE_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayCopy = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayCopySignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangClassConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ArrayJavaLangObjectConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] booleanBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BooleanConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] byteByteSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ByteConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] BYTEVALUE_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] charCharacterSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CharConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Clinit = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DefaultConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ClinitSignature = DefaultConstructorSignature ; public static final char [ ] Close = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] CloseSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatus = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DesiredAssertionStatusSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DoubleConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] doubleDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Exit = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ExitIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FloatConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] floatFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ForName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ForNameSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_CHAR_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_INT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_NAME = "<STR_LIT:get>" . toCharArray ( ) ; public static final char [ ] GET_OBJECT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GET_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetClass = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetComponentType = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetComponentTypeSignature = GetClassSignature ; public static final char [ ] GetConstructor = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDCONSTRUCTOR_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDFIELD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GETDECLAREDMETHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetMessage = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] GetMessageSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HasNext = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HasNextSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Init = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] IntConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ITERATOR_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ITERATOR_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Intern = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] InternSignature = GetMessageSignature ; public static final char [ ] IntIntegerSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INTVALUE_INTEGER_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] INVOKE_METHOD_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVA_LANG_REFLECT_ARRAY = new char [ ] [ ] { TypeConstants . JAVA , TypeConstants . LANG , TypeConstants . REFLECT , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] JavaIoPrintStreamSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangAssertionErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangBooleanConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangByteConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangCharacterConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassNotFoundExceptionConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangDoubleConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangEnumConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangExceptionConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangFloatConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangIntegerConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangLongConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangNoClassDefFoundErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangNoSuchFieldErrorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangObjectConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangReflectConstructorNewInstanceSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangShortConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringBufferConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringBuilderConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangSystemConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangThrowableConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaLangVoidConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JavaUtilIteratorConstantPoolName = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LongConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] longLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] LONGVALUE_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NewInstance = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NewInstanceSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Next = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] NextSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ObjectConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Ordinal = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] OrdinalSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Out = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BOOLEAN_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_BYTE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_CHAR_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_DOUBLE_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_FLOAT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_INT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_LONG_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_OBJECT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SET_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SETACCESSIBLE_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ShortConstrSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] shortShortSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_NAME = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] SHORTVALUE_SHORT_METHOD_SIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBufferAppendStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringBuilderAppendStringSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] StringConstructorSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] This = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ToString = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ToStringSignature = GetMessageSignature ; public static final char [ ] TYPE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOf = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfBooleanSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfCharSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfDoubleSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfFloatSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfIntSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfLongSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfObjectSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] ValueOfStringClassSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_DOCUMENTED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_ELEMENTTYPE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTION = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_TARGET = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_DEPRECATED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_ANNOTATION_INHERITED = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_SAFEVARARGS = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HashCode = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] HashCodeSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] Equals = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] EqualsSignature = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] AddSuppressed = "<STR_LIT>" . toCharArray ( ) ; public static final char [ ] AddSuppressedSignature = "<STR_LIT>" . toCharArray ( ) ; public ConstantPool ( ClassFile classFile ) { this . UTF8Cache = new CharArrayCache ( UTF8_INITIAL_SIZE ) ; this . stringCache = new CharArrayCache ( STRING_INITIAL_SIZE ) ; this . methodsAndFieldsCache = new HashtableOfObject ( METHODS_AND_FIELDS_INITIAL_SIZE ) ; this . classCache = new CharArrayCache ( CLASS_INITIAL_SIZE ) ; this . nameAndTypeCacheForFieldsAndMethods = new HashtableOfObject ( NAMEANDTYPE_INITIAL_SIZE ) ; this . offsets = new int [ <NUM_LIT:5> ] ; initialize ( classFile ) ; } public void initialize ( ClassFile givenClassFile ) { this . poolContent = givenClassFile . header ; this . currentOffset = givenClassFile . headerOffset ; this . currentIndex = <NUM_LIT:1> ; this . classFile = givenClassFile ; } public byte [ ] dumpBytes ( ) { System . arraycopy ( this . poolContent , <NUM_LIT:0> , ( this . poolContent = new byte [ this . currentOffset ] ) , <NUM_LIT:0> , this . currentOffset ) ; return this . poolContent ; } public int literalIndex ( byte [ ] utf8encoding , char [ ] stringCharArray ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int utf8encodingLength = utf8encoding . length ; if ( this . currentOffset + <NUM_LIT:2> + utf8encodingLength >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> + utf8encodingLength ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( utf8encodingLength > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) utf8encodingLength ; System . arraycopy ( utf8encoding , <NUM_LIT:0> , this . poolContent , this . currentOffset , utf8encodingLength ) ; this . currentOffset += utf8encodingLength ; } return index ; } public int literalIndex ( TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return literalIndex ( binding . signature ( ) ) ; } public int literalIndex ( char [ ] utf8Constant ) { int index ; if ( ( index = this . UTF8Cache . putIfAbsent ( utf8Constant , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int savedCurrentOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < utf8Constant . length ; i ++ ) { char current = utf8Constant [ i ] ; if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { writeU1 ( current ) ; length ++ ; } else { if ( current > <NUM_LIT> ) { length += <NUM_LIT:3> ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { length += <NUM_LIT:2> ; writeU1 ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; writeU1 ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } } if ( length >= <NUM_LIT> ) { this . currentOffset = savedCurrentOffset - <NUM_LIT:1> ; this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceForConstant ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } if ( index > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; this . poolContent [ savedCurrentOffset ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . poolContent [ savedCurrentOffset + <NUM_LIT:1> ] = ( byte ) length ; } return index ; } public int literalIndex ( char [ ] stringCharArray , byte [ ] utf8encoding ) { int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int stringIndex = literalIndex ( utf8encoding , stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndex ( double key ) { int index ; if ( this . doubleCache == null ) { this . doubleCache = new DoubleCache ( DOUBLE_INITIAL_SIZE ) ; } if ( ( index = this . doubleCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += <NUM_LIT:2> ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( DoubleTag ) ; long temp = java . lang . Double . doubleToLongBits ( key ) ; length = this . poolContent . length ; if ( this . currentOffset + <NUM_LIT:8> >= length ) { resizePoolContents ( <NUM_LIT:8> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:32> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( float key ) { int index ; if ( this . floatCache == null ) { this . floatCache = new FloatCache ( FLOAT_INITIAL_SIZE ) ; } if ( ( index = this . floatCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FloatTag ) ; int temp = java . lang . Float . floatToIntBits ( key ) ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( temp > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) temp ; } return index ; } public int literalIndex ( int key ) { int index ; if ( this . intCache == null ) { this . intCache = new IntegerCache ( INT_INITIAL_SIZE ) ; } if ( ( index = this . intCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( IntegerTag ) ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( long key ) { int index ; if ( this . longCache == null ) { this . longCache = new LongCache ( LONG_INITIAL_SIZE ) ; } if ( ( index = this . longCache . putIfAbsent ( key , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex += <NUM_LIT:2> ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( LongTag ) ; if ( this . currentOffset + <NUM_LIT:8> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:8> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:32> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:24> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:16> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( key > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) key ; } return index ; } public int literalIndex ( String stringConstant ) { int index ; char [ ] stringCharArray = stringConstant . toCharArray ( ) ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int stringIndex = literalIndex ( stringCharArray ) ; this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } public int literalIndexForType ( final char [ ] constantPoolName ) { int index ; if ( ( index = this . classCache . putIfAbsent ( constantPoolName , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( ClassTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; final int nameIndex = literalIndex ( constantPoolName ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ] = ( byte ) nameIndex ; } return index ; } public int literalIndexForType ( final TypeBinding binding ) { TypeBinding typeBinding = binding . leafComponentType ( ) ; if ( ( typeBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , typeBinding ) ; } return this . literalIndexForType ( binding . constantPoolName ( ) ) ; } public int literalIndexForMethod ( char [ ] declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , selector , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( isInterface ? InterfaceMethodRefTag : MethodRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( selector , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForMethod ( TypeBinding declaringClass , char [ ] selector , char [ ] signature , boolean isInterface ) { if ( ( declaringClass . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( this . classFile , declaringClass ) ; } return this . literalIndexForMethod ( declaringClass . constantPoolName ( ) , selector , signature , isInterface ) ; } public int literalIndexForNameAndType ( char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInNameAndTypeCacheIfAbsent ( name , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( NameAndTypeTag ) ; int nameIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int nameIndex = literalIndex ( name ) ; final int typeIndex = literalIndex ( signature ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) nameIndex ; this . poolContent [ nameIndexOffset ++ ] = ( byte ) ( typeIndex > > <NUM_LIT:8> ) ; this . poolContent [ nameIndexOffset ] = ( byte ) typeIndex ; } return index ; } public int literalIndexForField ( char [ ] declaringClass , char [ ] name , char [ ] signature ) { int index ; if ( ( index = putInCacheIfAbsent ( declaringClass , name , signature , this . currentIndex ) ) < <NUM_LIT:0> ) { this . currentIndex ++ ; if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( FieldRefTag ) ; int classIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:4> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:4> ) ; } this . currentOffset += <NUM_LIT:4> ; final int classIndex = literalIndexForType ( declaringClass ) ; final int nameAndTypeIndex = literalIndexForNameAndType ( name , signature ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( classIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ++ ] = ( byte ) classIndex ; this . poolContent [ classIndexOffset ++ ] = ( byte ) ( nameAndTypeIndex > > <NUM_LIT:8> ) ; this . poolContent [ classIndexOffset ] = ( byte ) nameAndTypeIndex ; } return index ; } public int literalIndexForLdc ( char [ ] stringCharArray ) { int savedCurrentIndex = this . currentIndex ; int savedCurrentOffset = this . currentOffset ; int index ; if ( ( index = this . stringCache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( index = - index ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; int length = this . offsets . length ; if ( length <= index ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ index * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ index ] = this . currentOffset ; writeU1 ( StringTag ) ; int stringIndexOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; int stringIndex ; if ( ( stringIndex = this . UTF8Cache . putIfAbsent ( stringCharArray , this . currentIndex ) ) < <NUM_LIT:0> ) { if ( ( stringIndex = - stringIndex ) > <NUM_LIT> ) { this . classFile . referenceBinding . scope . problemReporter ( ) . noMoreAvailableSpaceInConstantPool ( this . classFile . referenceBinding . scope . referenceType ( ) ) ; } this . currentIndex ++ ; length = this . offsets . length ; if ( length <= stringIndex ) { System . arraycopy ( this . offsets , <NUM_LIT:0> , ( this . offsets = new int [ stringIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , length ) ; } this . offsets [ stringIndex ] = this . currentOffset ; writeU1 ( Utf8Tag ) ; int lengthOffset = this . currentOffset ; if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . currentOffset += <NUM_LIT:2> ; length = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < stringCharArray . length ; i ++ ) { char current = stringCharArray [ i ] ; if ( ( current >= <NUM_LIT> ) && ( current <= <NUM_LIT> ) ) { length ++ ; if ( this . currentOffset + <NUM_LIT:1> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:1> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( current ) ; } else if ( current > <NUM_LIT> ) { length += <NUM_LIT:3> ; if ( this . currentOffset + <NUM_LIT:3> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:3> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:12> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } else { if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } length += <NUM_LIT:2> ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( ( current > > <NUM_LIT:6> ) & <NUM_LIT> ) ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) ( <NUM_LIT> | ( current & <NUM_LIT> ) ) ; } } if ( length >= <NUM_LIT> ) { this . currentOffset = savedCurrentOffset ; this . currentIndex = savedCurrentIndex ; this . stringCache . remove ( stringCharArray ) ; this . UTF8Cache . remove ( stringCharArray ) ; return <NUM_LIT:0> ; } this . poolContent [ lengthOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . poolContent [ lengthOffset ] = ( byte ) length ; } this . poolContent [ stringIndexOffset ++ ] = ( byte ) ( stringIndex > > <NUM_LIT:8> ) ; this . poolContent [ stringIndexOffset ] = ( byte ) stringIndex ; } return index ; } private int putInNameAndTypeCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , int value ) { int index ; Object key1Value = this . nameAndTypeCacheForFieldsAndMethods . get ( key1 ) ; if ( key1Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key2 , value ) ; index = - value ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , cachedIndexEntry ) ; } else if ( key1Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key1Value ; if ( CharOperation . equals ( key2 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key2 , value ) ; this . nameAndTypeCacheForFieldsAndMethods . put ( key1 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key1Value ; index = charArrayCache . putIfAbsent ( key2 , value ) ; } return index ; } private int putInCacheIfAbsent ( final char [ ] key1 , final char [ ] key2 , final char [ ] key3 , int value ) { int index ; HashtableOfObject key1Value = ( HashtableOfObject ) this . methodsAndFieldsCache . get ( key1 ) ; if ( key1Value == null ) { key1Value = new HashtableOfObject ( ) ; this . methodsAndFieldsCache . put ( key1 , key1Value ) ; CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else { Object key2Value = key1Value . get ( key2 ) ; if ( key2Value == null ) { CachedIndexEntry cachedIndexEntry = new CachedIndexEntry ( key3 , value ) ; index = - value ; key1Value . put ( key2 , cachedIndexEntry ) ; } else if ( key2Value instanceof CachedIndexEntry ) { CachedIndexEntry entry = ( CachedIndexEntry ) key2Value ; if ( CharOperation . equals ( key3 , entry . signature ) ) { index = entry . index ; } else { CharArrayCache charArrayCache = new CharArrayCache ( ) ; charArrayCache . putIfAbsent ( entry . signature , entry . index ) ; index = charArrayCache . putIfAbsent ( key3 , value ) ; key1Value . put ( key2 , charArrayCache ) ; } } else { CharArrayCache charArrayCache = ( CharArrayCache ) key2Value ; index = charArrayCache . putIfAbsent ( key3 , value ) ; } } return index ; } public void resetForClinit ( int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( AttributeNamesConstants . CodeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( AttributeNamesConstants . CodeName ) ; } if ( this . UTF8Cache . get ( ConstantPool . ClinitSignature ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . ClinitSignature ) ; } if ( this . UTF8Cache . get ( ConstantPool . Clinit ) >= constantPoolIndex ) { this . UTF8Cache . remove ( ConstantPool . Clinit ) ; } } private final void resizePoolContents ( int minimalSize ) { int length = this . poolContent . length ; int toAdd = length ; if ( toAdd < minimalSize ) toAdd = minimalSize ; System . arraycopy ( this . poolContent , <NUM_LIT:0> , this . poolContent = new byte [ length + toAdd ] , <NUM_LIT:0> , length ) ; } protected final void writeU1 ( int value ) { if ( this . currentOffset + <NUM_LIT:1> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:1> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } protected final void writeU2 ( int value ) { if ( this . currentOffset + <NUM_LIT:2> >= this . poolContent . length ) { resizePoolContents ( <NUM_LIT:2> ) ; } this . poolContent [ this . currentOffset ++ ] = ( byte ) ( value > > > <NUM_LIT:8> ) ; this . poolContent [ this . currentOffset ++ ] = ( byte ) value ; } public void reset ( ) { if ( this . doubleCache != null ) this . doubleCache . clear ( ) ; if ( this . floatCache != null ) this . floatCache . clear ( ) ; if ( this . intCache != null ) this . intCache . clear ( ) ; if ( this . longCache != null ) this . longCache . clear ( ) ; this . UTF8Cache . clear ( ) ; this . stringCache . clear ( ) ; this . methodsAndFieldsCache . clear ( ) ; this . classCache . clear ( ) ; this . nameAndTypeCacheForFieldsAndMethods . clear ( ) ; this . currentIndex = <NUM_LIT:1> ; this . currentOffset = <NUM_LIT:0> ; } public void resetForAttributeName ( char [ ] attributeName , int constantPoolIndex , int constantPoolOffset ) { this . currentIndex = constantPoolIndex ; this . currentOffset = constantPoolOffset ; if ( this . UTF8Cache . get ( attributeName ) >= constantPoolIndex ) { this . UTF8Cache . remove ( attributeName ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class IntegerCache { public int keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public IntegerCache ( ) { this ( <NUM_LIT> ) ; } public IntegerCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new int [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( int key ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int hash ( int key ) { return ( key & <NUM_LIT> ) % this . keyTable . length ; } public int put ( int key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return value ; } public int putIfAbsent ( int key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return - value ; } private void rehash ( ) { IntegerCache newHashtable = new IntegerCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { int key = this . keyTable [ i ] ; int value = this . valueTable [ i ] ; if ( ( key != <NUM_LIT:0> ) || ( ( key == <NUM_LIT:0> ) && ( value != <NUM_LIT:0> ) ) ) { newHashtable . put ( key , value ) ; } } this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import java . text . MessageFormat ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class StackMapFrame { public static final int USED = <NUM_LIT:1> ; public static final int SAME_FRAME = <NUM_LIT:0> ; public static final int CHOP_FRAME = <NUM_LIT:1> ; public static final int APPEND_FRAME = <NUM_LIT:2> ; public static final int SAME_FRAME_EXTENDED = <NUM_LIT:3> ; public static final int FULL_FRAME = <NUM_LIT:4> ; public static final int SAME_LOCALS_1_STACK_ITEMS = <NUM_LIT:5> ; public static final int SAME_LOCALS_1_STACK_ITEMS_EXTENDED = <NUM_LIT:6> ; public int pc ; public int numberOfStackItems ; private int numberOfLocals ; public int localIndex ; public VerificationTypeInfo [ ] locals ; public VerificationTypeInfo [ ] stackItems ; private int numberOfDifferentLocals = - <NUM_LIT:1> ; public int tagBits ; public StackMapFrame ( int initialLocalSize ) { this . locals = new VerificationTypeInfo [ initialLocalSize ] ; this . numberOfLocals = - <NUM_LIT:1> ; this . numberOfDifferentLocals = - <NUM_LIT:1> ; } public int getFrameType ( StackMapFrame prevFrame ) { final int offsetDelta = getOffsetDelta ( prevFrame ) ; switch ( this . numberOfStackItems ) { case <NUM_LIT:0> : switch ( numberOfDifferentLocals ( prevFrame ) ) { case <NUM_LIT:0> : return offsetDelta <= <NUM_LIT> ? SAME_FRAME : SAME_FRAME_EXTENDED ; case <NUM_LIT:1> : case <NUM_LIT:2> : case <NUM_LIT:3> : return APPEND_FRAME ; case - <NUM_LIT:1> : case - <NUM_LIT:2> : case - <NUM_LIT:3> : return CHOP_FRAME ; } break ; case <NUM_LIT:1> : switch ( numberOfDifferentLocals ( prevFrame ) ) { case <NUM_LIT:0> : return offsetDelta <= <NUM_LIT> ? SAME_LOCALS_1_STACK_ITEMS : SAME_LOCALS_1_STACK_ITEMS_EXTENDED ; } } return FULL_FRAME ; } public void addLocal ( int resolvedPosition , VerificationTypeInfo info ) { if ( this . locals == null ) { this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] ; this . locals [ resolvedPosition ] = info ; } else { final int length = this . locals . length ; if ( resolvedPosition >= length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . locals [ resolvedPosition ] = info ; } } public void addStackItem ( VerificationTypeInfo info ) { if ( info == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } if ( this . stackItems == null ) { this . stackItems = new VerificationTypeInfo [ <NUM_LIT:1> ] ; this . stackItems [ <NUM_LIT:0> ] = info ; this . numberOfStackItems = <NUM_LIT:1> ; } else { final int length = this . stackItems . length ; if ( this . numberOfStackItems == length ) { System . arraycopy ( this . stackItems , <NUM_LIT:0> , this . stackItems = new VerificationTypeInfo [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . stackItems [ this . numberOfStackItems ++ ] = info ; } } public void addStackItem ( TypeBinding binding ) { if ( this . stackItems == null ) { this . stackItems = new VerificationTypeInfo [ <NUM_LIT:1> ] ; this . stackItems [ <NUM_LIT:0> ] = new VerificationTypeInfo ( binding ) ; this . numberOfStackItems = <NUM_LIT:1> ; } else { final int length = this . stackItems . length ; if ( this . numberOfStackItems == length ) { System . arraycopy ( this . stackItems , <NUM_LIT:0> , this . stackItems = new VerificationTypeInfo [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . stackItems [ this . numberOfStackItems ++ ] = new VerificationTypeInfo ( binding ) ; } } public StackMapFrame duplicate ( ) { int length = this . locals . length ; StackMapFrame result = new StackMapFrame ( length ) ; result . numberOfLocals = - <NUM_LIT:1> ; result . numberOfDifferentLocals = - <NUM_LIT:1> ; result . pc = this . pc ; result . numberOfStackItems = this . numberOfStackItems ; if ( length != <NUM_LIT:0> ) { result . locals = new VerificationTypeInfo [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final VerificationTypeInfo verificationTypeInfo = this . locals [ i ] ; if ( verificationTypeInfo != null ) { result . locals [ i ] = verificationTypeInfo . duplicate ( ) ; } } } length = this . numberOfStackItems ; if ( length != <NUM_LIT:0> ) { result . stackItems = new VerificationTypeInfo [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { result . stackItems [ i ] = this . stackItems [ i ] . duplicate ( ) ; } } return result ; } public int numberOfDifferentLocals ( StackMapFrame prevFrame ) { if ( this . numberOfDifferentLocals != - <NUM_LIT:1> ) return this . numberOfDifferentLocals ; if ( prevFrame == null ) { this . numberOfDifferentLocals = <NUM_LIT:0> ; return <NUM_LIT:0> ; } VerificationTypeInfo [ ] prevLocals = prevFrame . locals ; VerificationTypeInfo [ ] currentLocals = this . locals ; int prevLocalsLength = prevLocals == null ? <NUM_LIT:0> : prevLocals . length ; int currentLocalsLength = currentLocals == null ? <NUM_LIT:0> : currentLocals . length ; int prevNumberOfLocals = prevFrame . getNumberOfLocals ( ) ; int currentNumberOfLocals = getNumberOfLocals ( ) ; int result = <NUM_LIT:0> ; if ( prevNumberOfLocals == <NUM_LIT:0> ) { if ( currentNumberOfLocals != <NUM_LIT:0> ) { result = currentNumberOfLocals ; int counter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < currentLocalsLength && counter < currentNumberOfLocals ; i ++ ) { if ( currentLocals [ i ] != null ) { switch ( currentLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } } else if ( currentNumberOfLocals == <NUM_LIT:0> ) { int counter = <NUM_LIT:0> ; result = - prevNumberOfLocals ; for ( int i = <NUM_LIT:0> ; i < prevLocalsLength && counter < prevNumberOfLocals ; i ++ ) { if ( prevLocals [ i ] != null ) { switch ( prevLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } else { int indexInPrevLocals = <NUM_LIT:0> ; int indexInCurrentLocals = <NUM_LIT:0> ; int currentLocalsCounter = <NUM_LIT:0> ; int prevLocalsCounter = <NUM_LIT:0> ; currentLocalsLoop : for ( ; indexInCurrentLocals < currentLocalsLength && currentLocalsCounter < currentNumberOfLocals ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal != null ) { currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } if ( indexInPrevLocals < prevLocalsLength && prevLocalsCounter < prevNumberOfLocals ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal != null ) { prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } if ( equals ( prevLocal , currentLocal ) && indexInPrevLocals == indexInCurrentLocals ) { if ( result != <NUM_LIT:0> ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInPrevLocals ++ ; continue currentLocalsLoop ; } if ( currentLocal != null ) { result ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInCurrentLocals ++ ; break currentLocalsLoop ; } if ( currentLocalsCounter < currentNumberOfLocals ) { for ( ; indexInCurrentLocals < currentLocalsLength && currentLocalsCounter < currentNumberOfLocals ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result ++ ; currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } } else if ( prevLocalsCounter < prevNumberOfLocals ) { result = - result ; for ( ; indexInPrevLocals < prevLocalsLength && prevLocalsCounter < prevNumberOfLocals ; indexInPrevLocals ++ ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result -- ; prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } } } this . numberOfDifferentLocals = result ; return result ; } public int getNumberOfLocals ( ) { if ( this . numberOfLocals != - <NUM_LIT:1> ) { return this . numberOfLocals ; } int result = <NUM_LIT:0> ; final int length = this . locals == null ? <NUM_LIT:0> : this . locals . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( this . locals [ i ] != null ) { switch ( this . locals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } result ++ ; } } this . numberOfLocals = result ; return result ; } public int getOffsetDelta ( StackMapFrame prevFrame ) { if ( prevFrame == null ) return this . pc ; return prevFrame . pc == - <NUM_LIT:1> ? this . pc : this . pc - prevFrame . pc - <NUM_LIT:1> ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; printFrame ( buffer , this ) ; return String . valueOf ( buffer ) ; } private void printFrame ( StringBuffer buffer , StackMapFrame frame ) { String pattern = "<STR_LIT>" ; int localsLength = frame . locals == null ? <NUM_LIT:0> : frame . locals . length ; buffer . append ( MessageFormat . format ( pattern , new String [ ] { Integer . toString ( frame . pc ) , Integer . toString ( frame . getNumberOfLocals ( ) ) , Integer . toString ( frame . numberOfStackItems ) , print ( frame . locals , localsLength ) , print ( frame . stackItems , frame . numberOfStackItems ) } ) ) ; } private String print ( VerificationTypeInfo [ ] infos , int length ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT:[>' ) ; if ( infos != null ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i != <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; VerificationTypeInfo verificationTypeInfo = infos [ i ] ; if ( verificationTypeInfo == null ) { buffer . append ( "<STR_LIT>" ) ; continue ; } buffer . append ( verificationTypeInfo ) ; } } buffer . append ( '<CHAR_LIT:]>' ) ; return String . valueOf ( buffer ) ; } public void putLocal ( int resolvedPosition , VerificationTypeInfo info ) { if ( this . locals == null ) { this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] ; this . locals [ resolvedPosition ] = info ; } else { final int length = this . locals . length ; if ( resolvedPosition >= length ) { System . arraycopy ( this . locals , <NUM_LIT:0> , this . locals = new VerificationTypeInfo [ resolvedPosition + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; } this . locals [ resolvedPosition ] = info ; } } public void replaceWithElementType ( ) { VerificationTypeInfo info = this . stackItems [ this . numberOfStackItems - <NUM_LIT:1> ] ; VerificationTypeInfo info2 = info . duplicate ( ) ; info2 . replaceWithElementType ( ) ; this . stackItems [ this . numberOfStackItems - <NUM_LIT:1> ] = info2 ; } public int getIndexOfDifferentLocals ( int differentLocalsCount ) { for ( int i = this . locals . length - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { VerificationTypeInfo currentLocal = this . locals [ i ] ; if ( currentLocal == null ) { continue ; } else { differentLocalsCount -- ; } if ( differentLocalsCount == <NUM_LIT:0> ) { return i ; } } return <NUM_LIT:0> ; } private boolean equals ( VerificationTypeInfo info , VerificationTypeInfo info2 ) { if ( info == null ) { return info2 == null ; } if ( info2 == null ) return false ; return info . equals ( info2 ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class DoubleCache { private double keyTable [ ] ; private int valueTable [ ] ; private int elementSize ; public DoubleCache ( ) { this ( <NUM_LIT> ) ; } public DoubleCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . keyTable = new double [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0.0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( double key ) { if ( key == <NUM_LIT:0.0> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0> ) { long value1 = Double . doubleToLongBits ( key ) ; long value2 = Double . doubleToLongBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return true ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return true ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return true ; } } } return false ; } public int put ( double key , int value ) { if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new double [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return value ; } public int putIfAbsent ( double key , int value ) { if ( key == <NUM_LIT:0.0> ) { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == <NUM_LIT:0.0> ) { long value1 = Double . doubleToLongBits ( key ) ; long value2 = Double . doubleToLongBits ( this . keyTable [ i ] ) ; if ( value1 == - <NUM_LIT> && value2 == - <NUM_LIT> ) return this . valueTable [ i ] ; if ( value1 == <NUM_LIT:0> && value2 == <NUM_LIT:0> ) return this . valueTable [ i ] ; } } } else { for ( int i = <NUM_LIT:0> , max = this . elementSize ; i < max ; i ++ ) { if ( this . keyTable [ i ] == key ) { return this . valueTable [ i ] ; } } } if ( this . elementSize == this . keyTable . length ) { System . arraycopy ( this . keyTable , <NUM_LIT:0> , ( this . keyTable = new double [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; System . arraycopy ( this . valueTable , <NUM_LIT:0> , ( this . valueTable = new int [ this . elementSize * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . elementSize ) ; } this . keyTable [ this . elementSize ] = key ; this . valueTable [ this . elementSize ] = value ; this . elementSize ++ ; return - value ; } public String toString ( ) { int max = this . elementSize ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public abstract class Label { public CodeStream codeStream ; public int position = POS_NOT_SET ; public final static int POS_NOT_SET = - <NUM_LIT:1> ; public Label ( ) { } public Label ( CodeStream codeStream ) { this . codeStream = codeStream ; } public abstract void place ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class VerificationTypeInfo { public static final int ITEM_TOP = <NUM_LIT:0> ; public static final int ITEM_INTEGER = <NUM_LIT:1> ; public static final int ITEM_FLOAT = <NUM_LIT:2> ; public static final int ITEM_DOUBLE = <NUM_LIT:3> ; public static final int ITEM_LONG = <NUM_LIT:4> ; public static final int ITEM_NULL = <NUM_LIT:5> ; public static final int ITEM_UNINITIALIZED_THIS = <NUM_LIT:6> ; public static final int ITEM_OBJECT = <NUM_LIT:7> ; public static final int ITEM_UNINITIALIZED = <NUM_LIT:8> ; public int tag ; private int id ; private char [ ] constantPoolName ; public int offset ; private VerificationTypeInfo ( ) { } public VerificationTypeInfo ( int id , char [ ] constantPoolName ) { this ( id , VerificationTypeInfo . ITEM_OBJECT , constantPoolName ) ; } public VerificationTypeInfo ( int id , int tag , char [ ] constantPoolName ) { this . id = id ; this . tag = tag ; this . constantPoolName = constantPoolName ; } public VerificationTypeInfo ( int tag , TypeBinding binding ) { this ( binding ) ; this . tag = tag ; } public VerificationTypeInfo ( TypeBinding binding ) { this . id = binding . id ; switch ( binding . id ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_int : case TypeIds . T_short : this . tag = VerificationTypeInfo . ITEM_INTEGER ; break ; case TypeIds . T_float : this . tag = VerificationTypeInfo . ITEM_FLOAT ; break ; case TypeIds . T_long : this . tag = VerificationTypeInfo . ITEM_LONG ; break ; case TypeIds . T_double : this . tag = VerificationTypeInfo . ITEM_DOUBLE ; break ; case TypeIds . T_null : this . tag = VerificationTypeInfo . ITEM_NULL ; break ; default : this . tag = VerificationTypeInfo . ITEM_OBJECT ; this . constantPoolName = binding . constantPoolName ( ) ; } } public void setBinding ( TypeBinding binding ) { this . constantPoolName = binding . constantPoolName ( ) ; final int typeBindingId = binding . id ; this . id = typeBindingId ; switch ( typeBindingId ) { case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_int : case TypeIds . T_short : this . tag = VerificationTypeInfo . ITEM_INTEGER ; break ; case TypeIds . T_float : this . tag = VerificationTypeInfo . ITEM_FLOAT ; break ; case TypeIds . T_long : this . tag = VerificationTypeInfo . ITEM_LONG ; break ; case TypeIds . T_double : this . tag = VerificationTypeInfo . ITEM_DOUBLE ; break ; case TypeIds . T_null : this . tag = VerificationTypeInfo . ITEM_NULL ; break ; default : this . tag = VerificationTypeInfo . ITEM_OBJECT ; } } public int id ( ) { return this . id ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; switch ( this . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED_THIS : buffer . append ( "<STR_LIT>" ) . append ( readableName ( ) ) . append ( "<STR_LIT:)>" ) ; break ; case VerificationTypeInfo . ITEM_UNINITIALIZED : buffer . append ( "<STR_LIT>" ) . append ( readableName ( ) ) . append ( "<STR_LIT:)>" ) ; break ; case VerificationTypeInfo . ITEM_OBJECT : buffer . append ( readableName ( ) ) ; break ; case VerificationTypeInfo . ITEM_DOUBLE : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_FLOAT : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_INTEGER : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_LONG : buffer . append ( '<CHAR_LIT>' ) ; break ; case VerificationTypeInfo . ITEM_NULL : buffer . append ( "<STR_LIT:null>" ) ; break ; case VerificationTypeInfo . ITEM_TOP : buffer . append ( "<STR_LIT>" ) ; break ; } return String . valueOf ( buffer ) ; } public VerificationTypeInfo duplicate ( ) { final VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo ( ) ; verificationTypeInfo . id = this . id ; verificationTypeInfo . tag = this . tag ; verificationTypeInfo . constantPoolName = this . constantPoolName ; verificationTypeInfo . offset = this . offset ; return verificationTypeInfo ; } public boolean equals ( Object obj ) { if ( obj instanceof VerificationTypeInfo ) { VerificationTypeInfo info1 = ( VerificationTypeInfo ) obj ; return info1 . tag == this . tag && CharOperation . equals ( info1 . constantPoolName ( ) , constantPoolName ( ) ) ; } return false ; } public int hashCode ( ) { return this . tag + this . id + this . constantPoolName . length + this . offset ; } public char [ ] constantPoolName ( ) { return this . constantPoolName ; } public char [ ] readableName ( ) { return this . constantPoolName ; } public void replaceWithElementType ( ) { if ( this . constantPoolName [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) { this . constantPoolName = CharOperation . subarray ( this . constantPoolName , <NUM_LIT:2> , this . constantPoolName . length - <NUM_LIT:1> ) ; } else { this . constantPoolName = CharOperation . subarray ( this . constantPoolName , <NUM_LIT:1> , this . constantPoolName . length ) ; if ( this . constantPoolName . length == <NUM_LIT:1> ) { switch ( this . constantPoolName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : this . id = TypeIds . T_int ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_byte ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_short ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_char ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_long ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_float ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_double ; break ; case '<CHAR_LIT:Z>' : this . id = TypeIds . T_boolean ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_null ; break ; case '<CHAR_LIT>' : this . id = TypeIds . T_void ; break ; } } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; import org . eclipse . jdt . core . compiler . CharOperation ; public class CharArrayCache { public char [ ] keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public CharArrayCache ( ) { this ( <NUM_LIT:9> ) ; } public CharArrayCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( initialCapacity * <NUM_LIT:2> ) / <NUM_LIT:3> ; this . keyTable = new char [ initialCapacity ] [ ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = null ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int get ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return - <NUM_LIT:1> ; } public int putIfAbsent ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return - value ; } private int put ( char [ ] key , int value ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) rehash ( ) ; return value ; } private void rehash ( ) { CharArrayCache newHashtable = new CharArrayCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) if ( this . keyTable [ i ] != null ) newHashtable . put ( this . keyTable [ i ] , this . valueTable [ i ] ) ; this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public void remove ( char [ ] key ) { int length = this . keyTable . length , index = CharOperation . hashCode ( key ) % length ; while ( this . keyTable [ index ] != null ) { if ( CharOperation . equals ( this . keyTable [ index ] , key ) ) { this . valueTable [ index ] = <NUM_LIT:0> ; this . keyTable [ index ] = null ; return ; } if ( ++ index == length ) { index = <NUM_LIT:0> ; } } } public char [ ] returnKeyFor ( int value ) { for ( int i = this . keyTable . length ; i -- > <NUM_LIT:0> ; ) { if ( this . valueTable [ i ] == value ) { return this . keyTable [ i ] ; } } return null ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( this . keyTable [ i ] != null ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . codegen ; public class LongCache { public long keyTable [ ] ; public int valueTable [ ] ; int elementSize ; int threshold ; public LongCache ( ) { this ( <NUM_LIT> ) ; } public LongCache ( int initialCapacity ) { this . elementSize = <NUM_LIT:0> ; this . threshold = ( int ) ( initialCapacity * <NUM_LIT> ) ; this . keyTable = new long [ initialCapacity ] ; this . valueTable = new int [ initialCapacity ] ; } public void clear ( ) { for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { this . keyTable [ i ] = <NUM_LIT:0> ; this . valueTable [ i ] = <NUM_LIT:0> ; } this . elementSize = <NUM_LIT:0> ; } public boolean containsKey ( long key ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return true ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } return false ; } public int hash ( long key ) { return ( ( int ) key & <NUM_LIT> ) % this . keyTable . length ; } public int put ( long key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] = value ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return value ; } public int putIfAbsent ( long key , int value ) { int index = hash ( key ) , length = this . keyTable . length ; while ( ( this . keyTable [ index ] != <NUM_LIT:0> ) || ( ( this . keyTable [ index ] == <NUM_LIT:0> ) && ( this . valueTable [ index ] != <NUM_LIT:0> ) ) ) { if ( this . keyTable [ index ] == key ) return this . valueTable [ index ] ; if ( ++ index == length ) { index = <NUM_LIT:0> ; } } this . keyTable [ index ] = key ; this . valueTable [ index ] = value ; if ( ++ this . elementSize > this . threshold ) { rehash ( ) ; } return - value ; } private void rehash ( ) { LongCache newHashtable = new LongCache ( this . keyTable . length * <NUM_LIT:2> ) ; for ( int i = this . keyTable . length ; -- i >= <NUM_LIT:0> ; ) { long key = this . keyTable [ i ] ; int value = this . valueTable [ i ] ; if ( ( key != <NUM_LIT:0> ) || ( ( key == <NUM_LIT:0> ) && ( value != <NUM_LIT:0> ) ) ) { newHashtable . put ( key , value ) ; } } this . keyTable = newHashtable . keyTable ; this . valueTable = newHashtable . valueTable ; this . threshold = newHashtable . threshold ; } public int size ( ) { return this . elementSize ; } public String toString ( ) { int max = size ( ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<STR_LIT:{>" ) ; for ( int i = <NUM_LIT:0> ; i < max ; ++ i ) { if ( ( this . keyTable [ i ] != <NUM_LIT:0> ) || ( ( this . keyTable [ i ] == <NUM_LIT:0> ) && ( this . valueTable [ i ] != <NUM_LIT:0> ) ) ) { buf . append ( this . keyTable [ i ] ) . append ( "<STR_LIT>" ) . append ( this . valueTable [ i ] ) ; } if ( i < max ) { buf . append ( "<STR_LIT:U+002CU+0020>" ) ; } } buf . append ( "<STR_LIT:}>" ) ; return buf . toString ( ) ; } } </s>