text
stringlengths
30
1.67M
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; 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 . Util ; public class TypeDeclaration extends Statement implements ProblemSeverities , ReferenceContext { public static final int CLASS_DECL = <NUM_LIT:1> ; public static final int INTERFACE_DECL = <NUM_LIT:2> ; public static final int ENUM_DECL = <NUM_LIT:3> ; public static final int ANNOTATION_TYPE_DECL = <NUM_LIT:4> ; public int modifiers = ClassFileConstants . AccDefault ; public int modifiersSourceStart ; public Annotation [ ] annotations ; public char [ ] name ; public TypeReference superclass ; public TypeReference [ ] superInterfaces ; public FieldDeclaration [ ] fields ; public AbstractMethodDeclaration [ ] methods ; public TypeDeclaration [ ] memberTypes ; public SourceTypeBinding binding ; public ClassScope scope ; public MethodScope initializerScope ; public MethodScope staticInitializerScope ; public boolean ignoreFurtherInvestigation = false ; public int maxFieldCount ; public int declarationSourceStart ; public int declarationSourceEnd ; public int bodyStart ; public int bodyEnd ; public CompilationResult compilationResult ; public MethodDeclaration [ ] missingAbstractMethods ; public Javadoc javadoc ; public QualifiedAllocationExpression allocation ; public TypeDeclaration enclosingType ; public FieldBinding enumValuesSyntheticfield ; public int enumConstantsCounter ; public TypeParameter [ ] typeParameters ; public TypeDeclaration ( CompilationResult compilationResult ) { this . compilationResult = compilationResult ; } public void abort ( int abortLevel , CategorizedProblem problem ) { switch ( abortLevel ) { case AbortCompilation : throw new AbortCompilation ( this . compilationResult , problem ) ; case AbortCompilationUnit : throw new AbortCompilationUnit ( this . compilationResult , problem ) ; case AbortMethod : throw new AbortMethod ( this . compilationResult , problem ) ; default : throw new AbortType ( this . compilationResult , problem ) ; } } public final void addClinit ( ) { if ( needClassInitMethod ( ) ) { int length ; AbstractMethodDeclaration [ ] methodDeclarations ; if ( ( methodDeclarations = this . methods ) == null ) { length = <NUM_LIT:0> ; methodDeclarations = new AbstractMethodDeclaration [ <NUM_LIT:1> ] ; } else { length = methodDeclarations . length ; System . arraycopy ( methodDeclarations , <NUM_LIT:0> , ( methodDeclarations = new AbstractMethodDeclaration [ length + <NUM_LIT:1> ] ) , <NUM_LIT:1> , length ) ; } Clinit clinit = new Clinit ( this . compilationResult ) ; methodDeclarations [ <NUM_LIT:0> ] = clinit ; clinit . declarationSourceStart = clinit . sourceStart = this . sourceStart ; clinit . declarationSourceEnd = clinit . sourceEnd = this . sourceEnd ; clinit . bodyEnd = this . sourceEnd ; this . methods = methodDeclarations ; } } public MethodDeclaration addMissingAbstractMethodFor ( MethodBinding methodBinding ) { TypeBinding [ ] argumentTypes = methodBinding . parameters ; int argumentsLength = argumentTypes . length ; MethodDeclaration methodDeclaration = new MethodDeclaration ( this . compilationResult ) ; methodDeclaration . selector = methodBinding . selector ; methodDeclaration . sourceStart = this . sourceStart ; methodDeclaration . sourceEnd = this . sourceEnd ; methodDeclaration . modifiers = methodBinding . getAccessFlags ( ) & ~ ClassFileConstants . AccAbstract ; if ( argumentsLength > <NUM_LIT:0> ) { String baseName = "<STR_LIT>" ; Argument [ ] arguments = ( methodDeclaration . arguments = new Argument [ argumentsLength ] ) ; for ( int i = argumentsLength ; -- i >= <NUM_LIT:0> ; ) { arguments [ i ] = new Argument ( ( baseName + i ) . toCharArray ( ) , <NUM_LIT> , null , ClassFileConstants . AccDefault ) ; } } if ( this . missingAbstractMethods == null ) { this . missingAbstractMethods = new MethodDeclaration [ ] { methodDeclaration } ; } else { MethodDeclaration [ ] newMethods ; System . arraycopy ( this . missingAbstractMethods , <NUM_LIT:0> , newMethods = new MethodDeclaration [ this . missingAbstractMethods . length + <NUM_LIT:1> ] , <NUM_LIT:1> , this . missingAbstractMethods . length ) ; newMethods [ <NUM_LIT:0> ] = methodDeclaration ; this . missingAbstractMethods = newMethods ; } methodDeclaration . binding = new MethodBinding ( methodDeclaration . modifiers | ClassFileConstants . AccSynthetic , methodBinding . selector , methodBinding . returnType , argumentsLength == <NUM_LIT:0> ? Binding . NO_PARAMETERS : argumentTypes , methodBinding . thrownExceptions , this . binding ) ; methodDeclaration . scope = new MethodScope ( this . scope , methodDeclaration , true ) ; methodDeclaration . bindArguments ( ) ; return methodDeclaration ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . ignoreFurtherInvestigation ) return flowInfo ; try { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { this . bits |= ASTNode . IsReachable ; LocalTypeBinding localType = ( LocalTypeBinding ) this . binding ; localType . setConstantPoolName ( currentScope . compilationUnitScope ( ) . computeConstantPoolName ( localType ) ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; updateMaxFieldCount ( ) ; internalAnalyseCode ( flowContext , flowInfo ) ; } catch ( AbortType e ) { this . ignoreFurtherInvestigation = true ; } return flowInfo ; } public void analyseCode ( ClassScope enclosingClassScope ) { if ( this . ignoreFurtherInvestigation ) return ; try { updateMaxFieldCount ( ) ; internalAnalyseCode ( null , FlowInfo . initial ( this . maxFieldCount ) ) ; } catch ( AbortType e ) { this . ignoreFurtherInvestigation = true ; } } public void analyseCode ( ClassScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . ignoreFurtherInvestigation ) return ; try { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { this . bits |= ASTNode . IsReachable ; LocalTypeBinding localType = ( LocalTypeBinding ) this . binding ; localType . setConstantPoolName ( currentScope . compilationUnitScope ( ) . computeConstantPoolName ( localType ) ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; updateMaxFieldCount ( ) ; internalAnalyseCode ( flowContext , flowInfo ) ; } catch ( AbortType e ) { this . ignoreFurtherInvestigation = true ; } } public void analyseCode ( CompilationUnitScope unitScope ) { if ( this . ignoreFurtherInvestigation ) return ; try { internalAnalyseCode ( null , FlowInfo . initial ( this . maxFieldCount ) ) ; } catch ( AbortType e ) { this . ignoreFurtherInvestigation = true ; } } public boolean checkConstructors ( Parser parser ) { boolean hasConstructor = false ; if ( this . methods != null ) { for ( int i = this . methods . length ; -- i >= <NUM_LIT:0> ; ) { AbstractMethodDeclaration am ; if ( ( am = this . methods [ i ] ) . isConstructor ( ) ) { if ( ! CharOperation . equals ( am . selector , this . name ) ) { ConstructorDeclaration c = ( ConstructorDeclaration ) am ; if ( c . constructorCall == null || c . constructorCall . isImplicitSuper ( ) ) { MethodDeclaration m = parser . convertToMethodDeclaration ( c , this . compilationResult ) ; this . methods [ i ] = m ; } } else { switch ( kind ( this . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : parser . problemReporter ( ) . interfaceCannotHaveConstructors ( ( ConstructorDeclaration ) am ) ; break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : parser . problemReporter ( ) . annotationTypeDeclarationCannotHaveConstructor ( ( ConstructorDeclaration ) am ) ; break ; } hasConstructor = true ; } } } } return hasConstructor ; } public CompilationResult compilationResult ( ) { return this . compilationResult ; } public ConstructorDeclaration createDefaultConstructor ( boolean needExplicitConstructorCall , boolean needToInsert ) { ConstructorDeclaration constructor = new ConstructorDeclaration ( this . compilationResult ) ; constructor . bits |= ASTNode . IsDefaultConstructor ; constructor . selector = this . name ; constructor . modifiers = this . modifiers & ExtraCompilerModifiers . AccVisibilityMASK ; constructor . declarationSourceStart = constructor . sourceStart = this . sourceStart ; constructor . declarationSourceEnd = constructor . sourceEnd = constructor . bodyEnd = this . sourceEnd ; if ( needExplicitConstructorCall ) { constructor . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; constructor . constructorCall . sourceStart = this . sourceStart ; constructor . constructorCall . sourceEnd = this . sourceEnd ; } if ( needToInsert ) { if ( this . methods == null ) { this . methods = new AbstractMethodDeclaration [ ] { constructor } ; } else { AbstractMethodDeclaration [ ] newMethods ; System . arraycopy ( this . methods , <NUM_LIT:0> , newMethods = new AbstractMethodDeclaration [ this . methods . length + <NUM_LIT:1> ] , <NUM_LIT:1> , this . methods . length ) ; newMethods [ <NUM_LIT:0> ] = constructor ; this . methods = newMethods ; } } return constructor ; } public MethodBinding createDefaultConstructorWithBinding ( MethodBinding inheritedConstructorBinding , boolean eraseThrownExceptions ) { String baseName = "<STR_LIT>" ; TypeBinding [ ] argumentTypes = inheritedConstructorBinding . parameters ; int argumentsLength = argumentTypes . length ; ConstructorDeclaration constructor = new ConstructorDeclaration ( this . compilationResult ) ; constructor . selector = new char [ ] { '<CHAR_LIT>' } ; constructor . sourceStart = this . sourceStart ; constructor . sourceEnd = this . sourceEnd ; int newModifiers = this . modifiers & ExtraCompilerModifiers . AccVisibilityMASK ; if ( inheritedConstructorBinding . isVarargs ( ) ) { newModifiers |= ClassFileConstants . AccVarargs ; } constructor . modifiers = newModifiers ; constructor . bits |= ASTNode . IsDefaultConstructor ; if ( argumentsLength > <NUM_LIT:0> ) { Argument [ ] arguments = ( constructor . arguments = new Argument [ argumentsLength ] ) ; for ( int i = argumentsLength ; -- i >= <NUM_LIT:0> ; ) { arguments [ i ] = new Argument ( ( baseName + i ) . toCharArray ( ) , <NUM_LIT> , null , ClassFileConstants . AccDefault ) ; } } constructor . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; constructor . constructorCall . sourceStart = this . sourceStart ; constructor . constructorCall . sourceEnd = this . sourceEnd ; if ( argumentsLength > <NUM_LIT:0> ) { Expression [ ] args ; args = constructor . constructorCall . arguments = new Expression [ argumentsLength ] ; for ( int i = argumentsLength ; -- i >= <NUM_LIT:0> ; ) { args [ i ] = new SingleNameReference ( ( baseName + i ) . toCharArray ( ) , <NUM_LIT> ) ; } } if ( this . methods == null ) { this . methods = new AbstractMethodDeclaration [ ] { constructor } ; } else { AbstractMethodDeclaration [ ] newMethods ; System . arraycopy ( this . methods , <NUM_LIT:0> , newMethods = new AbstractMethodDeclaration [ this . methods . length + <NUM_LIT:1> ] , <NUM_LIT:1> , this . methods . length ) ; newMethods [ <NUM_LIT:0> ] = constructor ; this . methods = newMethods ; } ReferenceBinding [ ] thrownExceptions = eraseThrownExceptions ? this . scope . environment ( ) . convertToRawTypes ( inheritedConstructorBinding . thrownExceptions , true , true ) : inheritedConstructorBinding . thrownExceptions ; SourceTypeBinding sourceType = this . binding ; constructor . binding = new MethodBinding ( constructor . modifiers , argumentsLength == <NUM_LIT:0> ? Binding . NO_PARAMETERS : argumentTypes , thrownExceptions , sourceType ) ; constructor . binding . tagBits |= ( inheritedConstructorBinding . tagBits & TagBits . HasMissingType ) ; constructor . binding . modifiers |= ExtraCompilerModifiers . AccIsDefaultConstructor ; constructor . scope = new MethodScope ( this . scope , constructor , true ) ; constructor . bindArguments ( ) ; constructor . constructorCall . resolve ( constructor . scope ) ; MethodBinding [ ] methodBindings = sourceType . methods ( ) ; int length ; System . arraycopy ( methodBindings , <NUM_LIT:0> , methodBindings = new MethodBinding [ ( length = methodBindings . length ) + <NUM_LIT:1> ] , <NUM_LIT:1> , length ) ; methodBindings [ <NUM_LIT:0> ] = constructor . binding ; if ( ++ length > <NUM_LIT:1> ) ReferenceBinding . sortMethods ( methodBindings , <NUM_LIT:0> , length ) ; sourceType . setMethods ( methodBindings ) ; return constructor . binding ; } public FieldDeclaration declarationOf ( FieldBinding fieldBinding ) { if ( fieldBinding != null && this . fields != null ) { for ( int i = <NUM_LIT:0> , max = this . fields . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl ; if ( ( fieldDecl = this . fields [ i ] ) . binding == fieldBinding ) return fieldDecl ; } } return null ; } public TypeDeclaration declarationOf ( MemberTypeBinding memberTypeBinding ) { if ( memberTypeBinding != null && this . memberTypes != null ) { for ( int i = <NUM_LIT:0> , max = this . memberTypes . length ; i < max ; i ++ ) { TypeDeclaration memberTypeDecl ; if ( ( memberTypeDecl = this . memberTypes [ i ] ) . binding == memberTypeBinding ) return memberTypeDecl ; } } return null ; } public AbstractMethodDeclaration declarationOf ( MethodBinding methodBinding ) { if ( methodBinding != null && this . methods != null ) { for ( int i = <NUM_LIT:0> , max = this . methods . length ; i < max ; i ++ ) { AbstractMethodDeclaration methodDecl ; if ( ( methodDecl = this . methods [ i ] ) . binding == methodBinding ) return methodDecl ; } } return null ; } public TypeDeclaration declarationOfType ( char [ ] [ ] typeName ) { int typeNameLength = typeName . length ; if ( typeNameLength < <NUM_LIT:1> || ! CharOperation . equals ( typeName [ <NUM_LIT:0> ] , this . name ) ) { return null ; } if ( typeNameLength == <NUM_LIT:1> ) { return this ; } char [ ] [ ] subTypeName = new char [ typeNameLength - <NUM_LIT:1> ] [ ] ; System . arraycopy ( typeName , <NUM_LIT:1> , subTypeName , <NUM_LIT:0> , typeNameLength - <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:0> ; i < this . memberTypes . length ; i ++ ) { TypeDeclaration typeDecl = this . memberTypes [ i ] . declarationOfType ( subTypeName ) ; if ( typeDecl != null ) { return typeDecl ; } } return null ; } public CompilationUnitDeclaration getCompilationUnitDeclaration ( ) { if ( this . scope != null ) { return this . scope . compilationUnitScope ( ) . referenceContext ; } return null ; } public void generateCode ( ClassFile enclosingClassFile ) { if ( ( this . bits & ASTNode . HasBeenGenerated ) != <NUM_LIT:0> ) return ; this . bits |= ASTNode . HasBeenGenerated ; if ( this . ignoreFurtherInvestigation ) { if ( this . binding == null ) return ; ClassFile . createProblemType ( this , this . scope . referenceCompilationUnit ( ) . compilationResult ) ; return ; } try { ClassFile classFile = ClassFile . getNewInstance ( this . binding ) ; classFile . initialize ( this . binding , enclosingClassFile , false ) ; if ( this . binding . isMemberType ( ) ) { classFile . recordInnerClasses ( this . binding ) ; } else if ( this . binding . isLocalType ( ) ) { enclosingClassFile . recordInnerClasses ( this . binding ) ; classFile . recordInnerClasses ( this . binding ) ; } TypeVariableBinding [ ] typeVariables = this . binding . 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 ) ; } } classFile . addFieldInfos ( ) ; if ( this . memberTypes != null ) { for ( int i = <NUM_LIT:0> , max = this . memberTypes . length ; i < max ; i ++ ) { TypeDeclaration memberType = this . memberTypes [ i ] ; classFile . recordInnerClasses ( memberType . binding ) ; memberType . generateCode ( this . scope , classFile ) ; } } classFile . setForMethodInfos ( ) ; if ( this . methods != null ) { for ( int i = <NUM_LIT:0> , max = this . methods . length ; i < max ; i ++ ) { this . methods [ i ] . generateCode ( this . scope , classFile ) ; } } classFile . addSpecialMethods ( ) ; if ( this . ignoreFurtherInvestigation ) { throw new AbortType ( this . scope . referenceCompilationUnit ( ) . compilationResult , null ) ; } classFile . addAttributes ( ) ; this . scope . referenceCompilationUnit ( ) . compilationResult . record ( this . binding . constantPoolName ( ) , classFile ) ; } catch ( AbortType e ) { if ( this . binding == null ) return ; ClassFile . createProblemType ( this , this . scope . referenceCompilationUnit ( ) . compilationResult ) ; } } public void generateCode ( BlockScope blockScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } if ( ( this . bits & ASTNode . HasBeenGenerated ) != <NUM_LIT:0> ) return ; int pc = codeStream . position ; if ( this . binding != null ) { SyntheticArgumentBinding [ ] enclosingInstances = ( ( NestedTypeBinding ) this . binding ) . syntheticEnclosingInstances ( ) ; for ( int i = <NUM_LIT:0> , slotSize = <NUM_LIT:0> , count = enclosingInstances == null ? <NUM_LIT:0> : enclosingInstances . length ; i < count ; i ++ ) { SyntheticArgumentBinding enclosingInstance = enclosingInstances [ i ] ; enclosingInstance . resolvedPosition = ++ slotSize ; if ( slotSize > <NUM_LIT> ) { blockScope . problemReporter ( ) . noMoreAvailableSpaceForArgument ( enclosingInstance , blockScope . referenceType ( ) ) ; } } } generateCode ( codeStream . classFile ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateCode ( ClassScope classScope , ClassFile enclosingClassFile ) { if ( ( this . bits & ASTNode . HasBeenGenerated ) != <NUM_LIT:0> ) return ; if ( this . binding != null ) { SyntheticArgumentBinding [ ] enclosingInstances = ( ( NestedTypeBinding ) this . binding ) . syntheticEnclosingInstances ( ) ; for ( int i = <NUM_LIT:0> , slotSize = <NUM_LIT:0> , count = enclosingInstances == null ? <NUM_LIT:0> : enclosingInstances . length ; i < count ; i ++ ) { SyntheticArgumentBinding enclosingInstance = enclosingInstances [ i ] ; enclosingInstance . resolvedPosition = ++ slotSize ; if ( slotSize > <NUM_LIT> ) { classScope . problemReporter ( ) . noMoreAvailableSpaceForArgument ( enclosingInstance , classScope . referenceType ( ) ) ; } } } generateCode ( enclosingClassFile ) ; } public void generateCode ( CompilationUnitScope unitScope ) { generateCode ( ( ClassFile ) null ) ; } public boolean hasErrors ( ) { return this . ignoreFurtherInvestigation ; } private void internalAnalyseCode ( FlowContext flowContext , FlowInfo flowInfo ) { if ( ! this . binding . isUsed ( ) && this . binding . isOrEnclosedByPrivateType ( ) ) { if ( ! this . scope . referenceCompilationUnit ( ) . compilationResult . hasSyntaxError ) { this . scope . problemReporter ( ) . unusedPrivateType ( this ) ; } } FlowContext parentContext = ( flowContext instanceof InitializationFlowContext ) ? null : flowContext ; InitializationFlowContext initializerContext = new InitializationFlowContext ( parentContext , this , flowInfo , flowContext , this . initializerScope ) ; InitializationFlowContext staticInitializerContext = new InitializationFlowContext ( null , this , flowInfo , flowContext , this . staticInitializerScope ) ; FlowInfo nonStaticFieldInfo = flowInfo . unconditionalFieldLessCopy ( ) ; FlowInfo staticFieldInfo = flowInfo . unconditionalFieldLessCopy ( ) ; if ( this . fields != null ) { for ( int i = <NUM_LIT:0> , count = this . fields . length ; i < count ; i ++ ) { FieldDeclaration field = this . fields [ i ] ; if ( field . isStatic ( ) ) { if ( ( staticFieldInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) field . bits &= ~ ASTNode . IsReachable ; staticInitializerContext . handledExceptions = Binding . ANY_EXCEPTION ; staticFieldInfo = field . analyseCode ( this . staticInitializerScope , staticInitializerContext , staticFieldInfo ) ; if ( staticFieldInfo == FlowInfo . DEAD_END ) { this . staticInitializerScope . problemReporter ( ) . initializerMustCompleteNormally ( field ) ; staticFieldInfo = FlowInfo . initial ( this . maxFieldCount ) . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } } else { if ( ( nonStaticFieldInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) field . bits &= ~ ASTNode . IsReachable ; initializerContext . handledExceptions = Binding . ANY_EXCEPTION ; nonStaticFieldInfo = field . analyseCode ( this . initializerScope , initializerContext , nonStaticFieldInfo ) ; if ( nonStaticFieldInfo == FlowInfo . DEAD_END ) { this . initializerScope . problemReporter ( ) . initializerMustCompleteNormally ( field ) ; nonStaticFieldInfo = FlowInfo . initial ( this . maxFieldCount ) . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } } } } if ( this . memberTypes != null ) { for ( int i = <NUM_LIT:0> , count = this . memberTypes . length ; i < count ; i ++ ) { if ( flowContext != null ) { this . memberTypes [ i ] . analyseCode ( this . scope , flowContext , nonStaticFieldInfo . copy ( ) . setReachMode ( flowInfo . reachMode ( ) ) ) ; } else { this . memberTypes [ i ] . analyseCode ( this . scope ) ; } } } if ( this . methods != null ) { UnconditionalFlowInfo outerInfo = flowInfo . unconditionalFieldLessCopy ( ) ; FlowInfo constructorInfo = nonStaticFieldInfo . unconditionalInits ( ) . discardNonFieldInitializations ( ) . addInitializationsFrom ( outerInfo ) ; for ( int i = <NUM_LIT:0> , count = this . methods . length ; i < count ; i ++ ) { AbstractMethodDeclaration method = this . methods [ i ] ; if ( method . ignoreFurtherInvestigation ) continue ; if ( method . isInitializationMethod ( ) ) { if ( method . isStatic ( ) ) { ( ( Clinit ) method ) . analyseCode ( this . scope , staticInitializerContext , staticFieldInfo . unconditionalInits ( ) . discardNonFieldInitializations ( ) . addInitializationsFrom ( outerInfo ) ) ; } else { ( ( ConstructorDeclaration ) method ) . analyseCode ( this . scope , initializerContext , constructorInfo . copy ( ) , flowInfo . reachMode ( ) ) ; } } else { ( ( MethodDeclaration ) method ) . analyseCode ( this . scope , parentContext , flowInfo . copy ( ) ) ; } } } if ( this . binding . isEnum ( ) && ! this . binding . isAnonymousType ( ) ) { this . enumValuesSyntheticfield = this . binding . addSyntheticFieldForEnumValues ( ) ; } } public final static int kind ( int flags ) { switch ( flags & ( ClassFileConstants . AccInterface | ClassFileConstants . AccAnnotation | ClassFileConstants . AccEnum ) ) { case ClassFileConstants . AccInterface : return TypeDeclaration . INTERFACE_DECL ; case ClassFileConstants . AccInterface | ClassFileConstants . AccAnnotation : return TypeDeclaration . ANNOTATION_TYPE_DECL ; case ClassFileConstants . AccEnum : return TypeDeclaration . ENUM_DECL ; default : return TypeDeclaration . CLASS_DECL ; } } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; NestedTypeBinding nestedType = ( NestedTypeBinding ) this . binding ; MethodScope methodScope = currentScope . methodScope ( ) ; if ( ! methodScope . isStatic && ! methodScope . isConstructorCall ) { nestedType . addSyntheticArgumentAndField ( nestedType . enclosingType ( ) ) ; } if ( nestedType . isAnonymousType ( ) ) { ReferenceBinding superclassBinding = ( ReferenceBinding ) nestedType . superclass . erasure ( ) ; if ( superclassBinding . enclosingType ( ) != null && ! superclassBinding . isStatic ( ) ) { if ( ! superclassBinding . isLocalType ( ) || ( ( NestedTypeBinding ) superclassBinding ) . getSyntheticField ( superclassBinding . enclosingType ( ) , true ) != null ) { nestedType . addSyntheticArgument ( superclassBinding . enclosingType ( ) ) ; } } if ( ! methodScope . isStatic && methodScope . isConstructorCall && currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_5 ) { ReferenceBinding enclosing = nestedType . enclosingType ( ) ; if ( enclosing . isNestedType ( ) ) { NestedTypeBinding nestedEnclosing = ( NestedTypeBinding ) enclosing ; SyntheticArgumentBinding syntheticEnclosingInstanceArgument = nestedEnclosing . getSyntheticArgument ( nestedEnclosing . enclosingType ( ) , true ) ; if ( syntheticEnclosingInstanceArgument != null ) { nestedType . addSyntheticArgumentAndField ( syntheticEnclosingInstanceArgument ) ; } } } } } public void manageEnclosingInstanceAccessIfNecessary ( ClassScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) this . binding ; nestedType . addSyntheticArgumentAndField ( this . binding . enclosingType ( ) ) ; } } public final boolean needClassInitMethod ( ) { if ( ( this . bits & ASTNode . ContainsAssertion ) != <NUM_LIT:0> ) return true ; switch ( kind ( this . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : return this . fields != null ; case TypeDeclaration . ENUM_DECL : return true ; } if ( this . fields != null ) { for ( int i = this . fields . length ; -- i >= <NUM_LIT:0> ; ) { FieldDeclaration field = this . fields [ i ] ; if ( ( field . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ) return true ; } } return false ; } public void parseMethods ( Parser parser , CompilationUnitDeclaration unit ) { if ( unit . ignoreMethodBodies ) return ; if ( this . memberTypes != null ) { int length = this . memberTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeDeclaration typeDeclaration = this . memberTypes [ i ] ; typeDeclaration . parseMethods ( parser , unit ) ; this . bits |= ( typeDeclaration . bits & ASTNode . HasSyntaxErrors ) ; } } if ( this . methods != null ) { int length = this . methods . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { AbstractMethodDeclaration abstractMethodDeclaration = this . methods [ i ] ; abstractMethodDeclaration . parseStatements ( parser , unit ) ; this . bits |= ( abstractMethodDeclaration . bits & ASTNode . HasSyntaxErrors ) ; } } if ( this . fields != null ) { int length = this . fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final FieldDeclaration fieldDeclaration = this . fields [ i ] ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . INITIALIZER : ( ( Initializer ) fieldDeclaration ) . parseStatements ( parser , this , unit ) ; this . bits |= ( fieldDeclaration . bits & ASTNode . HasSyntaxErrors ) ; break ; } } } } public StringBuffer print ( int indent , StringBuffer output ) { if ( this . javadoc != null ) { this . javadoc . print ( indent , output ) ; } if ( ( this . bits & ASTNode . IsAnonymousType ) == <NUM_LIT:0> ) { printIndent ( indent , output ) ; printHeader ( <NUM_LIT:0> , output ) ; } return printBody ( indent , output ) ; } public StringBuffer printBody ( int indent , StringBuffer output ) { output . append ( "<STR_LIT>" ) ; if ( this . memberTypes != null ) { for ( int i = <NUM_LIT:0> ; i < this . memberTypes . length ; i ++ ) { if ( this . memberTypes [ i ] != null ) { output . append ( '<STR_LIT:\n>' ) ; this . memberTypes [ i ] . print ( indent + <NUM_LIT:1> , output ) ; } } } if ( this . fields != null ) { for ( int fieldI = <NUM_LIT:0> ; fieldI < this . fields . length ; fieldI ++ ) { if ( this . fields [ fieldI ] != null ) { output . append ( '<STR_LIT:\n>' ) ; this . fields [ fieldI ] . print ( indent + <NUM_LIT:1> , output ) ; } } } if ( this . methods != null ) { for ( int i = <NUM_LIT:0> ; i < this . methods . length ; i ++ ) { if ( this . methods [ i ] != null ) { output . append ( '<STR_LIT:\n>' ) ; this . methods [ i ] . print ( indent + <NUM_LIT:1> , output ) ; } } } output . append ( '<STR_LIT:\n>' ) ; return printIndent ( indent , output ) . append ( '<CHAR_LIT:}>' ) ; } public StringBuffer printHeader ( int indent , StringBuffer output ) { printModifiers ( this . modifiers , output ) ; if ( this . annotations != null ) printAnnotations ( this . annotations , output ) ; switch ( kind ( this . modifiers ) ) { case TypeDeclaration . CLASS_DECL : output . append ( "<STR_LIT>" ) ; break ; case TypeDeclaration . INTERFACE_DECL : output . append ( "<STR_LIT>" ) ; break ; case TypeDeclaration . ENUM_DECL : output . append ( "<STR_LIT>" ) ; break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : output . append ( "<STR_LIT>" ) ; break ; } output . append ( this . name ) ; if ( this . typeParameters != null ) { output . append ( "<STR_LIT:<>" ) ; for ( int i = <NUM_LIT:0> ; i < this . typeParameters . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . typeParameters [ i ] . print ( <NUM_LIT:0> , output ) ; } output . append ( "<STR_LIT:>>" ) ; } if ( this . superclass != null ) { output . append ( "<STR_LIT>" ) ; this . superclass . print ( <NUM_LIT:0> , output ) ; } if ( this . superInterfaces != null && this . superInterfaces . length > <NUM_LIT:0> ) { switch ( kind ( this . modifiers ) ) { case TypeDeclaration . CLASS_DECL : case TypeDeclaration . ENUM_DECL : output . append ( "<STR_LIT>" ) ; break ; case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : output . append ( "<STR_LIT>" ) ; break ; } for ( int i = <NUM_LIT:0> ; i < this . superInterfaces . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . superInterfaces [ i ] . print ( <NUM_LIT:0> , output ) ; } } return output ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { return print ( tab , output ) ; } public void resolve ( ) { SourceTypeBinding sourceType = this . binding ; if ( sourceType == null ) { this . ignoreFurtherInvestigation = true ; return ; } try { boolean old = this . staticInitializerScope . insideTypeAnnotation ; try { this . staticInitializerScope . insideTypeAnnotation = true ; resolveAnnotations ( this . staticInitializerScope , this . annotations , sourceType ) ; } finally { this . staticInitializerScope . insideTypeAnnotation = old ; } if ( ( sourceType . getAnnotationTagBits ( ) & TagBits . AnnotationDeprecated ) == <NUM_LIT:0> && ( sourceType . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> && this . scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { this . scope . problemReporter ( ) . missingDeprecatedAnnotationForType ( this ) ; } if ( ( this . bits & ASTNode . UndocumentedEmptyBlock ) != <NUM_LIT:0> ) { this . scope . problemReporter ( ) . undocumentedEmptyBlock ( this . bodyStart - <NUM_LIT:1> , this . bodyEnd ) ; } boolean needSerialVersion = this . scope . compilerOptions ( ) . getSeverity ( CompilerOptions . MissingSerialVersion ) != ProblemSeverities . Ignore && sourceType . isClass ( ) && sourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoExternalizable , false ) == null && sourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoSerializable , false ) != null ; if ( needSerialVersion ) { CompilationUnitScope compilationUnitScope = this . scope . compilationUnitScope ( ) ; MethodBinding methodBinding = sourceType . getExactMethod ( TypeConstants . WRITEREPLACE , Binding . NO_TYPES , compilationUnitScope ) ; ReferenceBinding [ ] throwsExceptions ; needSerialVersion = methodBinding == null || ! methodBinding . isValidBinding ( ) || methodBinding . returnType . id != TypeIds . T_JavaLangObject || ( throwsExceptions = methodBinding . thrownExceptions ) . length != <NUM_LIT:1> || throwsExceptions [ <NUM_LIT:0> ] . id != TypeIds . T_JavaIoObjectStreamException ; if ( needSerialVersion ) { boolean hasWriteObjectMethod = false ; boolean hasReadObjectMethod = false ; TypeBinding argumentTypeBinding = this . scope . getType ( TypeConstants . JAVA_IO_OBJECTOUTPUTSTREAM , <NUM_LIT:3> ) ; if ( argumentTypeBinding . isValidBinding ( ) ) { methodBinding = sourceType . getExactMethod ( TypeConstants . WRITEOBJECT , new TypeBinding [ ] { argumentTypeBinding } , compilationUnitScope ) ; hasWriteObjectMethod = methodBinding != null && methodBinding . isValidBinding ( ) && methodBinding . modifiers == ClassFileConstants . AccPrivate && methodBinding . returnType == TypeBinding . VOID && ( throwsExceptions = methodBinding . thrownExceptions ) . length == <NUM_LIT:1> && throwsExceptions [ <NUM_LIT:0> ] . id == TypeIds . T_JavaIoException ; } argumentTypeBinding = this . scope . getType ( TypeConstants . JAVA_IO_OBJECTINPUTSTREAM , <NUM_LIT:3> ) ; if ( argumentTypeBinding . isValidBinding ( ) ) { methodBinding = sourceType . getExactMethod ( TypeConstants . READOBJECT , new TypeBinding [ ] { argumentTypeBinding } , compilationUnitScope ) ; hasReadObjectMethod = methodBinding != null && methodBinding . isValidBinding ( ) && methodBinding . modifiers == ClassFileConstants . AccPrivate && methodBinding . returnType == TypeBinding . VOID && ( throwsExceptions = methodBinding . thrownExceptions ) . length == <NUM_LIT:1> && throwsExceptions [ <NUM_LIT:0> ] . id == TypeIds . T_JavaIoException ; } needSerialVersion = ! hasWriteObjectMethod || ! hasReadObjectMethod ; } } if ( sourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) != null ) { ReferenceBinding current = sourceType ; checkEnclosedInGeneric : do { if ( current . isGenericType ( ) ) { this . scope . problemReporter ( ) . genericTypeCannotExtendThrowable ( this ) ; break checkEnclosedInGeneric ; } if ( current . isStatic ( ) ) break checkEnclosedInGeneric ; if ( current . isLocalType ( ) ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) current . erasure ( ) ; if ( nestedType . scope . methodScope ( ) . isStatic ) break checkEnclosedInGeneric ; } } while ( ( current = current . enclosingType ( ) ) != null ) ; } int localMaxFieldCount = <NUM_LIT:0> ; int lastVisibleFieldID = - <NUM_LIT:1> ; boolean hasEnumConstants = false ; FieldDeclaration [ ] enumConstantsWithoutBody = null ; if ( this . typeParameters != null ) { for ( int i = <NUM_LIT:0> , count = this . typeParameters . length ; i < count ; i ++ ) { this . typeParameters [ i ] . resolve ( this . scope ) ; } } if ( this . memberTypes != null ) { for ( int i = <NUM_LIT:0> , count = this . memberTypes . length ; i < count ; i ++ ) { this . memberTypes [ i ] . resolve ( this . scope ) ; } } if ( this . fields != null ) { for ( int i = <NUM_LIT:0> , count = this . fields . length ; i < count ; i ++ ) { FieldDeclaration field = this . fields [ i ] ; switch ( field . getKind ( ) ) { case AbstractVariableDeclaration . ENUM_CONSTANT : hasEnumConstants = true ; if ( ! ( field . initialization instanceof QualifiedAllocationExpression ) ) { if ( enumConstantsWithoutBody == null ) enumConstantsWithoutBody = new FieldDeclaration [ count ] ; enumConstantsWithoutBody [ i ] = field ; } case AbstractVariableDeclaration . FIELD : FieldBinding fieldBinding = field . binding ; if ( fieldBinding == null ) { if ( field . initialization != null ) field . initialization . resolve ( field . isStatic ( ) ? this . staticInitializerScope : this . initializerScope ) ; this . ignoreFurtherInvestigation = true ; continue ; } if ( needSerialVersion && ( ( fieldBinding . modifiers & ( ClassFileConstants . AccStatic | ClassFileConstants . AccFinal ) ) == ( ClassFileConstants . AccStatic | ClassFileConstants . AccFinal ) ) && CharOperation . equals ( TypeConstants . SERIALVERSIONUID , fieldBinding . name ) && TypeBinding . LONG == fieldBinding . type ) { needSerialVersion = false ; } localMaxFieldCount ++ ; lastVisibleFieldID = field . binding . id ; break ; case AbstractVariableDeclaration . INITIALIZER : ( ( Initializer ) field ) . lastVisibleFieldID = lastVisibleFieldID + <NUM_LIT:1> ; break ; } field . resolve ( field . isStatic ( ) ? this . staticInitializerScope : this . initializerScope ) ; } } if ( this . maxFieldCount < localMaxFieldCount ) { this . maxFieldCount = localMaxFieldCount ; } if ( needSerialVersion ) { TypeBinding javaxRmiCorbaStub = this . scope . getType ( TypeConstants . JAVAX_RMI_CORBA_STUB , <NUM_LIT:4> ) ; if ( javaxRmiCorbaStub . isValidBinding ( ) ) { ReferenceBinding superclassBinding = this . binding . superclass ; loop : while ( superclassBinding != null ) { if ( superclassBinding == javaxRmiCorbaStub ) { needSerialVersion = false ; break loop ; } superclassBinding = superclassBinding . superclass ( ) ; } } if ( needSerialVersion ) { this . scope . problemReporter ( ) . missingSerialVersion ( this ) ; } } switch ( kind ( this . modifiers ) ) { case TypeDeclaration . ANNOTATION_TYPE_DECL : if ( this . superclass != null ) { this . scope . problemReporter ( ) . annotationTypeDeclarationCannotHaveSuperclass ( this ) ; } if ( this . superInterfaces != null ) { this . scope . problemReporter ( ) . annotationTypeDeclarationCannotHaveSuperinterfaces ( this ) ; } break ; case TypeDeclaration . ENUM_DECL : if ( this . binding . isAbstract ( ) ) { if ( ! hasEnumConstants ) { for ( int i = <NUM_LIT:0> , count = this . methods . length ; i < count ; i ++ ) { final AbstractMethodDeclaration methodDeclaration = this . methods [ i ] ; if ( methodDeclaration . isAbstract ( ) && methodDeclaration . binding != null ) this . scope . problemReporter ( ) . enumAbstractMethodMustBeImplemented ( methodDeclaration ) ; } } else if ( enumConstantsWithoutBody != null ) { for ( int i = <NUM_LIT:0> , count = this . methods . length ; i < count ; i ++ ) { final AbstractMethodDeclaration methodDeclaration = this . methods [ i ] ; if ( methodDeclaration . isAbstract ( ) && methodDeclaration . binding != null ) { for ( int f = <NUM_LIT:0> , l = enumConstantsWithoutBody . length ; f < l ; f ++ ) if ( enumConstantsWithoutBody [ f ] != null ) this . scope . problemReporter ( ) . enumConstantMustImplementAbstractMethod ( methodDeclaration , enumConstantsWithoutBody [ f ] ) ; } } } } break ; } int missingAbstractMethodslength = this . missingAbstractMethods == null ? <NUM_LIT:0> : this . missingAbstractMethods . length ; int methodsLength = this . methods == null ? <NUM_LIT:0> : this . methods . length ; if ( ( methodsLength + missingAbstractMethodslength ) > <NUM_LIT> ) { this . scope . problemReporter ( ) . tooManyMethods ( this ) ; } if ( this . methods != null ) { for ( int i = <NUM_LIT:0> , count = this . methods . length ; i < count ; i ++ ) { this . methods [ i ] . resolve ( this . scope ) ; } } if ( this . javadoc != null ) { if ( this . scope != null && ( this . name != TypeConstants . PACKAGE_INFO_NAME ) ) { this . javadoc . resolve ( this . scope ) ; } } else if ( ! sourceType . isLocalType ( ) ) { int visibility = sourceType . modifiers & ExtraCompilerModifiers . AccVisibilityMASK ; ProblemReporter reporter = this . scope . problemReporter ( ) ; int severity = reporter . computeSeverity ( IProblem . JavadocMissing ) ; if ( severity != ProblemSeverities . Ignore ) { if ( this . enclosingType != null ) { visibility = Util . computeOuterMostVisibility ( this . enclosingType , visibility ) ; } int javadocModifiers = ( this . binding . modifiers & ~ ExtraCompilerModifiers . AccVisibilityMASK ) | visibility ; reporter . javadocMissing ( this . sourceStart , this . sourceEnd , severity , javadocModifiers ) ; } } } catch ( AbortType e ) { this . ignoreFurtherInvestigation = true ; return ; } } public void resolve ( BlockScope blockScope ) { if ( ( this . bits & ASTNode . IsAnonymousType ) == <NUM_LIT:0> ) { Binding existing = blockScope . getType ( this . name ) ; if ( existing instanceof ReferenceBinding && existing != this . binding && existing . isValidBinding ( ) ) { ReferenceBinding existingType = ( ReferenceBinding ) existing ; if ( existingType instanceof TypeVariableBinding ) { blockScope . problemReporter ( ) . typeHiding ( this , ( TypeVariableBinding ) existingType ) ; Scope outerScope = blockScope . parent ; checkOuterScope : while ( outerScope != null ) { Binding existing2 = outerScope . getType ( this . name ) ; if ( existing2 instanceof TypeVariableBinding && existing2 . isValidBinding ( ) ) { TypeVariableBinding tvb = ( TypeVariableBinding ) existingType ; Binding declaringElement = tvb . declaringElement ; if ( declaringElement instanceof ReferenceBinding && CharOperation . equals ( ( ( ReferenceBinding ) declaringElement ) . sourceName ( ) , this . name ) ) { blockScope . problemReporter ( ) . typeCollidesWithEnclosingType ( this ) ; break checkOuterScope ; } } else if ( existing2 instanceof ReferenceBinding && existing2 . isValidBinding ( ) && outerScope . isDefinedInType ( ( ReferenceBinding ) existing2 ) ) { blockScope . problemReporter ( ) . typeCollidesWithEnclosingType ( this ) ; break checkOuterScope ; } else if ( existing2 == null ) { break checkOuterScope ; } outerScope = outerScope . parent ; } } else if ( existingType instanceof LocalTypeBinding && ( ( LocalTypeBinding ) existingType ) . scope . methodScope ( ) == blockScope . methodScope ( ) ) { blockScope . problemReporter ( ) . duplicateNestedType ( this ) ; } else if ( blockScope . isDefinedInType ( existingType ) ) { blockScope . problemReporter ( ) . typeCollidesWithEnclosingType ( this ) ; } else if ( blockScope . isDefinedInSameUnit ( existingType ) ) { blockScope . problemReporter ( ) . typeHiding ( this , existingType ) ; } } blockScope . addLocalType ( this ) ; } if ( this . binding != null ) { blockScope . referenceCompilationUnit ( ) . record ( ( LocalTypeBinding ) this . binding ) ; resolve ( ) ; updateMaxFieldCount ( ) ; } } public void resolve ( ClassScope upperScope ) { if ( this . binding != null && this . binding instanceof LocalTypeBinding ) { upperScope . referenceCompilationUnit ( ) . record ( ( LocalTypeBinding ) this . binding ) ; } resolve ( ) ; updateMaxFieldCount ( ) ; } public void resolve ( CompilationUnitScope upperScope ) { resolve ( ) ; updateMaxFieldCount ( ) ; } public void tagAsHavingErrors ( ) { this . ignoreFurtherInvestigation = true ; } public void traverse ( ASTVisitor visitor , CompilationUnitScope unitScope ) { try { if ( visitor . visit ( this , unitScope ) ) { if ( this . javadoc != null ) { this . javadoc . traverse ( visitor , this . scope ) ; } if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , this . staticInitializerScope ) ; } if ( this . superclass != null ) this . superclass . traverse ( visitor , this . scope ) ; if ( this . superInterfaces != null ) { int length = this . superInterfaces . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . superInterfaces [ i ] . traverse ( visitor , this . scope ) ; } if ( this . typeParameters != null ) { int length = this . typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . typeParameters [ i ] . traverse ( visitor , this . scope ) ; } } if ( this . memberTypes != null ) { int length = this . memberTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . memberTypes [ i ] . traverse ( visitor , this . scope ) ; } if ( this . fields != null ) { int length = this . fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FieldDeclaration field ; if ( ( field = this . fields [ i ] ) . isStatic ( ) ) { field . traverse ( visitor , this . staticInitializerScope ) ; } else { field . traverse ( visitor , this . initializerScope ) ; } } } if ( this . methods != null ) { int length = this . methods . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . methods [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , unitScope ) ; } catch ( AbortType e ) { } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { try { if ( visitor . visit ( this , blockScope ) ) { if ( this . javadoc != null ) { this . javadoc . traverse ( visitor , this . scope ) ; } if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , this . staticInitializerScope ) ; } if ( this . superclass != null ) this . superclass . traverse ( visitor , this . scope ) ; if ( this . superInterfaces != null ) { int length = this . superInterfaces . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . superInterfaces [ i ] . traverse ( visitor , this . scope ) ; } if ( this . typeParameters != null ) { int length = this . typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . typeParameters [ i ] . traverse ( visitor , this . scope ) ; } } if ( this . memberTypes != null ) { int length = this . memberTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . memberTypes [ i ] . traverse ( visitor , this . scope ) ; } if ( this . fields != null ) { int length = this . fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FieldDeclaration field = this . fields [ i ] ; if ( field . isStatic ( ) && ! field . isFinal ( ) ) { } else { field . traverse ( visitor , this . initializerScope ) ; } } } if ( this . methods != null ) { int length = this . methods . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . methods [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , blockScope ) ; } catch ( AbortType e ) { } } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { try { if ( visitor . visit ( this , classScope ) ) { if ( this . javadoc != null ) { this . javadoc . traverse ( visitor , this . scope ) ; } if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , this . staticInitializerScope ) ; } if ( this . superclass != null ) this . superclass . traverse ( visitor , this . scope ) ; if ( this . superInterfaces != null ) { int length = this . superInterfaces . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . superInterfaces [ i ] . traverse ( visitor , this . scope ) ; } if ( this . typeParameters != null ) { int length = this . typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . typeParameters [ i ] . traverse ( visitor , this . scope ) ; } } if ( this . memberTypes != null ) { int length = this . memberTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . memberTypes [ i ] . traverse ( visitor , this . scope ) ; } if ( this . fields != null ) { int length = this . fields . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FieldDeclaration field ; if ( ( field = this . fields [ i ] ) . isStatic ( ) ) { field . traverse ( visitor , this . staticInitializerScope ) ; } else { field . traverse ( visitor , this . initializerScope ) ; } } } if ( this . methods != null ) { int length = this . methods . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) this . methods [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , classScope ) ; } catch ( AbortType e ) { } } void updateMaxFieldCount ( ) { if ( this . binding == null ) return ; TypeDeclaration outerMostType = this . scope . outerMostClassScope ( ) . referenceType ( ) ; if ( this . maxFieldCount > outerMostType . maxFieldCount ) { outerMostType . maxFieldCount = this . maxFieldCount ; } else { this . maxFieldCount = outerMostType . maxFieldCount ; } } public boolean isSecondary ( ) { return ( this . bits & ASTNode . IsSecondaryType ) != <NUM_LIT:0> ; } public boolean isScannerUsableOnThisDeclaration ( ) { return true ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; 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 . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . MissingTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemFieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class FieldReference extends Reference implements InvocationSite { public static final int READ = <NUM_LIT:0> ; public static final int WRITE = <NUM_LIT:1> ; public Expression receiver ; public char [ ] token ; public FieldBinding binding ; public MethodBinding [ ] syntheticAccessors ; public long nameSourcePosition ; public TypeBinding actualReceiverType ; public TypeBinding genericCast ; public FieldReference ( char [ ] source , long pos ) { this . token = source ; this . nameSourcePosition = pos ; this . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; this . sourceEnd = ( int ) ( pos & <NUM_LIT> ) ; this . bits |= Binding . FIELD ; } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { if ( isCompound ) { if ( this . binding . isBlankFinal ( ) && this . receiver . isThis ( ) && currentScope . needBlankFinalFieldInitializationCheck ( this . binding ) ) { FlowInfo fieldInits = flowContext . getInitsForFinalBlankInitializationCheck ( this . binding . declaringClass . original ( ) , flowInfo ) ; if ( ! fieldInits . isDefinitelyAssigned ( this . binding ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( this . binding , this ) ; } } manageSyntheticAccessIfNecessary ( currentScope , flowInfo , true ) ; } flowInfo = this . receiver . analyseCode ( currentScope , flowContext , flowInfo , ! this . binding . isStatic ( ) ) . unconditionalInits ( ) ; if ( assignment . expression != null ) { flowInfo = assignment . expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } manageSyntheticAccessIfNecessary ( currentScope , flowInfo , false ) ; if ( this . binding . isFinal ( ) ) { if ( this . binding . isBlankFinal ( ) && ! isCompound && this . receiver . isThis ( ) && ! ( this . receiver instanceof QualifiedThisReference ) && ( ( this . receiver . bits & ASTNode . ParenthesizedMASK ) == <NUM_LIT:0> ) && currentScope . allowBlankFinalFieldAssignment ( this . binding ) ) { if ( flowInfo . isPotentiallyAssigned ( this . binding ) ) { currentScope . problemReporter ( ) . duplicateInitializationOfBlankFinalField ( this . binding , this ) ; } else { flowContext . recordSettingFinal ( this . binding , this , flowInfo ) ; } flowInfo . markAsDefinitelyAssigned ( this . binding ) ; } else { currentScope . problemReporter ( ) . cannotAssignToFinalField ( this . binding , this ) ; } } if ( ! this . binding . isStatic ( ) ) { if ( this . receiver . isThis ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( this . binding . declaringClass ) ; } } else if ( this . receiver . isThis ( ) ) { if ( ( this . receiver . bits & ASTNode . IsImplicitThis ) == <NUM_LIT:0> ) { currentScope . resetDeclaringClassMethodStaticFlag ( this . binding . declaringClass ) ; } } return flowInfo ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return analyseCode ( currentScope , flowContext , flowInfo , true ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { boolean nonStatic = ! this . binding . isStatic ( ) ; this . receiver . analyseCode ( currentScope , flowContext , flowInfo , nonStatic ) ; if ( nonStatic ) { this . receiver . checkNPE ( currentScope , flowContext , flowInfo ) ; if ( this . receiver . isThis ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( this . binding . declaringClass ) ; } } else if ( this . receiver . isThis ( ) ) { if ( ( this . receiver . bits & ASTNode . IsImplicitThis ) == <NUM_LIT:0> ) { currentScope . resetEnclosingMethodStaticFlag ( ) ; } } if ( valueRequired || currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo , true ) ; } return flowInfo ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { if ( runtimeTimeType == null || compileTimeType == null ) return ; if ( this . binding != null && this . binding . isValidBinding ( ) ) { FieldBinding originalBinding = this . binding . original ( ) ; TypeBinding originalType = originalBinding . type ; if ( originalType . leafComponentType ( ) . isTypeVariable ( ) ) { TypeBinding targetType = ( ! compileTimeType . isBaseType ( ) && runtimeTimeType . isBaseType ( ) ) ? compileTimeType : runtimeTimeType ; this . genericCast = originalBinding . type . genericCast ( targetType ) ; if ( this . genericCast instanceof ReferenceBinding ) { ReferenceBinding referenceCast = ( ReferenceBinding ) this . genericCast ; if ( ! referenceCast . canBeSeenBy ( scope ) ) { scope . problemReporter ( ) . invalidType ( this , new ProblemReferenceBinding ( CharOperation . splitOn ( '<CHAR_LIT:.>' , referenceCast . shortReadableName ( ) ) , referenceCast , ProblemReasons . NotVisible ) ) ; } } } } super . computeConversion ( scope , runtimeTimeType , compileTimeType ) ; } public FieldBinding fieldBinding ( ) { return this . binding ; } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { int pc = codeStream . position ; FieldBinding codegenBinding = this . binding . original ( ) ; this . receiver . generateCode ( currentScope , codeStream , ! codegenBinding . isStatic ( ) ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; assignment . expression . generateCode ( currentScope , codeStream , true ) ; fieldStore ( currentScope , codeStream , codegenBinding , this . syntheticAccessors == null ? null : this . syntheticAccessors [ FieldReference . WRITE ] , this . actualReceiverType , this . receiver . isImplicitThis ( ) , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } FieldBinding codegenBinding = this . binding . original ( ) ; boolean isStatic = codegenBinding . isStatic ( ) ; boolean isThisReceiver = this . receiver instanceof ThisReference ; Constant fieldConstant = codegenBinding . constant ( ) ; if ( fieldConstant != Constant . NotAConstant ) { if ( ! isThisReceiver ) { this . receiver . generateCode ( currentScope , codeStream , ! isStatic ) ; if ( ! isStatic ) { codeStream . invokeObjectGetClass ( ) ; codeStream . pop ( ) ; } } if ( valueRequired ) { codeStream . generateConstant ( fieldConstant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( valueRequired || ( ! isThisReceiver && currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) || ( ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) || ( this . genericCast != null ) ) { this . receiver . generateCode ( currentScope , codeStream , ! isStatic ) ; if ( ( this . bits & NeedReceiverGenericCast ) != <NUM_LIT:0> ) { codeStream . checkcast ( this . actualReceiverType ) ; } pc = codeStream . position ; if ( codegenBinding . declaringClass == null ) { codeStream . arraylength ( ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { codeStream . pop ( ) ; } } else { if ( this . syntheticAccessors == null || this . syntheticAccessors [ FieldReference . READ ] == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; if ( isStatic ) { codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . fieldAccess ( Opcodes . OPC_getfield , codegenBinding , constantPoolDeclaringClass ) ; } } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ FieldReference . READ ] , null ) ; } if ( this . genericCast != null ) codeStream . checkcast ( this . genericCast ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { boolean isUnboxing = ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ; if ( isUnboxing ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( isUnboxing ? postConversionType ( currentScope ) . id : codegenBinding . type . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; } } } } else { if ( isThisReceiver ) { if ( isStatic ) { if ( this . binding . original ( ) . declaringClass != this . actualReceiverType . erasure ( ) ) { MethodBinding accessor = this . syntheticAccessors == null ? null : this . syntheticAccessors [ FieldReference . READ ] ; if ( accessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } switch ( codegenBinding . type . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; } } } } else { this . receiver . generateCode ( currentScope , codeStream , ! isStatic ) ; if ( ! isStatic ) { codeStream . invokeObjectGetClass ( ) ; codeStream . pop ( ) ; } } } codeStream . recordPositionsFrom ( pc , this . sourceEnd ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { boolean isStatic ; reportOnlyUselesslyReadPrivateField ( currentScope , this . binding , valueRequired ) ; FieldBinding codegenBinding = this . binding . original ( ) ; this . receiver . generateCode ( currentScope , codeStream , ! ( isStatic = codegenBinding . isStatic ( ) ) ) ; if ( isStatic ) { if ( this . syntheticAccessors == null || this . syntheticAccessors [ FieldReference . READ ] == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ FieldReference . READ ] , null ) ; } } else { codeStream . dup ( ) ; if ( this . syntheticAccessors == null || this . syntheticAccessors [ FieldReference . READ ] == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; codeStream . fieldAccess ( Opcodes . OPC_getfield , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ FieldReference . READ ] , null ) ; } } int operationTypeID ; switch ( operationTypeID = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_JavaLangString : case T_JavaLangObject : case T_undefined : codeStream . generateStringConcatenationAppend ( currentScope , null , expression ) ; break ; default : if ( this . genericCast != null ) codeStream . checkcast ( this . genericCast ) ; codeStream . generateImplicitConversion ( this . implicitConversion ) ; if ( expression == IntLiteral . One ) { codeStream . generateConstant ( expression . constant , this . implicitConversion ) ; } else { expression . generateCode ( currentScope , codeStream , true ) ; } codeStream . sendOperator ( operator , operationTypeID ) ; codeStream . generateImplicitConversion ( assignmentImplicitConversion ) ; } fieldStore ( currentScope , codeStream , codegenBinding , this . syntheticAccessors == null ? null : this . syntheticAccessors [ FieldReference . WRITE ] , this . actualReceiverType , this . receiver . isImplicitThis ( ) , valueRequired ) ; } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { boolean isStatic ; reportOnlyUselesslyReadPrivateField ( currentScope , this . binding , valueRequired ) ; FieldBinding codegenBinding = this . binding . original ( ) ; this . receiver . generateCode ( currentScope , codeStream , ! ( isStatic = codegenBinding . isStatic ( ) ) ) ; if ( isStatic ) { if ( this . syntheticAccessors == null || this . syntheticAccessors [ FieldReference . READ ] == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ FieldReference . READ ] , null ) ; } } else { codeStream . dup ( ) ; if ( this . syntheticAccessors == null || this . syntheticAccessors [ FieldReference . READ ] == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; codeStream . fieldAccess ( Opcodes . OPC_getfield , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ FieldReference . READ ] , null ) ; } } TypeBinding operandType ; if ( this . genericCast != null ) { codeStream . checkcast ( this . genericCast ) ; operandType = this . genericCast ; } else { operandType = codegenBinding . type ; } if ( valueRequired ) { if ( isStatic ) { switch ( operandType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } } else { switch ( operandType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2_x1 ( ) ; break ; default : codeStream . dup_x1 ( ) ; break ; } } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateConstant ( postIncrement . expression . constant , this . implicitConversion ) ; codeStream . sendOperator ( postIncrement . operator , this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . generateImplicitConversion ( postIncrement . preAssignImplicitConversion ) ; fieldStore ( currentScope , codeStream , codegenBinding , this . syntheticAccessors == null ? null : this . syntheticAccessors [ FieldReference . WRITE ] , this . actualReceiverType , this . receiver . isImplicitThis ( ) , false ) ; } public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public boolean isSuperAccess ( ) { return this . receiver . isSuper ( ) ; } public boolean isTypeAccess ( ) { return this . receiver != null && this . receiver . isTypeReference ( ) ; } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo , boolean isReadAccess ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; FieldBinding codegenBinding = this . binding . original ( ) ; if ( this . binding . isPrivate ( ) ) { if ( ( currentScope . enclosingSourceType ( ) != codegenBinding . declaringClass ) && this . binding . constant ( ) == Constant . NotAConstant ) { if ( this . syntheticAccessors == null ) this . syntheticAccessors = new MethodBinding [ <NUM_LIT:2> ] ; this . syntheticAccessors [ isReadAccess ? FieldReference . READ : FieldReference . WRITE ] = ( ( SourceTypeBinding ) codegenBinding . declaringClass ) . addSyntheticMethod ( codegenBinding , isReadAccess , false ) ; currentScope . problemReporter ( ) . needToEmulateFieldAccess ( codegenBinding , this , isReadAccess ) ; return ; } } else if ( this . receiver instanceof QualifiedSuperReference ) { SourceTypeBinding destinationType = ( SourceTypeBinding ) ( ( ( QualifiedSuperReference ) this . receiver ) . currentCompatibleType ) ; if ( this . syntheticAccessors == null ) this . syntheticAccessors = new MethodBinding [ <NUM_LIT:2> ] ; this . syntheticAccessors [ isReadAccess ? FieldReference . READ : FieldReference . WRITE ] = destinationType . addSyntheticMethod ( codegenBinding , isReadAccess , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateFieldAccess ( codegenBinding , this , isReadAccess ) ; return ; } else if ( this . binding . isProtected ( ) ) { SourceTypeBinding enclosingSourceType ; if ( ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) && this . binding . declaringClass . getPackage ( ) != ( enclosingSourceType = currentScope . enclosingSourceType ( ) ) . getPackage ( ) ) { SourceTypeBinding currentCompatibleType = ( SourceTypeBinding ) enclosingSourceType . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; if ( this . syntheticAccessors == null ) this . syntheticAccessors = new MethodBinding [ <NUM_LIT:2> ] ; this . syntheticAccessors [ isReadAccess ? FieldReference . READ : FieldReference . WRITE ] = currentCompatibleType . addSyntheticMethod ( codegenBinding , isReadAccess , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateFieldAccess ( codegenBinding , this , isReadAccess ) ; return ; } } } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . UNKNOWN ; } public Constant optimizedBooleanConstant ( ) { switch ( this . resolvedType . id ) { case T_boolean : case T_JavaLangBoolean : return this . constant != Constant . NotAConstant ? this . constant : this . binding . constant ( ) ; default : return Constant . NotAConstant ; } } public TypeBinding postConversionType ( Scope scope ) { TypeBinding convertedType = this . resolvedType ; if ( this . genericCast != null ) convertedType = this . genericCast ; int runtimeType = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case T_boolean : convertedType = TypeBinding . BOOLEAN ; break ; case T_byte : convertedType = TypeBinding . BYTE ; break ; case T_short : convertedType = TypeBinding . SHORT ; break ; case T_char : convertedType = TypeBinding . CHAR ; break ; case T_int : convertedType = TypeBinding . INT ; break ; case T_float : convertedType = TypeBinding . FLOAT ; break ; case T_long : convertedType = TypeBinding . LONG ; break ; case T_double : convertedType = TypeBinding . DOUBLE ; break ; default : } if ( ( this . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { convertedType = scope . environment ( ) . computeBoxingType ( convertedType ) ; } return convertedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return this . receiver . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:.>' ) . append ( this . token ) ; } public TypeBinding resolveType ( BlockScope scope ) { boolean receiverCast = false ; if ( this . receiver instanceof CastExpression ) { this . receiver . bits |= ASTNode . DisableUnnecessaryCastCheck ; receiverCast = true ; } this . actualReceiverType = this . receiver . resolveType ( scope ) ; if ( this . actualReceiverType == null ) { this . constant = Constant . NotAConstant ; return null ; } if ( receiverCast ) { if ( ( ( CastExpression ) this . receiver ) . expression . resolvedType == this . actualReceiverType ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) this . receiver ) ; } } FieldBinding fieldBinding = this . binding = scope . getField ( this . actualReceiverType , this . token , this ) ; if ( ! fieldBinding . isValidBinding ( ) ) { this . constant = Constant . NotAConstant ; if ( this . receiver . resolvedType instanceof ProblemReferenceBinding ) { return null ; } ReferenceBinding declaringClass = fieldBinding . declaringClass ; boolean avoidSecondary = declaringClass != null && declaringClass . isAnonymousType ( ) && declaringClass . superclass ( ) instanceof MissingTypeBinding ; if ( ! avoidSecondary ) { scope . problemReporter ( ) . invalidField ( this , this . actualReceiverType ) ; } if ( fieldBinding instanceof ProblemFieldBinding ) { ProblemFieldBinding problemFieldBinding = ( ProblemFieldBinding ) fieldBinding ; FieldBinding closestMatch = problemFieldBinding . closestMatch ; switch ( problemFieldBinding . problemId ( ) ) { case ProblemReasons . InheritedNameHidesEnclosingName : case ProblemReasons . NotVisible : case ProblemReasons . NonStaticReferenceInConstructorInvocation : case ProblemReasons . NonStaticReferenceInStaticContext : if ( closestMatch != null ) { fieldBinding = closestMatch ; } } } if ( ! fieldBinding . isValidBinding ( ) ) { return null ; } } TypeBinding oldReceiverType = this . actualReceiverType ; this . actualReceiverType = this . actualReceiverType . getErasureCompatibleType ( fieldBinding . declaringClass ) ; this . receiver . computeConversion ( scope , this . actualReceiverType , this . actualReceiverType ) ; if ( this . actualReceiverType != oldReceiverType && this . receiver . postConversionType ( scope ) != this . actualReceiverType ) { this . bits |= NeedReceiverGenericCast ; } if ( isFieldUseDeprecated ( fieldBinding , scope , this . bits ) ) { scope . problemReporter ( ) . deprecatedField ( fieldBinding , this ) ; } boolean isImplicitThisRcv = this . receiver . isImplicitThis ( ) ; this . constant = isImplicitThisRcv ? fieldBinding . constant ( ) : Constant . NotAConstant ; if ( fieldBinding . isStatic ( ) ) { if ( ! ( isImplicitThisRcv || ( this . receiver instanceof NameReference && ( ( ( NameReference ) this . receiver ) . bits & Binding . TYPE ) != <NUM_LIT:0> ) ) ) { scope . problemReporter ( ) . nonStaticAccessToStaticField ( this , fieldBinding ) ; } ReferenceBinding declaringClass = this . binding . declaringClass ; if ( ! isImplicitThisRcv && declaringClass != this . actualReceiverType && declaringClass . canBeSeenBy ( scope ) ) { scope . problemReporter ( ) . indirectAccessToStaticField ( this , fieldBinding ) ; } if ( declaringClass . isEnum ( ) ) { MethodScope methodScope = scope . methodScope ( ) ; SourceTypeBinding sourceType = scope . enclosingSourceType ( ) ; if ( this . constant == Constant . NotAConstant && ! methodScope . isStatic && ( sourceType == declaringClass || sourceType . superclass == declaringClass ) && methodScope . isInsideInitializerOrConstructor ( ) ) { scope . problemReporter ( ) . enumStaticFieldUsedDuringInitialization ( this . binding , this ) ; } } } TypeBinding fieldType = fieldBinding . type ; if ( fieldType != null ) { if ( ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> ) { fieldType = fieldType . capture ( scope , this . sourceEnd ) ; } this . resolvedType = fieldType ; if ( ( fieldType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . invalidType ( this , fieldType ) ; return null ; } } return fieldType ; } public void setActualReceiverType ( ReferenceBinding receiverType ) { this . actualReceiverType = receiverType ; } public void setDepth ( int depth ) { this . bits &= ~ ASTNode . DepthMASK ; if ( depth > <NUM_LIT:0> ) { this . bits |= ( depth & <NUM_LIT> ) << ASTNode . DepthSHIFT ; } } public void setFieldIndex ( int index ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . receiver . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public abstract class Reference extends Expression { public Reference ( ) { super ( ) ; } public abstract FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return flowInfo ; } public FieldBinding fieldBinding ( ) { return null ; } public void fieldStore ( Scope currentScope , CodeStream codeStream , FieldBinding fieldBinding , MethodBinding syntheticWriteAccessor , TypeBinding receiverType , boolean isImplicitThisReceiver , boolean valueRequired ) { int pc = codeStream . position ; if ( fieldBinding . isStatic ( ) ) { if ( valueRequired ) { switch ( fieldBinding . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } } if ( syntheticWriteAccessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , fieldBinding , receiverType , isImplicitThisReceiver ) ; codeStream . fieldAccess ( Opcodes . OPC_putstatic , fieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , syntheticWriteAccessor , null ) ; } } else { if ( valueRequired ) { switch ( fieldBinding . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2_x1 ( ) ; break ; default : codeStream . dup_x1 ( ) ; break ; } } if ( syntheticWriteAccessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , fieldBinding , receiverType , isImplicitThisReceiver ) ; codeStream . fieldAccess ( Opcodes . OPC_putfield , fieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , syntheticWriteAccessor , null ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public abstract void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) ; public abstract void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) ; public abstract void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) ; void reportOnlyUselesslyReadPrivateField ( BlockScope currentScope , FieldBinding fieldBinding , boolean valueRequired ) { if ( valueRequired ) { fieldBinding . compoundUseFlag = <NUM_LIT:0> ; fieldBinding . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } else { if ( fieldBinding . isUsedOnlyInCompound ( ) ) { fieldBinding . compoundUseFlag -- ; if ( fieldBinding . compoundUseFlag == <NUM_LIT:0> && fieldBinding . isOrEnclosedByPrivateType ( ) && ( this . implicitConversion & TypeIds . UNBOXING ) == <NUM_LIT:0> ) { currentScope . problemReporter ( ) . unusedPrivateField ( fieldBinding . sourceField ( ) ) ; fieldBinding . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } } } static void reportOnlyUselesslyReadLocal ( BlockScope currentScope , LocalVariableBinding localBinding , boolean valueRequired ) { if ( localBinding . declaration == null ) return ; if ( ( localBinding . declaration . bits & ASTNode . IsLocalDeclarationReachable ) == <NUM_LIT:0> ) return ; if ( localBinding . useFlag >= LocalVariableBinding . USED ) return ; if ( valueRequired ) { localBinding . useFlag = LocalVariableBinding . USED ; return ; } else { localBinding . useFlag ++ ; if ( localBinding . useFlag != LocalVariableBinding . UNUSED ) return ; } if ( localBinding . declaration instanceof Argument ) { MethodScope methodScope = currentScope . methodScope ( ) ; if ( methodScope != null ) { MethodBinding method = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ( ) ) . binding ; boolean shouldReport = ! method . isMain ( ) ; if ( method . isImplementing ( ) ) { shouldReport &= currentScope . compilerOptions ( ) . reportUnusedParameterWhenImplementingAbstract ; } else if ( method . isOverriding ( ) ) { shouldReport &= currentScope . compilerOptions ( ) . reportUnusedParameterWhenOverridingConcrete ; } if ( shouldReport ) { currentScope . problemReporter ( ) . unusedArgument ( localBinding . declaration ) ; } } } else { currentScope . problemReporter ( ) . unusedLocalVariable ( localBinding . declaration ) ; } localBinding . useFlag = LocalVariableBinding . USED ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class NullLiteral extends MagicLiteral { static final char [ ] source = { '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; public NullLiteral ( int s , int e ) { super ( s , e ) ; } public void computeConstant ( ) { this . constant = Constant . NotAConstant ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . aconst_null ( ) ; codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . NULL ; } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . NULL ; } public Object reusableJSRTarget ( ) { return TypeBinding . NULL ; } public char [ ] source ( ) { return source ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class MarkerAnnotation extends Annotation { public MarkerAnnotation ( TypeReference type , int sourceStart ) { this . type = type ; this . sourceStart = sourceStart ; this . sourceEnd = type . sourceEnd ; } public MemberValuePair [ ] memberValuePairs ( ) { return NoValuePairs ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocImplicitTypeReference extends TypeReference { public char [ ] token ; public JavadocImplicitTypeReference ( char [ ] name , int pos ) { super ( ) ; this . token = name ; this . sourceStart = pos ; this . sourceEnd = pos ; } public TypeReference copyDims ( int dim ) { return null ; } protected TypeBinding getTypeBinding ( Scope scope ) { this . constant = Constant . NotAConstant ; return this . resolvedType = scope . enclosingReceiverType ( ) ; } public char [ ] getLastToken ( ) { return this . token ; } public char [ ] [ ] getTypeName ( ) { if ( this . token != null ) { char [ ] [ ] tokens = { this . token } ; return tokens ; } return null ; } public boolean isThis ( ) { return true ; } protected TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( this . resolvedType != null ) { if ( this . resolvedType . isValidBinding ( ) ) { return this . resolvedType ; } else { switch ( this . resolvedType . problemId ( ) ) { case ProblemReasons . NotFound : case ProblemReasons . NotVisible : TypeBinding type = this . resolvedType . closestMatch ( ) ; return type ; default : return null ; } } } boolean hasError ; TypeBinding type = this . resolvedType = getTypeBinding ( scope ) ; if ( type == null ) { return null ; } else if ( ( hasError = ! type . isValidBinding ( ) ) == true ) { reportInvalidType ( scope ) ; switch ( type . problemId ( ) ) { case ProblemReasons . NotFound : case ProblemReasons . NotVisible : type = type . closestMatch ( ) ; if ( type == null ) return null ; break ; default : return null ; } } if ( type . isArrayType ( ) && ( ( ArrayBinding ) type ) . leafComponentType == TypeBinding . VOID ) { scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; return null ; } if ( isTypeUseDeprecated ( type , scope ) ) { reportDeprecatedType ( type , scope ) ; } if ( type . isGenericType ( ) || type . isParameterizedType ( ) ) { type = scope . environment ( ) . convertToRawType ( type , true ) ; } if ( hasError ) { return type ; } return this . resolvedType = type ; } protected void reportInvalidType ( Scope scope ) { scope . problemReporter ( ) . javadocInvalidType ( this , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { scope . problemReporter ( ) . javadocDeprecatedType ( type , this , scope . getDeclarationModifiers ( ) ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return new StringBuffer ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; 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 . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class ThrowStatement extends Statement { public Expression exception ; public TypeBinding exceptionType ; public ThrowStatement ( Expression exception , int sourceStart , int sourceEnd ) { this . exception = exception ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . exception . analyseCode ( currentScope , flowContext , flowInfo ) ; this . exception . checkNPE ( currentScope , flowContext , flowInfo ) ; flowContext . checkExceptionHandlers ( this . exceptionType , this , flowInfo , currentScope ) ; currentScope . checkUnclosedCloseables ( flowInfo , flowContext , this , currentScope ) ; return FlowInfo . DEAD_END ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) return ; int pc = codeStream . position ; this . exception . generateCode ( currentScope , codeStream , true ) ; codeStream . athrow ( ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . exception . printExpression ( <NUM_LIT:0> , output ) ; return output . append ( '<CHAR_LIT:;>' ) ; } public void resolve ( BlockScope scope ) { this . exceptionType = this . exception . resolveType ( scope ) ; if ( this . exceptionType != null && this . exceptionType . isValidBinding ( ) ) { if ( this . exceptionType == TypeBinding . NULL ) { if ( scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_3 ) { scope . problemReporter ( ) . cannotThrowNull ( this . exception ) ; } } else if ( this . exceptionType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) == null ) { scope . problemReporter ( ) . cannotThrowType ( this . exception , this . exceptionType ) ; } this . exception . computeConversion ( scope , this . exceptionType , this . exceptionType ) ; } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) this . exception . traverse ( visitor , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . impl . BooleanConstant ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class FalseLiteral extends MagicLiteral { static final char [ ] source = { '<CHAR_LIT>' , '<CHAR_LIT:a>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:e>' } ; public FalseLiteral ( int s , int e ) { super ( s , e ) ; } public void computeConstant ( ) { this . constant = BooleanConstant . fromValue ( false ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { if ( falseLabel != null ) { if ( trueLabel == null ) { codeStream . goto_ ( falseLabel ) ; } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . BOOLEAN ; } public char [ ] source ( ) { return source ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class LabeledStatement extends Statement { public Statement statement ; public char [ ] label ; public BranchLabel targetLabel ; public int labelEnd ; int mergedInitStateIndex = - <NUM_LIT:1> ; public LabeledStatement ( char [ ] label , Statement statement , long labelPosition , int sourceEnd ) { this . statement = statement ; if ( statement instanceof EmptyStatement ) statement . bits |= IsUsefulEmptyStatement ; this . label = label ; this . sourceStart = ( int ) ( labelPosition > > > <NUM_LIT:32> ) ; this . labelEnd = ( int ) labelPosition ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . statement == null ) { return flowInfo ; } else { LabelFlowContext labelContext ; FlowInfo statementInfo , mergedInfo ; statementInfo = this . statement . analyseCode ( currentScope , ( labelContext = new LabelFlowContext ( flowContext , this , this . label , ( this . targetLabel = new BranchLabel ( ) ) , currentScope ) ) , flowInfo ) ; boolean reinjectNullInfo = ( statementInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> && ( labelContext . initsOnBreak . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ; mergedInfo = statementInfo . mergedWith ( labelContext . initsOnBreak ) ; if ( reinjectNullInfo ) { ( ( UnconditionalFlowInfo ) mergedInfo ) . addInitializationsFrom ( flowInfo . unconditionalFieldLessCopy ( ) ) . addInitializationsFrom ( labelContext . initsOnBreak . unconditionalFieldLessCopy ( ) ) ; } this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; if ( ( this . bits & ASTNode . LabelUsed ) == <NUM_LIT:0> ) { currentScope . problemReporter ( ) . unusedLabel ( this ) ; } return mergedInfo ; } } public ASTNode concreteStatement ( ) { return this . statement ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; if ( this . targetLabel != null ) { this . targetLabel . initialize ( codeStream ) ; if ( this . statement != null ) { this . statement . generateCode ( currentScope , codeStream ) ; } this . targetLabel . place ( ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( this . label ) . append ( "<STR_LIT::U+0020>" ) ; if ( this . statement == null ) output . append ( '<CHAR_LIT:;>' ) ; else this . statement . printStatement ( <NUM_LIT:0> , output ) ; return output ; } public void resolve ( BlockScope scope ) { if ( this . statement != null ) { this . statement . resolve ( scope ) ; } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . statement != null ) this . statement . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import java . util . Map . Entry ; import java . util . Set ; 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 . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; 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 . problem . ProblemReporter ; public class FakedTrackingVariable extends LocalDeclaration { private static final int CLOSE_SEEN = <NUM_LIT:1> ; private static final int SHARED_WITH_OUTSIDE = <NUM_LIT:2> ; private static final int OWNED_BY_OUTSIDE = <NUM_LIT:4> ; private static final int CLOSED_IN_NESTED_METHOD = <NUM_LIT:8> ; private static final int REPORTED_EXPLICIT_CLOSE = <NUM_LIT:16> ; private static final int REPORTED_POTENTIAL_LEAK = <NUM_LIT:32> ; private static final int REPORTED_DEFINITIVE_LEAK = <NUM_LIT> ; public static boolean TEST_372319 = false ; private int globalClosingState = <NUM_LIT:0> ; public LocalVariableBinding originalBinding ; public FakedTrackingVariable innerTracker ; public FakedTrackingVariable outerTracker ; MethodScope methodScope ; private HashMap recordedLocations ; private ASTNode currentAssignment ; public FakedTrackingVariable ( LocalVariableBinding original , ASTNode location ) { super ( original . name , location . sourceStart , location . sourceEnd ) ; this . type = new SingleTypeReference ( TypeConstants . OBJECT , ( ( long ) this . sourceStart << <NUM_LIT:32> ) + this . sourceEnd ) ; this . methodScope = original . declaringScope . methodScope ( ) ; this . originalBinding = original ; resolve ( original . declaringScope ) ; } private FakedTrackingVariable ( BlockScope scope , ASTNode location ) { super ( "<STR_LIT>" . toCharArray ( ) , location . sourceStart , location . sourceEnd ) ; this . type = new SingleTypeReference ( TypeConstants . OBJECT , ( ( long ) this . sourceStart << <NUM_LIT:32> ) + this . sourceEnd ) ; this . methodScope = scope . methodScope ( ) ; this . originalBinding = null ; resolve ( scope ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { this . binding = new LocalVariableBinding ( this . name , scope . getJavaLangObject ( ) , <NUM_LIT:0> , false ) ; this . binding . closeTracker = this ; this . binding . declaringScope = scope ; this . binding . setConstant ( Constant . NotAConstant ) ; this . binding . useFlag = LocalVariableBinding . USED ; this . binding . id = scope . registerTrackingVariable ( this ) ; } public static FakedTrackingVariable getCloseTrackingVariable ( Expression expression ) { while ( true ) { if ( expression instanceof CastExpression ) expression = ( ( CastExpression ) expression ) . expression ; else if ( expression instanceof Assignment ) expression = ( ( Assignment ) expression ) . expression ; else break ; } if ( expression instanceof SingleNameReference ) { SingleNameReference name = ( SingleNameReference ) expression ; if ( name . binding instanceof LocalVariableBinding ) { LocalVariableBinding local = ( LocalVariableBinding ) name . binding ; if ( local . closeTracker != null ) return local . closeTracker ; if ( ! isAnyCloseable ( expression . resolvedType ) ) return null ; Statement location = local . declaration ; local . closeTracker = new FakedTrackingVariable ( local , location ) ; if ( local . isParameter ( ) ) { local . closeTracker . globalClosingState |= OWNED_BY_OUTSIDE ; } return local . closeTracker ; } } else if ( expression instanceof AllocationExpression ) { return ( ( AllocationExpression ) expression ) . closeTracker ; } return null ; } public static void preConnectTrackerAcrossAssignment ( ASTNode location , LocalVariableBinding local , Expression rhs ) { FakedTrackingVariable closeTracker = null ; if ( rhs instanceof AllocationExpression ) { closeTracker = local . closeTracker ; if ( closeTracker == null ) { if ( rhs . resolvedType != TypeBinding . NULL ) { closeTracker = new FakedTrackingVariable ( local , location ) ; if ( local . isParameter ( ) ) { closeTracker . globalClosingState |= OWNED_BY_OUTSIDE ; } } } if ( closeTracker != null ) { closeTracker . currentAssignment = location ; AllocationExpression allocation = ( AllocationExpression ) rhs ; allocation . closeTracker = closeTracker ; if ( allocation . arguments != null && allocation . arguments . length > <NUM_LIT:0> ) { preConnectTrackerAcrossAssignment ( location , local , allocation . arguments [ <NUM_LIT:0> ] ) ; } } } } public static void analyseCloseableAllocation ( BlockScope scope , FlowInfo flowInfo , AllocationExpression allocation ) { if ( ( ( ReferenceBinding ) allocation . resolvedType ) . hasTypeBit ( TypeIds . BitResourceFreeCloseable ) ) { if ( allocation . closeTracker != null ) { scope . removeTrackingVar ( allocation . closeTracker ) ; allocation . closeTracker = null ; } } else if ( ( ( ReferenceBinding ) allocation . resolvedType ) . hasTypeBit ( TypeIds . BitWrapperCloseable ) ) { boolean isWrapper = true ; if ( allocation . arguments != null && allocation . arguments . length > <NUM_LIT:0> ) { FakedTrackingVariable innerTracker = findCloseTracker ( scope , flowInfo , allocation . arguments [ <NUM_LIT:0> ] ) ; if ( innerTracker != null ) { FakedTrackingVariable currentInner = innerTracker ; do { if ( currentInner == allocation . closeTracker ) return ; currentInner = currentInner . innerTracker ; } while ( currentInner != null ) ; int newStatus = FlowInfo . NULL ; if ( allocation . closeTracker == null ) { allocation . closeTracker = new FakedTrackingVariable ( scope , allocation ) ; } else { if ( scope . finallyInfo != null ) { int finallyStatus = scope . finallyInfo . nullStatus ( allocation . closeTracker . binding ) ; if ( finallyStatus != FlowInfo . UNKNOWN ) newStatus = finallyStatus ; } } allocation . closeTracker . innerTracker = innerTracker ; innerTracker . outerTracker = allocation . closeTracker ; flowInfo . markNullStatus ( allocation . closeTracker . binding , newStatus ) ; if ( newStatus != FlowInfo . NULL ) { FakedTrackingVariable currentTracker = innerTracker ; while ( currentTracker != null ) { flowInfo . markNullStatus ( currentTracker . binding , newStatus ) ; currentTracker . globalClosingState |= allocation . closeTracker . globalClosingState ; currentTracker = currentTracker . innerTracker ; } } return ; } else { if ( ! isAnyCloseable ( allocation . arguments [ <NUM_LIT:0> ] . resolvedType ) ) { isWrapper = false ; } } } else { isWrapper = false ; } if ( isWrapper ) { if ( allocation . closeTracker != null ) { scope . removeTrackingVar ( allocation . closeTracker ) ; allocation . closeTracker = null ; } } else { handleRegularResource ( scope , flowInfo , allocation ) ; } } else { handleRegularResource ( scope , flowInfo , allocation ) ; } } private static void handleRegularResource ( BlockScope scope , FlowInfo flowInfo , AllocationExpression allocation ) { FakedTrackingVariable presetTracker = allocation . closeTracker ; if ( presetTracker != null && presetTracker . originalBinding != null ) { int closeStatus = flowInfo . nullStatus ( presetTracker . binding ) ; if ( closeStatus != FlowInfo . NON_NULL && closeStatus != FlowInfo . UNKNOWN && ! flowInfo . isDefinitelyNull ( presetTracker . originalBinding ) && ! ( presetTracker . currentAssignment instanceof LocalDeclaration ) ) allocation . closeTracker . recordErrorLocation ( presetTracker . currentAssignment , closeStatus ) ; } else { allocation . closeTracker = new FakedTrackingVariable ( scope , allocation ) ; } flowInfo . markAsDefinitelyNull ( allocation . closeTracker . binding ) ; } private static FakedTrackingVariable findCloseTracker ( BlockScope scope , FlowInfo flowInfo , Expression arg ) { while ( arg instanceof Assignment ) { Assignment assign = ( Assignment ) arg ; LocalVariableBinding innerLocal = assign . localVariableBinding ( ) ; if ( innerLocal != null ) { return innerLocal . closeTracker ; } else { arg = assign . expression ; } } if ( arg instanceof SingleNameReference ) { LocalVariableBinding local = arg . localVariableBinding ( ) ; if ( local != null ) { return local . closeTracker ; } } else if ( arg instanceof AllocationExpression ) { return ( ( AllocationExpression ) arg ) . closeTracker ; } return null ; } public static void handleResourceAssignment ( BlockScope scope , FlowInfo upstreamInfo , FlowInfo flowInfo , ASTNode location , Expression rhs , LocalVariableBinding local ) { FakedTrackingVariable previousTracker = null ; FakedTrackingVariable disconnectedTracker = null ; if ( local . closeTracker != null ) { previousTracker = local . closeTracker ; int nullStatus = upstreamInfo . nullStatus ( local ) ; if ( nullStatus != FlowInfo . NULL && nullStatus != FlowInfo . UNKNOWN ) disconnectedTracker = previousTracker ; } rhsAnalyis : if ( rhs . resolvedType != TypeBinding . NULL ) { FakedTrackingVariable rhsTrackVar = getCloseTrackingVariable ( rhs ) ; if ( rhsTrackVar != null ) { if ( local . closeTracker == null ) { if ( rhsTrackVar . originalBinding != null ) local . closeTracker = rhsTrackVar ; if ( rhsTrackVar . currentAssignment == location ) { rhsTrackVar . globalClosingState &= ~ ( SHARED_WITH_OUTSIDE | OWNED_BY_OUTSIDE ) ; } } else { if ( rhs instanceof AllocationExpression ) { if ( rhsTrackVar == disconnectedTracker ) return ; if ( local . closeTracker == rhsTrackVar && ( ( rhsTrackVar . globalClosingState & OWNED_BY_OUTSIDE ) != <NUM_LIT:0> ) ) { local . closeTracker = new FakedTrackingVariable ( local , location ) ; flowInfo . markAsDefinitelyNull ( local . closeTracker . binding ) ; break rhsAnalyis ; } } local . closeTracker = rhsTrackVar ; } } else if ( previousTracker != null ) { if ( ( previousTracker . globalClosingState & ( SHARED_WITH_OUTSIDE | OWNED_BY_OUTSIDE ) ) == <NUM_LIT:0> ) flowInfo . markAsDefinitelyNull ( previousTracker . binding ) ; local . closeTracker = analyseCloseableExpression ( flowInfo , local , location , rhs , previousTracker ) ; } else { rhsTrackVar = analyseCloseableExpression ( flowInfo , local , location , rhs , null ) ; if ( rhsTrackVar != null ) { local . closeTracker = rhsTrackVar ; if ( ( rhsTrackVar . globalClosingState & ( SHARED_WITH_OUTSIDE | OWNED_BY_OUTSIDE ) ) == <NUM_LIT:0> ) flowInfo . markAsDefinitelyNull ( rhsTrackVar . binding ) ; } } } if ( disconnectedTracker != null ) { if ( disconnectedTracker . innerTracker != null && disconnectedTracker . innerTracker . binding . declaringScope == scope ) { disconnectedTracker . innerTracker . outerTracker = null ; scope . pruneWrapperTrackingVar ( disconnectedTracker ) ; } else { int upstreamStatus = upstreamInfo . nullStatus ( disconnectedTracker . binding ) ; if ( upstreamStatus != FlowInfo . NON_NULL ) disconnectedTracker . recordErrorLocation ( location , upstreamStatus ) ; } } } private static FakedTrackingVariable analyseCloseableExpression ( FlowInfo flowInfo , LocalVariableBinding local , ASTNode location , Expression expression , FakedTrackingVariable previousTracker ) { while ( true ) { if ( expression instanceof Assignment ) expression = ( ( Assignment ) expression ) . expression ; else if ( expression instanceof CastExpression ) expression = ( ( CastExpression ) expression ) . expression ; else break ; } if ( expression instanceof AllocationExpression ) { FakedTrackingVariable tracker = ( ( AllocationExpression ) expression ) . closeTracker ; if ( tracker != null && tracker . originalBinding == null ) { return null ; } return tracker ; } else if ( expression instanceof MessageSend || expression instanceof ArrayReference ) { FakedTrackingVariable tracker = new FakedTrackingVariable ( local , location ) ; tracker . globalClosingState |= SHARED_WITH_OUTSIDE ; flowInfo . markPotentiallyNullBit ( tracker . binding ) ; return tracker ; } else if ( ( expression . bits & RestrictiveFlagMASK ) == Binding . FIELD || ( ( expression instanceof QualifiedNameReference ) && ( ( QualifiedNameReference ) expression ) . isFieldAccess ( ) ) ) { FakedTrackingVariable tracker = new FakedTrackingVariable ( local , location ) ; tracker . globalClosingState |= OWNED_BY_OUTSIDE ; return tracker ; } if ( expression . resolvedType instanceof ReferenceBinding ) { ReferenceBinding resourceType = ( ReferenceBinding ) expression . resolvedType ; if ( resourceType . hasTypeBit ( TypeIds . BitResourceFreeCloseable ) ) { return null ; } } if ( local . closeTracker != null ) return local . closeTracker ; FakedTrackingVariable newTracker = new FakedTrackingVariable ( local , location ) ; LocalVariableBinding rhsLocal = expression . localVariableBinding ( ) ; if ( rhsLocal != null && rhsLocal . isParameter ( ) ) { newTracker . globalClosingState |= OWNED_BY_OUTSIDE ; } return newTracker ; } public static void cleanUpAfterAssignment ( BlockScope currentScope , int lhsBits , Expression expression ) { while ( true ) { if ( expression instanceof Assignment ) expression = ( ( Assignment ) expression ) . expression ; else if ( expression instanceof CastExpression ) expression = ( ( CastExpression ) expression ) . expression ; else break ; } if ( expression instanceof AllocationExpression ) { FakedTrackingVariable tracker = ( ( AllocationExpression ) expression ) . closeTracker ; if ( tracker != null && tracker . originalBinding == null ) { currentScope . removeTrackingVar ( tracker ) ; ( ( AllocationExpression ) expression ) . closeTracker = null ; } } else { LocalVariableBinding local = expression . localVariableBinding ( ) ; if ( local != null && local . closeTracker != null && ( ( lhsBits & Binding . FIELD ) != <NUM_LIT:0> ) ) currentScope . removeTrackingVar ( local . closeTracker ) ; } } public static boolean isAnyCloseable ( TypeBinding typeBinding ) { return typeBinding instanceof ReferenceBinding && ( ( ReferenceBinding ) typeBinding ) . hasTypeBit ( TypeIds . BitAutoCloseable | TypeIds . BitCloseable ) ; } public int findMostSpecificStatus ( FlowInfo flowInfo , BlockScope currentScope , BlockScope locationScope ) { int status = FlowInfo . UNKNOWN ; FakedTrackingVariable currentTracker = this ; while ( currentTracker != null ) { LocalVariableBinding currentVar = currentTracker . binding ; int currentStatus = getNullStatusAggressively ( currentVar , flowInfo ) ; if ( locationScope != null ) currentStatus = mergeCloseStatus ( locationScope , currentStatus , currentVar , currentScope ) ; if ( currentStatus == FlowInfo . NON_NULL ) { status = currentStatus ; break ; } else if ( status == FlowInfo . NULL || status == FlowInfo . UNKNOWN ) { status = currentStatus ; } currentTracker = currentTracker . innerTracker ; } return status ; } private int getNullStatusAggressively ( LocalVariableBinding local , FlowInfo flowInfo ) { if ( flowInfo == FlowInfo . DEAD_END ) { return FlowInfo . UNKNOWN ; } int reachMode = flowInfo . reachMode ( ) ; int status = <NUM_LIT:0> ; try { if ( reachMode != FlowInfo . REACHABLE ) flowInfo . tagBits &= ~ FlowInfo . UNREACHABLE ; status = flowInfo . nullStatus ( local ) ; if ( TEST_372319 ) { try { Thread . sleep ( <NUM_LIT:5> ) ; } catch ( InterruptedException e ) { } } } finally { flowInfo . tagBits |= reachMode ; } if ( ( status & FlowInfo . NULL ) != <NUM_LIT:0> ) { if ( ( status & ( FlowInfo . NON_NULL | FlowInfo . POTENTIALLY_NON_NULL ) ) != <NUM_LIT:0> ) return FlowInfo . POTENTIALLY_NULL ; return FlowInfo . NULL ; } else if ( ( status & FlowInfo . NON_NULL ) != <NUM_LIT:0> ) { if ( ( status & FlowInfo . POTENTIALLY_NULL ) != <NUM_LIT:0> ) return FlowInfo . POTENTIALLY_NULL ; return FlowInfo . NON_NULL ; } else if ( ( status & FlowInfo . POTENTIALLY_NULL ) != <NUM_LIT:0> ) return FlowInfo . POTENTIALLY_NULL ; return status ; } public int mergeCloseStatus ( BlockScope currentScope , int status , LocalVariableBinding local , BlockScope outerScope ) { if ( status != FlowInfo . NON_NULL ) { if ( currentScope . finallyInfo != null ) { int finallyStatus = currentScope . finallyInfo . nullStatus ( local ) ; if ( finallyStatus == FlowInfo . NON_NULL ) return finallyStatus ; if ( finallyStatus != FlowInfo . NULL ) status = FlowInfo . POTENTIALLY_NULL ; } if ( currentScope != outerScope && currentScope . parent instanceof BlockScope ) return mergeCloseStatus ( ( ( BlockScope ) currentScope . parent ) , status , local , outerScope ) ; } return status ; } public void markClose ( FlowInfo flowInfo , FlowContext flowContext ) { FakedTrackingVariable current = this ; do { flowInfo . markAsDefinitelyNonNull ( current . binding ) ; current . globalClosingState |= CLOSE_SEEN ; if ( flowContext . initsOnFinally != null ) flowContext . initsOnFinally . markAsDefinitelyNonNull ( this . binding ) ; current = current . innerTracker ; } while ( current != null ) ; } public void markClosedInNestedMethod ( ) { this . globalClosingState |= CLOSED_IN_NESTED_METHOD ; } public static FlowInfo markPassedToOutside ( BlockScope scope , Expression expression , FlowInfo flowInfo , boolean owned ) { FakedTrackingVariable trackVar = getCloseTrackingVariable ( expression ) ; if ( trackVar != null ) { FlowInfo infoResourceIsClosed = owned ? flowInfo : flowInfo . copy ( ) ; int flag = owned ? OWNED_BY_OUTSIDE : SHARED_WITH_OUTSIDE ; do { trackVar . globalClosingState |= flag ; if ( scope . methodScope ( ) != trackVar . methodScope ) trackVar . globalClosingState |= CLOSED_IN_NESTED_METHOD ; infoResourceIsClosed . markAsDefinitelyNonNull ( trackVar . binding ) ; } while ( ( trackVar = trackVar . innerTracker ) != null ) ; if ( owned ) { return infoResourceIsClosed ; } else { return FlowInfo . conditional ( flowInfo , infoResourceIsClosed ) ; } } return flowInfo ; } public static FakedTrackingVariable pickVarForReporting ( Set varsOfScope , BlockScope scope , boolean atExit ) { if ( varsOfScope . isEmpty ( ) ) return null ; FakedTrackingVariable trackingVar = ( FakedTrackingVariable ) varsOfScope . iterator ( ) . next ( ) ; while ( trackingVar . outerTracker != null ) { if ( varsOfScope . contains ( trackingVar . outerTracker ) ) { trackingVar = trackingVar . outerTracker ; } else if ( atExit ) { break ; } else { BlockScope outerTrackerScope = trackingVar . outerTracker . binding . declaringScope ; if ( outerTrackerScope == scope ) { break ; } else { Scope currentScope = scope ; while ( ( currentScope = currentScope . parent ) instanceof BlockScope ) { if ( outerTrackerScope == currentScope ) { varsOfScope . remove ( trackingVar ) ; return pickVarForReporting ( varsOfScope , scope , atExit ) ; } } break ; } } } varsOfScope . remove ( trackingVar ) ; return trackingVar ; } public boolean hasDefinitelyNoResource ( FlowInfo flowInfo ) { if ( this . originalBinding == null ) return false ; if ( flowInfo . isDefinitelyNull ( this . originalBinding ) ) { return true ; } if ( ! ( flowInfo . isDefinitelyAssigned ( this . originalBinding ) || flowInfo . isPotentiallyAssigned ( this . originalBinding ) ) ) { return true ; } return false ; } public boolean isClosedInFinallyOfEnclosing ( BlockScope scope ) { BlockScope currentScope = scope ; while ( true ) { if ( currentScope . finallyInfo != null && currentScope . finallyInfo . isDefinitelyNonNull ( this . binding ) ) { return true ; } if ( ! ( currentScope . parent instanceof BlockScope ) ) { return false ; } currentScope = ( BlockScope ) currentScope . parent ; } } public boolean isResourceBeingReturned ( FakedTrackingVariable returnedResource ) { FakedTrackingVariable current = this ; do { if ( current == returnedResource ) { this . globalClosingState |= REPORTED_DEFINITIVE_LEAK ; return true ; } current = current . innerTracker ; } while ( current != null ) ; return false ; } public void recordErrorLocation ( ASTNode location , int nullStatus ) { if ( ( this . globalClosingState & OWNED_BY_OUTSIDE ) != <NUM_LIT:0> ) { return ; } if ( this . recordedLocations == null ) this . recordedLocations = new HashMap ( ) ; this . recordedLocations . put ( location , new Integer ( nullStatus ) ) ; } public boolean reportRecordedErrors ( Scope scope , int mergedStatus ) { FakedTrackingVariable current = this ; while ( current . globalClosingState == <NUM_LIT:0> ) { current = current . innerTracker ; if ( current == null ) { reportError ( scope . problemReporter ( ) , null , mergedStatus ) ; return true ; } } boolean hasReported = false ; if ( this . recordedLocations != null ) { Iterator locations = this . recordedLocations . entrySet ( ) . iterator ( ) ; int reportFlags = <NUM_LIT:0> ; while ( locations . hasNext ( ) ) { Map . Entry entry = ( Entry ) locations . next ( ) ; reportFlags |= reportError ( scope . problemReporter ( ) , ( ASTNode ) entry . getKey ( ) , ( ( Integer ) entry . getValue ( ) ) . intValue ( ) ) ; hasReported = true ; } if ( reportFlags != <NUM_LIT:0> ) { current = this ; do { current . globalClosingState |= reportFlags ; } while ( ( current = current . innerTracker ) != null ) ; } } return hasReported ; } public int reportError ( ProblemReporter problemReporter , ASTNode location , int nullStatus ) { if ( ( this . globalClosingState & OWNED_BY_OUTSIDE ) != <NUM_LIT:0> ) { return <NUM_LIT:0> ; } boolean isPotentialProblem = false ; if ( nullStatus == FlowInfo . NULL ) { if ( ( this . globalClosingState & CLOSED_IN_NESTED_METHOD ) != <NUM_LIT:0> ) isPotentialProblem = true ; } else if ( ( nullStatus & ( FlowInfo . POTENTIALLY_NULL | FlowInfo . POTENTIALLY_NON_NULL ) ) != <NUM_LIT:0> ) { isPotentialProblem = true ; } if ( isPotentialProblem ) { if ( ( this . globalClosingState & ( REPORTED_POTENTIAL_LEAK | REPORTED_DEFINITIVE_LEAK ) ) != <NUM_LIT:0> ) return <NUM_LIT:0> ; problemReporter . potentiallyUnclosedCloseable ( this , location ) ; } else { if ( ( this . globalClosingState & ( REPORTED_DEFINITIVE_LEAK ) ) != <NUM_LIT:0> ) return <NUM_LIT:0> ; problemReporter . unclosedCloseable ( this , location ) ; } int reportFlag = isPotentialProblem ? REPORTED_POTENTIAL_LEAK : REPORTED_DEFINITIVE_LEAK ; if ( location == null ) { FakedTrackingVariable current = this ; do { current . globalClosingState |= reportFlag ; } while ( ( current = current . innerTracker ) != null ) ; } return reportFlag ; } public void reportExplicitClosing ( ProblemReporter problemReporter ) { if ( ( this . globalClosingState & ( OWNED_BY_OUTSIDE | REPORTED_EXPLICIT_CLOSE ) ) == <NUM_LIT:0> ) { this . globalClosingState |= REPORTED_EXPLICIT_CLOSE ; problemReporter . explicitlyClosedAutoCloseable ( this ) ; } } public void resetReportingBits ( ) { FakedTrackingVariable current = this ; do { current . globalClosingState &= ~ ( REPORTED_POTENTIAL_LEAK | REPORTED_DEFINITIVE_LEAK ) ; current = current . innerTracker ; } while ( current != null ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class SingleTypeReference extends TypeReference { public char [ ] token ; public SingleTypeReference ( char [ ] source , long pos ) { this . token = source ; this . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; this . sourceEnd = ( int ) ( pos & <NUM_LIT> ) ; } public TypeReference copyDims ( int dim ) { return new ArrayTypeReference ( this . token , dim , ( ( ( long ) this . sourceStart ) << <NUM_LIT:32> ) + this . sourceEnd ) ; } public char [ ] getLastToken ( ) { return this . token ; } protected TypeBinding getTypeBinding ( Scope scope ) { if ( this . resolvedType != null ) return this . resolvedType ; this . resolvedType = scope . getType ( this . token ) ; if ( scope . kind == Scope . CLASS_SCOPE && this . resolvedType . isValidBinding ( ) ) if ( ( ( ClassScope ) scope ) . detectHierarchyCycle ( this . resolvedType , this ) ) return null ; return this . resolvedType ; } public char [ ] [ ] getTypeName ( ) { return new char [ ] [ ] { this . token } ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return output . append ( this . token ) ; } public TypeBinding resolveTypeEnclosing ( BlockScope scope , ReferenceBinding enclosingType ) { TypeBinding memberType = this . resolvedType = scope . getMemberType ( this . token , enclosingType ) ; boolean hasError = false ; if ( ! memberType . isValidBinding ( ) ) { hasError = true ; scope . problemReporter ( ) . invalidEnclosingType ( this , memberType , enclosingType ) ; memberType = ( ( ReferenceBinding ) memberType ) . closestMatch ( ) ; if ( memberType == null ) { return null ; } } if ( isTypeUseDeprecated ( memberType , scope ) ) reportDeprecatedType ( memberType , scope ) ; memberType = scope . environment ( ) . convertToRawType ( memberType , false ) ; if ( memberType . isRawType ( ) && ( this . bits & IgnoreRawTypeCheck ) == <NUM_LIT:0> && scope . compilerOptions ( ) . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore ) { scope . problemReporter ( ) . rawTypeReference ( this , memberType ) ; } if ( hasError ) { return memberType ; } return this . resolvedType = memberType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . impl . LongConstant ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public class LongLiteral extends NumberLiteral { private static final char [ ] HEXA_MIN_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] HEXA_MINUS_ONE_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] OCTAL_MIN_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] OCTAL_MINUS_ONE_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] DECIMAL_MIN_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] DECIMAL_MAX_VALUE = "<STR_LIT>" . toCharArray ( ) ; private char [ ] reducedForm ; public static LongLiteral buildLongLiteral ( char [ ] token , int s , int e ) { char [ ] longReducedToken = removePrefixZerosAndUnderscores ( token , true ) ; return new LongLiteral ( token , longReducedToken != token ? longReducedToken : null , s , e ) ; } LongLiteral ( char [ ] token , char [ ] reducedForm , int start , int end ) { super ( token , start , end ) ; this . reducedForm = reducedForm ; } public LongLiteral convertToMinValue ( ) { if ( ( ( this . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { return this ; } char [ ] token = this . reducedForm != null ? this . reducedForm : this . source ; switch ( token . length ) { case <NUM_LIT:20> : if ( CharOperation . equals ( token , DECIMAL_MIN_VALUE , false ) ) { return new LongLiteralMinValue ( this . source , this . reducedForm , this . sourceStart , this . sourceEnd ) ; } break ; } return this ; } public void computeConstant ( ) { char [ ] token = this . reducedForm != null ? this . reducedForm : this . source ; int tokenLength = token . length ; int length = tokenLength - <NUM_LIT:1> ; int radix = <NUM_LIT:10> ; int j = <NUM_LIT:0> ; if ( token [ <NUM_LIT:0> ] == '<CHAR_LIT:0>' ) { if ( length == <NUM_LIT:1> ) { this . constant = LongConstant . fromValue ( <NUM_LIT> ) ; return ; } if ( ( token [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) || ( token [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { radix = <NUM_LIT:16> ; j = <NUM_LIT:2> ; } else if ( ( token [ <NUM_LIT:1> ] == '<CHAR_LIT:b>' ) || ( token [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { radix = <NUM_LIT:2> ; j = <NUM_LIT:2> ; } else { radix = <NUM_LIT:8> ; j = <NUM_LIT:1> ; } } switch ( radix ) { case <NUM_LIT:2> : if ( ( length - <NUM_LIT:2> ) > <NUM_LIT> ) { return ; } computeValue ( token , length , radix , j ) ; break ; case <NUM_LIT:16> : if ( tokenLength <= <NUM_LIT> ) { if ( CharOperation . equals ( token , HEXA_MINUS_ONE_VALUE ) ) { this . constant = LongConstant . fromValue ( - <NUM_LIT:1L> ) ; return ; } computeValue ( token , length , radix , j ) ; } break ; case <NUM_LIT:10> : if ( tokenLength > DECIMAL_MAX_VALUE . length || ( tokenLength == DECIMAL_MAX_VALUE . length && CharOperation . compareTo ( token , DECIMAL_MAX_VALUE , <NUM_LIT:0> , length ) > <NUM_LIT:0> ) ) { return ; } computeValue ( token , length , radix , j ) ; break ; case <NUM_LIT:8> : if ( tokenLength <= <NUM_LIT:24> ) { if ( tokenLength == <NUM_LIT:24> && token [ j ] > '<CHAR_LIT:1>' ) { return ; } if ( CharOperation . equals ( token , OCTAL_MINUS_ONE_VALUE ) ) { this . constant = LongConstant . fromValue ( - <NUM_LIT:1L> ) ; return ; } computeValue ( token , length , radix , j ) ; } break ; } } private void computeValue ( char [ ] token , int tokenLength , int radix , int j ) { int digitValue ; long computedValue = <NUM_LIT:0> ; while ( j < tokenLength ) { if ( ( digitValue = ScannerHelper . digit ( token [ j ++ ] , radix ) ) < <NUM_LIT:0> ) { return ; } computedValue = ( computedValue * radix ) + digitValue ; } this . constant = LongConstant . fromValue ( computedValue ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . LONG ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . impl . * ; public class IntLiteralMinValue extends IntLiteral { final static char [ ] CharValue = new char [ ] { '<CHAR_LIT:->' , '<CHAR_LIT>' , '<CHAR_LIT:1>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; public IntLiteralMinValue ( char [ ] token , char [ ] reducedToken , int start , int end ) { super ( token , reducedToken , start , end , Integer . MIN_VALUE , IntConstant . fromValue ( Integer . MIN_VALUE ) ) ; } public void computeConstant ( ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class Argument extends LocalDeclaration { private final static char [ ] SET = "<STR_LIT>" . toCharArray ( ) ; public Argument ( char [ ] name , long posNom , TypeReference tr , int modifiers ) { super ( name , ( int ) ( posNom > > > <NUM_LIT:32> ) , ( int ) posNom ) ; this . declarationSourceEnd = ( int ) posNom ; this . modifiers = modifiers ; this . type = tr ; this . bits |= ( IsLocalDeclarationReachable | IsArgument ) ; } public void createBinding ( MethodScope scope , TypeBinding typeBinding ) { if ( this . binding == null ) { this . binding = new LocalVariableBinding ( this , typeBinding , this . modifiers , true ) ; } else if ( ! this . binding . type . isValidBinding ( ) ) { AbstractMethodDeclaration methodDecl = scope . referenceMethod ( ) ; if ( methodDecl != null ) { MethodBinding methodBinding = methodDecl . binding ; if ( methodBinding != null ) { methodBinding . tagBits |= TagBits . HasUnresolvedArguments ; } } } resolveAnnotations ( scope , this . annotations , this . binding ) ; this . binding . declaration = this ; } public void bind ( MethodScope scope , TypeBinding typeBinding , boolean used ) { createBinding ( scope , typeBinding ) ; Binding existingVariable = scope . getBinding ( this . name , Binding . VARIABLE , this , false ) ; if ( existingVariable != null && existingVariable . isValidBinding ( ) ) { if ( existingVariable instanceof LocalVariableBinding && this . hiddenVariableDepth == <NUM_LIT:0> ) { scope . problemReporter ( ) . redefineArgument ( this ) ; } else { boolean isSpecialArgument = false ; if ( existingVariable instanceof FieldBinding ) { if ( scope . isInsideConstructor ( ) ) { isSpecialArgument = true ; } else { AbstractMethodDeclaration methodDecl = scope . referenceMethod ( ) ; if ( methodDecl != null && CharOperation . prefixEquals ( SET , methodDecl . selector ) ) { isSpecialArgument = true ; } } } scope . problemReporter ( ) . localVariableHiding ( this , existingVariable , isSpecialArgument ) ; } } scope . addLocalVariable ( this . binding ) ; this . binding . useFlag = used ? LocalVariableBinding . USED : LocalVariableBinding . UNUSED ; } public int getKind ( ) { return ( this . bits & ASTNode . IsArgument ) != <NUM_LIT:0> ? PARAMETER : LOCAL_VARIABLE ; } public boolean isVarArgs ( ) { return this . type != null && ( this . type . bits & IsVarArgs ) != <NUM_LIT:0> ; } public StringBuffer print ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; printModifiers ( this . modifiers , output ) ; if ( this . annotations != null ) printAnnotations ( this . annotations , output ) ; if ( this . type == null ) { output . append ( "<STR_LIT>" ) ; } else { this . type . print ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:U+0020>' ) ; } return output . append ( this . name ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { return print ( indent , output ) . append ( '<CHAR_LIT:;>' ) ; } public TypeBinding resolveForCatch ( BlockScope scope ) { TypeBinding exceptionType = this . type . resolveType ( scope , true ) ; boolean hasError ; if ( exceptionType == null ) { hasError = true ; } else { hasError = false ; switch ( exceptionType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : if ( exceptionType . isBoundParameterizedType ( ) ) { hasError = true ; scope . problemReporter ( ) . invalidParameterizedExceptionType ( exceptionType , this ) ; } break ; case Binding . TYPE_PARAMETER : scope . problemReporter ( ) . invalidTypeVariableAsException ( exceptionType , this ) ; hasError = true ; break ; } if ( exceptionType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) == null && exceptionType . isValidBinding ( ) ) { scope . problemReporter ( ) . cannotThrowType ( this . type , exceptionType ) ; hasError = true ; } } Binding existingVariable = scope . getBinding ( this . name , Binding . VARIABLE , this , false ) ; if ( existingVariable != null && existingVariable . isValidBinding ( ) ) { if ( existingVariable instanceof LocalVariableBinding && this . hiddenVariableDepth == <NUM_LIT:0> ) { scope . problemReporter ( ) . redefineArgument ( this ) ; } else { scope . problemReporter ( ) . localVariableHiding ( this , existingVariable , false ) ; } } if ( ( this . type . bits & ASTNode . IsUnionType ) != <NUM_LIT:0> ) { this . binding = new CatchParameterBinding ( this , exceptionType , this . modifiers | ClassFileConstants . AccFinal , false ) ; this . binding . tagBits |= TagBits . MultiCatchParameter ; } else { this . binding = new CatchParameterBinding ( this , exceptionType , this . modifiers , false ) ; } resolveAnnotations ( scope , this . annotations , this . binding ) ; scope . addLocalVariable ( this . binding ) ; this . binding . setConstant ( Constant . NotAConstant ) ; if ( hasError ) return null ; return exceptionType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , scope ) ; } if ( this . type != null ) this . type . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , scope ) ; } if ( this . type != null ) this . type . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class InstanceOfExpression extends OperatorExpression { public Expression expression ; public TypeReference type ; public InstanceOfExpression ( Expression expression , TypeReference type ) { this . expression = expression ; this . type = type ; type . bits |= IgnoreRawTypeCheck ; this . bits |= INSTANCEOF << OperatorSHIFT ; this . sourceStart = expression . sourceStart ; this . sourceEnd = type . sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { LocalVariableBinding local = this . expression . localVariableBinding ( ) ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { flowInfo = this . expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; FlowInfo initsWhenTrue = flowInfo . copy ( ) ; initsWhenTrue . markAsComparedEqualToNonNull ( local ) ; flowContext . recordUsingNullReference ( currentScope , local , this . expression , FlowContext . CAN_ONLY_NULL | FlowContext . IN_INSTANCEOF , flowInfo ) ; return FlowInfo . conditional ( initsWhenTrue , flowInfo . copy ( ) ) ; } return this . expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; this . expression . generateCode ( currentScope , codeStream , true ) ; codeStream . instance_of ( this . type . resolvedType ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { codeStream . pop ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { this . expression . printExpression ( indent , output ) . append ( "<STR_LIT>" ) ; return this . type . print ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; TypeBinding expressionType = this . expression . resolveType ( scope ) ; TypeBinding checkedType = this . type . resolveType ( scope , true ) ; if ( expressionType == null || checkedType == null ) return null ; if ( ! checkedType . isReifiable ( ) ) { scope . problemReporter ( ) . illegalInstanceOfGenericType ( checkedType , this ) ; } else if ( ( expressionType != TypeBinding . NULL && expressionType . isBaseType ( ) ) || ! checkCastTypesCompatibility ( scope , checkedType , expressionType , null ) ) { scope . problemReporter ( ) . notCompatibleTypesError ( this , expressionType , checkedType ) ; } return this . resolvedType = TypeBinding . BOOLEAN ; } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { if ( this . expression . resolvedType != TypeBinding . NULL ) scope . problemReporter ( ) . unnecessaryInstanceof ( this , castType ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . expression . traverse ( visitor , scope ) ; this . type . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class BreakStatement extends BranchStatement { public BreakStatement ( char [ ] label , int sourceStart , int e ) { super ( label , sourceStart , e ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowContext targetContext = ( this . label == null ) ? flowContext . getTargetContextForDefaultBreak ( ) : flowContext . getTargetContextForBreakLabel ( this . label ) ; if ( targetContext == null ) { if ( this . label == null ) { currentScope . problemReporter ( ) . invalidBreak ( this ) ; } else { currentScope . problemReporter ( ) . undefinedLabel ( this ) ; } return flowInfo ; } this . initStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; this . targetLabel = targetContext . breakLabel ( ) ; FlowContext traversedContext = flowContext ; int subCount = <NUM_LIT:0> ; this . subroutines = new SubRoutineStatement [ <NUM_LIT:5> ] ; do { SubRoutineStatement sub ; if ( ( sub = traversedContext . subroutine ( ) ) != null ) { if ( subCount == this . subroutines . length ) { System . arraycopy ( this . subroutines , <NUM_LIT:0> , ( this . subroutines = new SubRoutineStatement [ subCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , subCount ) ; } this . subroutines [ subCount ++ ] = sub ; if ( sub . isSubRoutineEscaping ( ) ) { break ; } } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; traversedContext . recordBreakTo ( targetContext ) ; if ( traversedContext instanceof InsideSubRoutineFlowContext ) { ASTNode node = traversedContext . associatedNode ; if ( node instanceof TryStatement ) { TryStatement tryStatement = ( TryStatement ) node ; flowInfo . addInitializationsFrom ( tryStatement . subRoutineInits ) ; } } else if ( traversedContext == targetContext ) { targetContext . recordBreakFrom ( flowInfo ) ; break ; } } while ( ( traversedContext = traversedContext . getLocalParent ( ) ) != null ) ; if ( subCount != this . subroutines . length ) { System . arraycopy ( this . subroutines , <NUM_LIT:0> , ( this . subroutines = new SubRoutineStatement [ subCount ] ) , <NUM_LIT:0> , subCount ) ; } return FlowInfo . DEAD_END ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( "<STR_LIT>" ) ; if ( this . label != null ) output . append ( '<CHAR_LIT:U+0020>' ) . append ( this . label ) ; return output . append ( '<CHAR_LIT:;>' ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockscope ) { visitor . visit ( this , blockscope ) ; visitor . endVisit ( this , blockscope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ParameterizedSingleTypeReference extends ArrayTypeReference { public TypeReference [ ] typeArguments ; public ParameterizedSingleTypeReference ( char [ ] name , TypeReference [ ] typeArguments , int dim , long pos ) { super ( name , dim , pos ) ; this . originalSourceEnd = this . sourceEnd ; this . typeArguments = typeArguments ; } public void checkBounds ( Scope scope ) { if ( this . resolvedType == null ) return ; if ( this . resolvedType . leafComponentType ( ) instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) this . resolvedType . leafComponentType ( ) ; ReferenceBinding currentType = parameterizedType . genericType ( ) ; TypeVariableBinding [ ] typeVariables = currentType . typeVariables ( ) ; TypeBinding [ ] argTypes = parameterizedType . arguments ; if ( argTypes != null && typeVariables != null ) { parameterizedType . boundCheck ( scope , this . typeArguments ) ; } } } public TypeReference copyDims ( int dim ) { return new ParameterizedSingleTypeReference ( this . token , this . typeArguments , dim , ( ( ( long ) this . sourceStart ) << <NUM_LIT:32> ) + this . sourceEnd ) ; } public char [ ] [ ] getParameterizedTypeName ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( this . token ) . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , length = this . typeArguments . length ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; buffer . append ( CharOperation . concatWith ( this . typeArguments [ i ] . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ) ; } buffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = buffer . length ( ) ; char [ ] name = new char [ nameLength ] ; buffer . getChars ( <NUM_LIT:0> , nameLength , name , <NUM_LIT:0> ) ; int dim = this . dimensions ; if ( dim > <NUM_LIT:0> ) { char [ ] dimChars = new char [ dim * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < dim ; i ++ ) { int index = i * <NUM_LIT:2> ; dimChars [ index ] = '<CHAR_LIT:[>' ; dimChars [ index + <NUM_LIT:1> ] = '<CHAR_LIT:]>' ; } name = CharOperation . concat ( name , dimChars ) ; } return new char [ ] [ ] { name } ; } protected TypeBinding getTypeBinding ( Scope scope ) { return null ; } private TypeBinding internalResolveType ( Scope scope , ReferenceBinding enclosingType , boolean checkBounds ) { this . constant = Constant . NotAConstant ; if ( ( this . bits & ASTNode . DidResolve ) != <NUM_LIT:0> ) { if ( this . resolvedType != null ) { if ( this . resolvedType . isValidBinding ( ) ) { return this . resolvedType ; } else { switch ( this . resolvedType . problemId ( ) ) { case ProblemReasons . NotFound : case ProblemReasons . NotVisible : case ProblemReasons . InheritedNameHidesEnclosingName : TypeBinding type = this . resolvedType . closestMatch ( ) ; return type ; default : return null ; } } } } this . bits |= ASTNode . DidResolve ; TypeBinding type = internalResolveLeafType ( scope , enclosingType , checkBounds ) ; if ( type == null ) { this . resolvedType = createArrayType ( scope , this . resolvedType ) ; return null ; } else { type = createArrayType ( scope , type ) ; if ( ! this . resolvedType . isValidBinding ( ) ) return type ; else return this . resolvedType = type ; } } private TypeBinding internalResolveLeafType ( Scope scope , ReferenceBinding enclosingType , boolean checkBounds ) { ReferenceBinding currentType ; if ( enclosingType == null ) { this . resolvedType = scope . getType ( this . token ) ; if ( this . resolvedType . isValidBinding ( ) ) { currentType = ( ReferenceBinding ) this . resolvedType ; } else { reportInvalidType ( scope ) ; switch ( this . resolvedType . problemId ( ) ) { case ProblemReasons . NotFound : case ProblemReasons . NotVisible : case ProblemReasons . InheritedNameHidesEnclosingName : TypeBinding type = this . resolvedType . closestMatch ( ) ; if ( type instanceof ReferenceBinding ) { currentType = ( ReferenceBinding ) type ; break ; } default : boolean isClassScope = scope . kind == Scope . CLASS_SCOPE ; int argLength = this . typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeReference typeArgument = this . typeArguments [ i ] ; if ( isClassScope ) { typeArgument . resolveType ( ( ClassScope ) scope ) ; } else { typeArgument . resolveType ( ( BlockScope ) scope , checkBounds ) ; } } return null ; } } enclosingType = currentType . enclosingType ( ) ; if ( enclosingType != null ) { enclosingType = currentType . isStatic ( ) ? ( ReferenceBinding ) scope . environment ( ) . convertToRawType ( enclosingType , false ) : scope . environment ( ) . convertToParameterizedType ( enclosingType ) ; currentType = scope . environment ( ) . createParameterizedType ( ( ReferenceBinding ) currentType . erasure ( ) , null , enclosingType ) ; } } else { this . resolvedType = currentType = scope . getMemberType ( this . token , enclosingType ) ; if ( ! this . resolvedType . isValidBinding ( ) ) { scope . problemReporter ( ) . invalidEnclosingType ( this , currentType , enclosingType ) ; return null ; } if ( isTypeUseDeprecated ( currentType , scope ) ) scope . problemReporter ( ) . deprecatedType ( currentType , this ) ; ReferenceBinding currentEnclosing = currentType . enclosingType ( ) ; if ( currentEnclosing != null && currentEnclosing . erasure ( ) != enclosingType . erasure ( ) ) { enclosingType = currentEnclosing ; } } boolean isClassScope = scope . kind == Scope . CLASS_SCOPE ; TypeReference keep = null ; if ( isClassScope ) { keep = ( ( ClassScope ) scope ) . superTypeReference ; ( ( ClassScope ) scope ) . superTypeReference = null ; } int argLength = this . typeArguments . length ; TypeBinding [ ] argTypes = new TypeBinding [ argLength ] ; boolean argHasError = false ; ReferenceBinding currentOriginal = ( ReferenceBinding ) currentType . original ( ) ; for ( int i = <NUM_LIT:0> ; i < argLength ; i ++ ) { TypeReference typeArgument = this . typeArguments [ i ] ; TypeBinding argType = isClassScope ? typeArgument . resolveTypeArgument ( ( ClassScope ) scope , currentOriginal , i ) : typeArgument . resolveTypeArgument ( ( BlockScope ) scope , currentOriginal , i ) ; if ( argType == null ) { argHasError = true ; } else { argTypes [ i ] = argType ; } } if ( argHasError ) { return null ; } if ( isClassScope ) { ( ( ClassScope ) scope ) . superTypeReference = keep ; if ( ( ( ClassScope ) scope ) . detectHierarchyCycle ( currentOriginal , this ) ) return null ; } final boolean isDiamond = ( this . bits & ASTNode . IsDiamond ) != <NUM_LIT:0> ; TypeVariableBinding [ ] typeVariables = currentOriginal . typeVariables ( ) ; if ( typeVariables == Binding . NO_TYPE_VARIABLES ) { boolean isCompliant15 = scope . compilerOptions ( ) . originalSourceLevel >= ClassFileConstants . JDK1_5 ; if ( ( currentOriginal . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { if ( isCompliant15 ) { this . resolvedType = currentType ; scope . problemReporter ( ) . nonGenericTypeCannotBeParameterized ( <NUM_LIT:0> , this , currentType , argTypes ) ; return null ; } } if ( ! isCompliant15 ) { if ( ! this . resolvedType . isValidBinding ( ) ) return currentType ; return this . resolvedType = currentType ; } } else if ( argLength != typeVariables . length ) { if ( ! isDiamond ) { scope . problemReporter ( ) . incorrectArityForParameterizedType ( this , currentType , argTypes ) ; return null ; } } else if ( ! currentType . isStatic ( ) ) { ReferenceBinding actualEnclosing = currentType . enclosingType ( ) ; if ( actualEnclosing != null && actualEnclosing . isRawType ( ) ) { scope . problemReporter ( ) . rawMemberTypeCannotBeParameterized ( this , scope . environment ( ) . createRawType ( currentOriginal , actualEnclosing ) , argTypes ) ; return null ; } } ParameterizedTypeBinding parameterizedType = scope . environment ( ) . createParameterizedType ( currentOriginal , argTypes , enclosingType ) ; if ( ! isDiamond ) { if ( checkBounds ) parameterizedType . boundCheck ( scope , this . typeArguments ) ; else scope . deferBoundCheck ( this ) ; } if ( isTypeUseDeprecated ( parameterizedType , scope ) ) reportDeprecatedType ( parameterizedType , scope ) ; if ( ! this . resolvedType . isValidBinding ( ) ) { return parameterizedType ; } return this . resolvedType = parameterizedType ; } private TypeBinding createArrayType ( Scope scope , TypeBinding type ) { if ( this . dimensions > <NUM_LIT:0> ) { if ( this . dimensions > <NUM_LIT:255> ) scope . problemReporter ( ) . tooManyDimensions ( this ) ; return scope . createArrayType ( type , this . dimensions ) ; } return type ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( this . token ) ; output . append ( "<STR_LIT:<>" ) ; int length = this . typeArguments . length ; if ( length > <NUM_LIT:0> ) { int max = length - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { this . typeArguments [ i ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } this . typeArguments [ max ] . print ( <NUM_LIT:0> , output ) ; } output . append ( "<STR_LIT:>>" ) ; if ( ( this . bits & IsVarArgs ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . dimensions - <NUM_LIT:1> ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } output . append ( "<STR_LIT:...>" ) ; } else { for ( int i = <NUM_LIT:0> ; i < this . dimensions ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } } return output ; } public TypeBinding resolveType ( BlockScope scope , boolean checkBounds ) { return internalResolveType ( scope , null , checkBounds ) ; } public TypeBinding resolveType ( ClassScope scope ) { return internalResolveType ( scope , null , false ) ; } public TypeBinding resolveTypeEnclosing ( BlockScope scope , ReferenceBinding enclosingType ) { return internalResolveType ( scope , enclosingType , true ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { for ( int i = <NUM_LIT:0> , max = this . typeArguments . length ; i < max ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { for ( int i = <NUM_LIT:0> , max = this . typeArguments . length ; i < max ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; public class ExtendedStringLiteral extends StringLiteral { public ExtendedStringLiteral ( StringLiteral str , CharLiteral character ) { super ( str . source , str . sourceStart , str . sourceEnd , str . lineNumber ) ; extendWith ( character ) ; } public ExtendedStringLiteral ( StringLiteral str1 , StringLiteral str2 ) { super ( str1 . source , str1 . sourceStart , str1 . sourceEnd , str1 . lineNumber ) ; extendWith ( str2 ) ; } public ExtendedStringLiteral extendWith ( CharLiteral lit ) { int length = this . source . length ; System . arraycopy ( this . source , <NUM_LIT:0> , ( this . source = new char [ length + <NUM_LIT:1> ] ) , <NUM_LIT:0> , length ) ; this . source [ length ] = lit . value ; this . sourceEnd = lit . sourceEnd ; return this ; } public ExtendedStringLiteral extendWith ( StringLiteral lit ) { int length = this . source . length ; System . arraycopy ( this . source , <NUM_LIT:0> , this . source = new char [ length + lit . source . length ] , <NUM_LIT:0> , length ) ; System . arraycopy ( lit . source , <NUM_LIT:0> , this . source , length , lit . source . length ) ; this . sourceEnd = lit . sourceEnd ; return this ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return output . append ( "<STR_LIT>" ) . append ( this . source ) . append ( '<CHAR_LIT:}>' ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public abstract class BranchStatement extends Statement { public char [ ] label ; public BranchLabel targetLabel ; public SubRoutineStatement [ ] subroutines ; public int initStateIndex = - <NUM_LIT:1> ; public BranchStatement ( char [ ] label , int sourceStart , int sourceEnd ) { this . label = label ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; if ( this . subroutines != null ) { for ( int i = <NUM_LIT:0> , max = this . subroutines . length ; i < max ; i ++ ) { SubRoutineStatement sub = this . subroutines [ i ] ; boolean didEscape = sub . generateSubRoutineInvocation ( currentScope , codeStream , this . targetLabel , this . initStateIndex , null ) ; if ( didEscape ) { codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; SubRoutineStatement . reenterAllExceptionHandlers ( this . subroutines , i , codeStream ) ; if ( this . initStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . initStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . initStateIndex ) ; } return ; } } } codeStream . goto_ ( this . targetLabel ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; SubRoutineStatement . reenterAllExceptionHandlers ( this . subroutines , - <NUM_LIT:1> , codeStream ) ; if ( this . initStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . initStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . initStateIndex ) ; } } public void resolve ( BlockScope scope ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . util . FloatUtil ; public class DoubleLiteral extends NumberLiteral { double value ; public DoubleLiteral ( char [ ] token , int s , int e ) { super ( token , s , e ) ; } public void computeConstant ( ) { Double computedValue ; boolean containsUnderscores = CharOperation . indexOf ( '<CHAR_LIT:_>' , this . source ) > <NUM_LIT:0> ; if ( containsUnderscores ) { this . source = CharOperation . remove ( this . source , '<CHAR_LIT:_>' ) ; } try { computedValue = Double . valueOf ( String . valueOf ( this . source ) ) ; } catch ( NumberFormatException e ) { try { double v = FloatUtil . valueOfHexDoubleLiteral ( this . source ) ; if ( v == Double . POSITIVE_INFINITY ) { return ; } if ( Double . isNaN ( v ) ) { return ; } this . value = v ; this . constant = DoubleConstant . fromValue ( v ) ; } catch ( NumberFormatException e1 ) { } return ; } final double doubleValue = computedValue . doubleValue ( ) ; if ( doubleValue > Double . MAX_VALUE ) { return ; } if ( doubleValue < Double . MIN_VALUE ) { boolean isHexaDecimal = false ; label : for ( int i = <NUM_LIT:0> ; i < this . source . length ; i ++ ) { switch ( this . source [ i ] ) { case '<CHAR_LIT:0>' : case '<CHAR_LIT:.>' : break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : isHexaDecimal = true ; break ; case '<CHAR_LIT:e>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : if ( isHexaDecimal ) { return ; } break label ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : break label ; default : return ; } } } this . value = doubleValue ; this . constant = DoubleConstant . fromValue ( this . value ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . DOUBLE ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . impl . * ; public class LongLiteralMinValue extends LongLiteral { final static char [ ] CharValue = new char [ ] { '<CHAR_LIT:->' , '<CHAR_LIT:9>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:0>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:0>' , '<CHAR_LIT>' , '<CHAR_LIT>' } ; public LongLiteralMinValue ( char [ ] token , char [ ] reducedForm , int start , int end ) { super ( token , reducedForm , start , end ) ; this . constant = LongConstant . fromValue ( Long . MIN_VALUE ) ; } public void computeConstant ( ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . parser . Parser ; public class AnnotationMethodDeclaration extends MethodDeclaration { public Expression defaultValue ; public int extendedDimensions ; public AnnotationMethodDeclaration ( CompilationResult compilationResult ) { super ( compilationResult ) ; } public void generateCode ( ClassFile classFile ) { classFile . generateMethodInfoHeader ( this . binding ) ; int methodAttributeOffset = classFile . contentsOffset ; int attributeNumber = classFile . generateMethodInfoAttributes ( this . binding , this ) ; classFile . completeMethodInfo ( this . binding , methodAttributeOffset , attributeNumber ) ; } public boolean isAnnotationMethod ( ) { return true ; } public boolean isMethod ( ) { return false ; } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer print ( int tab , StringBuffer output ) { printIndent ( tab , output ) ; printModifiers ( this . modifiers , output ) ; if ( this . annotations != null ) printAnnotations ( this . annotations , output ) ; TypeParameter [ ] typeParams = typeParameters ( ) ; if ( typeParams != null ) { output . append ( '<CHAR_LIT>' ) ; int max = typeParams . length - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < max ; j ++ ) { typeParams [ j ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } typeParams [ max ] . print ( <NUM_LIT:0> , output ) ; output . append ( '<CHAR_LIT:>>' ) ; } printReturnType ( <NUM_LIT:0> , output ) . append ( this . selector ) . append ( '<CHAR_LIT:(>' ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> ; i < this . arguments . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . arguments [ i ] . print ( <NUM_LIT:0> , output ) ; } } output . append ( '<CHAR_LIT:)>' ) ; if ( this . thrownExceptions != null ) { output . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < this . thrownExceptions . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . thrownExceptions [ i ] . print ( <NUM_LIT:0> , output ) ; } } if ( this . defaultValue != null ) { output . append ( "<STR_LIT>" ) ; this . defaultValue . print ( <NUM_LIT:0> , output ) ; } printBody ( tab + <NUM_LIT:1> , output ) ; return output ; } public void resolveStatements ( ) { super . resolveStatements ( ) ; if ( this . arguments != null ) { this . scope . problemReporter ( ) . annotationMembersCannotHaveParameters ( this ) ; } if ( this . typeParameters != null ) { this . scope . problemReporter ( ) . annotationMembersCannotHaveTypeParameters ( this ) ; } if ( this . extendedDimensions != <NUM_LIT:0> ) { this . scope . problemReporter ( ) . illegalExtendedDimensions ( this ) ; } if ( this . binding == null ) return ; TypeBinding returnTypeBinding = this . binding . returnType ; if ( returnTypeBinding != null ) { checkAnnotationMethodType : { TypeBinding leafReturnType = returnTypeBinding . leafComponentType ( ) ; if ( returnTypeBinding . dimensions ( ) <= <NUM_LIT:1> ) { switch ( leafReturnType . erasure ( ) . id ) { case T_byte : case T_short : case T_char : case T_int : case T_long : case T_float : case T_double : case T_boolean : case T_JavaLangString : case T_JavaLangClass : break checkAnnotationMethodType ; } if ( leafReturnType . isEnum ( ) || leafReturnType . isAnnotationType ( ) ) break checkAnnotationMethodType ; } this . scope . problemReporter ( ) . invalidAnnotationMemberType ( this ) ; } if ( this . defaultValue != null ) { MemberValuePair pair = new MemberValuePair ( this . selector , this . sourceStart , this . sourceEnd , this . defaultValue ) ; pair . binding = this . binding ; pair . resolveTypeExpecting ( this . scope , returnTypeBinding ) ; this . binding . setDefaultValue ( org . eclipse . jdt . internal . compiler . lookup . ElementValuePair . getValue ( this . defaultValue ) ) ; } else { this . binding . setDefaultValue ( null ) ; } } } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { if ( visitor . visit ( this , classScope ) ) { if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , this . scope ) ; } if ( this . returnType != null ) { this . returnType . traverse ( visitor , this . scope ) ; } if ( this . defaultValue != null ) { this . defaultValue . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , classScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class WhileStatement extends Statement { public Expression condition ; public Statement action ; private BranchLabel breakLabel , continueLabel ; int preCondInitStateIndex = - <NUM_LIT:1> ; int condIfTrueInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; public WhileStatement ( Expression condition , Statement action , int s , int e ) { this . condition = condition ; this . action = action ; if ( action instanceof EmptyStatement ) action . bits |= IsUsefulEmptyStatement ; this . sourceStart = s ; this . sourceEnd = e ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . breakLabel = new BranchLabel ( ) ; this . continueLabel = new BranchLabel ( ) ; int initialComplaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; Constant cst = this . condition . constant ; boolean isConditionTrue = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isConditionFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; cst = this . condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedTrue = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isConditionOptimizedFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; this . preCondInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; LoopingFlowContext condLoopContext ; FlowInfo condInfo = flowInfo . nullInfoLessUnconditionalCopy ( ) ; condInfo = this . condition . analyseCode ( currentScope , ( condLoopContext = new LoopingFlowContext ( flowContext , flowInfo , this , null , null , currentScope ) ) , condInfo ) ; if ( ( this . condition . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . condition . checkNPE ( currentScope , flowContext , flowInfo ) ; } LoopingFlowContext loopingContext ; FlowInfo actionInfo ; FlowInfo exitBranch ; if ( this . action == null || ( this . action . isEmptyBlock ( ) && currentScope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_3 ) ) { condLoopContext . complainOnDeferredFinalChecks ( currentScope , condInfo ) ; condLoopContext . complainOnDeferredNullChecks ( currentScope , condInfo . unconditionalInits ( ) ) ; if ( isConditionTrue ) { return FlowInfo . DEAD_END ; } else { FlowInfo mergedInfo = flowInfo . copy ( ) . addInitializationsFrom ( condInfo . initsWhenFalse ( ) ) ; if ( isConditionOptimizedTrue ) { mergedInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } } else { loopingContext = new LoopingFlowContext ( flowContext , flowInfo , this , this . breakLabel , this . continueLabel , currentScope ) ; if ( isConditionFalse ) { actionInfo = FlowInfo . DEAD_END ; } else { actionInfo = condInfo . initsWhenTrue ( ) . copy ( ) ; if ( isConditionOptimizedFalse ) { actionInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } } this . condIfTrueInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( condInfo . initsWhenTrue ( ) ) ; if ( this . action . complainIfUnreachable ( actionInfo , currentScope , initialComplaintLevel , true ) < Statement . COMPLAINED_UNREACHABLE ) { actionInfo = this . action . analyseCode ( currentScope , loopingContext , actionInfo ) ; } exitBranch = flowInfo . copy ( ) ; int combinedTagBits = actionInfo . tagBits & loopingContext . initsOnContinue . tagBits ; if ( ( combinedTagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ) { if ( ( combinedTagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) this . continueLabel = null ; exitBranch . addInitializationsFrom ( condInfo . initsWhenFalse ( ) ) ; } else { condLoopContext . complainOnDeferredFinalChecks ( currentScope , condInfo ) ; actionInfo = actionInfo . mergedWith ( loopingContext . initsOnContinue . unconditionalInits ( ) ) ; condLoopContext . complainOnDeferredNullChecks ( currentScope , actionInfo ) ; loopingContext . complainOnDeferredFinalChecks ( currentScope , actionInfo ) ; loopingContext . complainOnDeferredNullChecks ( currentScope , actionInfo ) ; exitBranch . addPotentialInitializationsFrom ( actionInfo . unconditionalInits ( ) ) . addInitializationsFrom ( condInfo . initsWhenFalse ( ) ) ; } if ( loopingContext . hasEscapingExceptions ( ) ) { FlowInfo loopbackFlowInfo = flowInfo . copy ( ) ; if ( this . continueLabel != null ) { loopbackFlowInfo . mergedWith ( actionInfo . unconditionalCopy ( ) ) ; } loopingContext . simulateThrowAfterLoopBack ( loopbackFlowInfo ) ; } } FlowInfo mergedInfo = FlowInfo . mergedOptimizedBranches ( ( loopingContext . initsOnBreak . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? loopingContext . initsOnBreak : flowInfo . addInitializationsFrom ( loopingContext . initsOnBreak ) , isConditionOptimizedTrue , exitBranch , isConditionOptimizedFalse , ! isConditionTrue ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; Constant cst = this . condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; if ( isConditionOptimizedFalse ) { this . condition . generateCode ( currentScope , codeStream , false ) ; if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } this . breakLabel . initialize ( codeStream ) ; if ( this . continueLabel == null ) { if ( this . condition . constant == Constant . NotAConstant ) { this . condition . generateOptimizedBoolean ( currentScope , codeStream , null , this . breakLabel , true ) ; } } else { this . continueLabel . initialize ( codeStream ) ; if ( ! ( ( ( this . condition . constant != Constant . NotAConstant ) && ( this . condition . constant . booleanValue ( ) == true ) ) || ( this . action == null ) || this . action . isEmptyBlock ( ) ) ) { int jumpPC = codeStream . position ; codeStream . goto_ ( this . continueLabel ) ; codeStream . recordPositionsFrom ( jumpPC , this . condition . sourceStart ) ; } } BranchLabel actionLabel = new BranchLabel ( codeStream ) ; if ( this . action != null ) { actionLabel . tagBits |= BranchLabel . USED ; if ( this . condIfTrueInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . condIfTrueInitStateIndex ) ; } actionLabel . place ( ) ; this . action . generateCode ( currentScope , codeStream ) ; if ( this . preCondInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preCondInitStateIndex ) ; } } else { actionLabel . place ( ) ; } if ( this . continueLabel != null ) { this . continueLabel . place ( ) ; this . condition . generateOptimizedBoolean ( currentScope , codeStream , actionLabel , null , true ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } this . breakLabel . place ( ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void resolve ( BlockScope scope ) { TypeBinding type = this . condition . resolveTypeExpecting ( scope , TypeBinding . BOOLEAN ) ; this . condition . computeConversion ( scope , type , type ) ; if ( this . action != null ) this . action . resolve ( scope ) ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( "<STR_LIT>" ) ; this . condition . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:)>' ) ; if ( this . action == null ) output . append ( '<CHAR_LIT:;>' ) ; else this . action . printStatement ( tab + <NUM_LIT:1> , output ) ; return output ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . condition . traverse ( visitor , blockScope ) ; if ( this . action != null ) this . action . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class Wildcard extends SingleTypeReference { public static final int UNBOUND = <NUM_LIT:0> ; public static final int EXTENDS = <NUM_LIT:1> ; public static final int SUPER = <NUM_LIT:2> ; public TypeReference bound ; public int kind ; public Wildcard ( int kind ) { super ( WILDCARD_NAME , <NUM_LIT:0> ) ; this . kind = kind ; } public char [ ] [ ] getParameterizedTypeName ( ) { switch ( this . kind ) { case Wildcard . UNBOUND : return new char [ ] [ ] { WILDCARD_NAME } ; case Wildcard . EXTENDS : return new char [ ] [ ] { CharOperation . concat ( WILDCARD_NAME , WILDCARD_EXTENDS , CharOperation . concatWith ( this . bound . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ) } ; default : return new char [ ] [ ] { CharOperation . concat ( WILDCARD_NAME , WILDCARD_SUPER , CharOperation . concatWith ( this . bound . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ) } ; } } public char [ ] [ ] getTypeName ( ) { switch ( this . kind ) { case Wildcard . UNBOUND : return new char [ ] [ ] { WILDCARD_NAME } ; case Wildcard . EXTENDS : return new char [ ] [ ] { CharOperation . concat ( WILDCARD_NAME , WILDCARD_EXTENDS , CharOperation . concatWith ( this . bound . getTypeName ( ) , '<CHAR_LIT:.>' ) ) } ; default : return new char [ ] [ ] { CharOperation . concat ( WILDCARD_NAME , WILDCARD_SUPER , CharOperation . concatWith ( this . bound . getTypeName ( ) , '<CHAR_LIT:.>' ) ) } ; } } private TypeBinding internalResolveType ( Scope scope , ReferenceBinding genericType , int rank ) { TypeBinding boundType = null ; if ( this . bound != null ) { boundType = scope . kind == Scope . CLASS_SCOPE ? this . bound . resolveType ( ( ClassScope ) scope ) : this . bound . resolveType ( ( BlockScope ) scope , true ) ; if ( boundType == null ) { return null ; } } WildcardBinding wildcard = scope . environment ( ) . createWildcard ( genericType , rank , boundType , null , this . kind ) ; return this . resolvedType = wildcard ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { switch ( this . kind ) { case Wildcard . UNBOUND : output . append ( WILDCARD_NAME ) ; break ; case Wildcard . EXTENDS : output . append ( WILDCARD_NAME ) . append ( WILDCARD_EXTENDS ) ; this . bound . printExpression ( <NUM_LIT:0> , output ) ; break ; default : output . append ( WILDCARD_NAME ) . append ( WILDCARD_SUPER ) ; this . bound . printExpression ( <NUM_LIT:0> , output ) ; break ; } return output ; } public TypeBinding resolveType ( BlockScope scope , boolean checkBounds ) { if ( this . bound != null ) { this . bound . resolveType ( scope , checkBounds ) ; } return null ; } public TypeBinding resolveType ( ClassScope scope ) { if ( this . bound != null ) { this . bound . resolveType ( scope ) ; } return null ; } public TypeBinding resolveTypeArgument ( BlockScope blockScope , ReferenceBinding genericType , int rank ) { return internalResolveType ( blockScope , genericType , rank ) ; } public TypeBinding resolveTypeArgument ( ClassScope classScope , ReferenceBinding genericType , int rank ) { return internalResolveType ( classScope , genericType , rank ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . bound != null ) { this . bound . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . bound != null ) { this . bound . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class QualifiedSuperReference extends QualifiedThisReference { public QualifiedSuperReference ( TypeReference name , int pos , int sourceEnd ) { super ( name , pos , sourceEnd ) ; } public boolean isSuper ( ) { return true ; } public boolean isThis ( ) { return false ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return this . qualification . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; } public TypeBinding resolveType ( BlockScope scope ) { if ( ( this . bits & ParenthesizedMASK ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . invalidParenthesizedExpression ( this ) ; return null ; } super . resolveType ( scope ) ; if ( this . currentCompatibleType == null ) return null ; if ( this . currentCompatibleType . id == T_JavaLangObject ) { scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this ) ; return null ; } return this . resolvedType = this . currentCompatibleType . superclass ( ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . qualification . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } public void traverse ( ASTVisitor visitor , ClassScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . qualification . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class ArrayReference extends Reference { public Expression receiver ; public Expression position ; public ArrayReference ( Expression rec , Expression pos ) { this . receiver = rec ; this . position = pos ; this . sourceStart = rec . sourceStart ; } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean compoundAssignment ) { if ( assignment . expression == null ) { return analyseCode ( currentScope , flowContext , flowInfo ) ; } return assignment . expression . analyseCode ( currentScope , flowContext , analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . receiver . checkNPE ( currentScope , flowContext , flowInfo ) ; flowInfo = this . receiver . analyseCode ( currentScope , flowContext , flowInfo ) ; return this . position . analyseCode ( currentScope , flowContext , flowInfo ) ; } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { int pc = codeStream . position ; this . receiver . generateCode ( currentScope , codeStream , true ) ; if ( this . receiver instanceof CastExpression && ( ( CastExpression ) this . receiver ) . innermostCastedExpression ( ) . resolvedType == TypeBinding . NULL ) { codeStream . checkcast ( this . receiver . resolvedType ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; this . position . generateCode ( currentScope , codeStream , true ) ; assignment . expression . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( this . resolvedType . id , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; this . receiver . generateCode ( currentScope , codeStream , true ) ; if ( this . receiver instanceof CastExpression && ( ( CastExpression ) this . receiver ) . innermostCastedExpression ( ) . resolvedType == TypeBinding . NULL ) { codeStream . checkcast ( this . receiver . resolvedType ) ; } this . position . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAt ( this . resolvedType . id ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { boolean isUnboxing = ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ; if ( isUnboxing ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( isUnboxing ? postConversionType ( currentScope ) . id : this . resolvedType . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { this . receiver . generateCode ( currentScope , codeStream , true ) ; if ( this . receiver instanceof CastExpression && ( ( CastExpression ) this . receiver ) . innermostCastedExpression ( ) . resolvedType == TypeBinding . NULL ) { codeStream . checkcast ( this . receiver . resolvedType ) ; } this . position . generateCode ( currentScope , codeStream , true ) ; codeStream . dup2 ( ) ; codeStream . arrayAt ( this . resolvedType . id ) ; int operationTypeID ; switch ( operationTypeID = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_JavaLangString : case T_JavaLangObject : case T_undefined : codeStream . generateStringConcatenationAppend ( currentScope , null , expression ) ; break ; default : codeStream . generateImplicitConversion ( this . implicitConversion ) ; if ( expression == IntLiteral . One ) { codeStream . generateConstant ( expression . constant , this . implicitConversion ) ; } else { expression . generateCode ( currentScope , codeStream , true ) ; } codeStream . sendOperator ( operator , operationTypeID ) ; codeStream . generateImplicitConversion ( assignmentImplicitConversion ) ; } codeStream . arrayAtPut ( this . resolvedType . id , valueRequired ) ; } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { this . receiver . generateCode ( currentScope , codeStream , true ) ; if ( this . receiver instanceof CastExpression && ( ( CastExpression ) this . receiver ) . innermostCastedExpression ( ) . resolvedType == TypeBinding . NULL ) { codeStream . checkcast ( this . receiver . resolvedType ) ; } this . position . generateCode ( currentScope , codeStream , true ) ; codeStream . dup2 ( ) ; codeStream . arrayAt ( this . resolvedType . id ) ; if ( valueRequired ) { switch ( this . resolvedType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2_x2 ( ) ; break ; default : codeStream . dup_x2 ( ) ; break ; } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateConstant ( postIncrement . expression . constant , this . implicitConversion ) ; codeStream . sendOperator ( postIncrement . operator , this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . generateImplicitConversion ( postIncrement . preAssignImplicitConversion ) ; codeStream . arrayAtPut ( this . resolvedType . id , false ) ; } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . UNKNOWN ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { this . receiver . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:[>' ) ; return this . position . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:]>' ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( this . receiver instanceof CastExpression && ( ( CastExpression ) this . receiver ) . innermostCastedExpression ( ) instanceof NullLiteral ) { this . receiver . bits |= ASTNode . DisableUnnecessaryCastCheck ; } TypeBinding arrayType = this . receiver . resolveType ( scope ) ; if ( arrayType != null ) { this . receiver . computeConversion ( scope , arrayType , arrayType ) ; if ( arrayType . isArrayType ( ) ) { TypeBinding elementType = ( ( ArrayBinding ) arrayType ) . elementsType ( ) ; this . resolvedType = ( ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> ) ? elementType . capture ( scope , this . sourceEnd ) : elementType ; } else { scope . problemReporter ( ) . referenceMustBeArrayTypeAt ( arrayType , this ) ; } } TypeBinding positionType = this . position . resolveTypeExpecting ( scope , TypeBinding . INT ) ; if ( positionType != null ) { this . position . computeConversion ( scope , TypeBinding . INT , positionType ) ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . receiver . traverse ( visitor , scope ) ; this . position . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Util ; public class FieldDeclaration extends AbstractVariableDeclaration { public FieldBinding binding ; public Javadoc javadoc ; public int endPart1Position ; public int endPart2Position ; public FieldDeclaration ( ) { } public FieldDeclaration ( char [ ] name , int sourceStart , int sourceEnd ) { this . name = name ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseCode ( MethodScope initializationScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . binding != null && ! this . binding . isUsed ( ) && this . binding . isOrEnclosedByPrivateType ( ) ) { if ( ! initializationScope . referenceCompilationUnit ( ) . compilationResult . hasSyntaxError ) { initializationScope . problemReporter ( ) . unusedPrivateField ( this ) ; } } if ( this . binding != null && this . binding . isValidBinding ( ) && this . binding . isStatic ( ) && this . binding . constant ( ) == Constant . NotAConstant && this . binding . declaringClass . isNestedType ( ) && ! this . binding . declaringClass . isStatic ( ) ) { initializationScope . problemReporter ( ) . unexpectedStaticModifierForField ( ( SourceTypeBinding ) this . binding . declaringClass , this ) ; } if ( this . initialization != null ) { flowInfo = this . initialization . analyseCode ( initializationScope , flowContext , flowInfo ) . unconditionalInits ( ) ; flowInfo . markAsDefinitelyAssigned ( this . binding ) ; } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; boolean isStatic ; if ( this . initialization != null && ! ( ( isStatic = this . binding . isStatic ( ) ) && this . binding . constant ( ) != Constant . NotAConstant ) ) { if ( ! isStatic ) codeStream . aload_0 ( ) ; this . initialization . generateCode ( currentScope , codeStream , true ) ; if ( isStatic ) { codeStream . fieldAccess ( Opcodes . OPC_putstatic , this . binding , null ) ; } else { codeStream . fieldAccess ( Opcodes . OPC_putfield , this . binding , null ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public int getKind ( ) { return this . type == null ? ENUM_CONSTANT : FIELD ; } public boolean isStatic ( ) { if ( this . binding != null ) return this . binding . isStatic ( ) ; return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public boolean isFinal ( ) { if ( this . binding != null ) return this . binding . isFinal ( ) ; return ( this . modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { if ( this . javadoc != null ) { this . javadoc . print ( indent , output ) ; } return super . printStatement ( indent , output ) ; } public void resolve ( MethodScope initializationScope ) { if ( ( this . bits & ASTNode . HasBeenResolved ) != <NUM_LIT:0> ) return ; if ( this . binding == null || ! this . binding . isValidBinding ( ) ) return ; this . bits |= ASTNode . HasBeenResolved ; ClassScope classScope = initializationScope . enclosingClassScope ( ) ; if ( classScope != null ) { checkHiding : { SourceTypeBinding declaringType = classScope . enclosingSourceType ( ) ; checkHidingSuperField : { if ( declaringType . superclass == null ) break checkHidingSuperField ; FieldBinding existingVariable = classScope . findField ( declaringType . superclass , this . name , this , false , true ) ; if ( existingVariable == null ) break checkHidingSuperField ; if ( ! existingVariable . isValidBinding ( ) ) break checkHidingSuperField ; if ( existingVariable . original ( ) == this . binding ) break checkHidingSuperField ; if ( ! existingVariable . canBeSeenBy ( declaringType , this , initializationScope ) ) break checkHidingSuperField ; initializationScope . problemReporter ( ) . fieldHiding ( this , existingVariable ) ; break checkHiding ; } Scope outerScope = classScope . parent ; if ( outerScope . kind == Scope . COMPILATION_UNIT_SCOPE ) break checkHiding ; Binding existingVariable = outerScope . getBinding ( this . name , Binding . VARIABLE , this , false ) ; if ( existingVariable == null ) break checkHiding ; if ( ! existingVariable . isValidBinding ( ) ) break checkHiding ; if ( existingVariable == this . binding ) break checkHiding ; if ( existingVariable instanceof FieldBinding ) { FieldBinding existingField = ( FieldBinding ) existingVariable ; if ( existingField . original ( ) == this . binding ) break checkHiding ; if ( ! existingField . isStatic ( ) && declaringType . isStatic ( ) ) break checkHiding ; } initializationScope . problemReporter ( ) . fieldHiding ( this , existingVariable ) ; } } if ( this . type != null ) { this . type . resolvedType = this . binding . type ; } FieldBinding previousField = initializationScope . initializedField ; int previousFieldID = initializationScope . lastVisibleFieldID ; try { initializationScope . initializedField = this . binding ; initializationScope . lastVisibleFieldID = this . binding . id ; resolveAnnotations ( initializationScope , this . annotations , this . binding ) ; if ( ( this . binding . getAnnotationTagBits ( ) & TagBits . AnnotationDeprecated ) == <NUM_LIT:0> && ( this . binding . modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> && initializationScope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { initializationScope . problemReporter ( ) . missingDeprecatedAnnotationForField ( this ) ; } if ( this . initialization == null ) { this . binding . setConstant ( Constant . NotAConstant ) ; } else { this . binding . setConstant ( Constant . NotAConstant ) ; TypeBinding fieldType = this . binding . type ; TypeBinding initializationType ; this . initialization . setExpectedType ( fieldType ) ; if ( this . initialization instanceof ArrayInitializer ) { if ( ( initializationType = this . initialization . resolveTypeExpecting ( initializationScope , fieldType ) ) != null ) { ( ( ArrayInitializer ) this . initialization ) . binding = ( ArrayBinding ) initializationType ; this . initialization . computeConversion ( initializationScope , fieldType , initializationType ) ; } } else if ( ( initializationType = this . initialization . resolveType ( initializationScope ) ) != null ) { if ( fieldType != initializationType ) initializationScope . compilationUnitScope ( ) . recordTypeConversion ( fieldType , initializationType ) ; if ( this . initialization . isConstantValueOfTypeAssignableToType ( initializationType , fieldType ) || initializationType . isCompatibleWith ( fieldType ) ) { this . initialization . computeConversion ( initializationScope , fieldType , initializationType ) ; if ( initializationType . needsUncheckedConversion ( fieldType ) ) { initializationScope . problemReporter ( ) . unsafeTypeConversion ( this . initialization , initializationType , fieldType ) ; } if ( this . initialization instanceof CastExpression && ( this . initialization . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> ) { CastExpression . checkNeedForAssignedCast ( initializationScope , fieldType , ( CastExpression ) this . initialization ) ; } } else if ( isBoxingCompatible ( initializationType , fieldType , this . initialization , initializationScope ) ) { this . initialization . computeConversion ( initializationScope , fieldType , initializationType ) ; if ( this . initialization instanceof CastExpression && ( this . initialization . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> ) { CastExpression . checkNeedForAssignedCast ( initializationScope , fieldType , ( CastExpression ) this . initialization ) ; } } else { if ( ( fieldType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { initializationScope . problemReporter ( ) . typeMismatchError ( initializationType , fieldType , this . initialization , null ) ; } } if ( this . binding . isFinal ( ) ) { this . binding . setConstant ( this . initialization . constant . castTo ( ( this . binding . type . id << <NUM_LIT:4> ) + this . initialization . constant . typeID ( ) ) ) ; } } else { this . binding . setConstant ( Constant . NotAConstant ) ; } if ( this . binding == Expression . getDirectBinding ( this . initialization ) ) { initializationScope . problemReporter ( ) . assignmentHasNoEffect ( this , this . name ) ; } } if ( this . javadoc != null ) { this . javadoc . resolve ( initializationScope ) ; } else if ( this . binding != null && this . binding . declaringClass != null && ! this . binding . declaringClass . isLocalType ( ) ) { int javadocVisibility = this . binding . modifiers & ExtraCompilerModifiers . AccVisibilityMASK ; ProblemReporter reporter = initializationScope . problemReporter ( ) ; int severity = reporter . computeSeverity ( IProblem . JavadocMissing ) ; if ( severity != ProblemSeverities . Ignore ) { if ( classScope != null ) { javadocVisibility = Util . computeOuterMostVisibility ( classScope . referenceType ( ) , javadocVisibility ) ; } int javadocModifiers = ( this . binding . modifiers & ~ ExtraCompilerModifiers . AccVisibilityMASK ) | javadocVisibility ; reporter . javadocMissing ( this . sourceStart , this . sourceEnd , severity , javadocModifiers ) ; } } } finally { initializationScope . initializedField = previousField ; initializationScope . lastVisibleFieldID = previousFieldID ; if ( this . binding . constant ( ) == null ) this . binding . setConstant ( Constant . NotAConstant ) ; } } public void traverse ( ASTVisitor visitor , MethodScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . javadoc != null ) { this . javadoc . traverse ( visitor , scope ) ; } if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , scope ) ; } if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . initialization != null ) this . initialization . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ClassLiteralAccess extends Expression { public TypeReference type ; public TypeBinding targetType ; FieldBinding syntheticField ; public ClassLiteralAccess ( int sourceEnd , TypeReference type ) { this . type = type ; type . bits |= IgnoreRawTypeCheck ; this . sourceStart = type . sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { SourceTypeBinding sourceType = currentScope . outerMostClassScope ( ) . enclosingSourceType ( ) ; if ( ! sourceType . isInterface ( ) && ! this . targetType . isBaseType ( ) && currentScope . compilerOptions ( ) . targetJDK < ClassFileConstants . JDK1_5 ) { this . syntheticField = sourceType . addSyntheticFieldForClassLiteral ( this . targetType , currentScope ) ; } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateClassLiteralAccessForType ( this . type . resolvedType , this . syntheticField ) ; codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return this . type . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT:.class>" ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( ( this . targetType = this . type . resolveType ( scope , true ) ) == null ) return null ; this . targetType = scope . environment ( ) . convertToRawType ( this . targetType , true ) ; if ( this . targetType . isArrayType ( ) ) { ArrayBinding arrayBinding = ( ArrayBinding ) this . targetType ; TypeBinding leafComponentType = arrayBinding . leafComponentType ; if ( leafComponentType == TypeBinding . VOID ) { scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; return null ; } else if ( leafComponentType . isTypeVariable ( ) ) { scope . problemReporter ( ) . illegalClassLiteralForTypeVariable ( ( TypeVariableBinding ) leafComponentType , this ) ; } } else if ( this . targetType . isTypeVariable ( ) ) { scope . problemReporter ( ) . illegalClassLiteralForTypeVariable ( ( TypeVariableBinding ) this . targetType , this ) ; } ReferenceBinding classType = scope . getJavaLangClass ( ) ; if ( scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { TypeBinding boxedType = null ; if ( this . targetType . id == T_void ) { boxedType = scope . environment ( ) . getResolvedType ( JAVA_LANG_VOID , scope ) ; } else { boxedType = scope . boxing ( this . targetType ) ; } this . resolvedType = scope . environment ( ) . createParameterizedType ( classType , new TypeBinding [ ] { boxedType } , null ) ; } else { this . resolvedType = classType ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . type . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; public abstract class MagicLiteral extends Literal { public MagicLiteral ( int start , int end ) { super ( start , end ) ; } public boolean isValidJavaStatement ( ) { return false ; } public char [ ] source ( ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ReturnStatement extends Statement { public Expression expression ; public SubRoutineStatement [ ] subroutines ; public LocalVariableBinding saveValueVariable ; public int initStateIndex = - <NUM_LIT:1> ; public ReturnStatement ( Expression expression , int sourceStart , int sourceEnd ) { this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; this . expression = expression ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { MethodScope methodScope = currentScope . methodScope ( ) ; if ( this . expression != null ) { flowInfo = this . expression . analyseCode ( currentScope , flowContext , flowInfo ) ; if ( ( this . expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . expression . checkNPE ( currentScope , flowContext , flowInfo ) ; } if ( flowInfo . reachMode ( ) == FlowInfo . REACHABLE ) checkAgainstNullAnnotation ( currentScope , flowContext , this . expression . nullStatus ( flowInfo ) ) ; if ( currentScope . compilerOptions ( ) . analyseResourceLeaks ) { FakedTrackingVariable trackingVariable = FakedTrackingVariable . getCloseTrackingVariable ( this . expression ) ; if ( trackingVariable != null ) { if ( methodScope != trackingVariable . methodScope ) trackingVariable . markClosedInNestedMethod ( ) ; flowInfo = FakedTrackingVariable . markPassedToOutside ( currentScope , this . expression , flowInfo , true ) ; } } } this . initStateIndex = methodScope . recordInitializationStates ( flowInfo ) ; FlowContext traversedContext = flowContext ; int subCount = <NUM_LIT:0> ; boolean saveValueNeeded = false ; boolean hasValueToSave = needValueStore ( ) ; boolean noAutoCloseables = true ; do { SubRoutineStatement sub ; if ( ( sub = traversedContext . subroutine ( ) ) != null ) { if ( this . subroutines == null ) { this . subroutines = new SubRoutineStatement [ <NUM_LIT:5> ] ; } if ( subCount == this . subroutines . length ) { System . arraycopy ( this . subroutines , <NUM_LIT:0> , ( this . subroutines = new SubRoutineStatement [ subCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , subCount ) ; } this . subroutines [ subCount ++ ] = sub ; if ( sub . isSubRoutineEscaping ( ) ) { saveValueNeeded = false ; this . bits |= ASTNode . IsAnySubRoutineEscaping ; break ; } if ( sub instanceof TryStatement ) { if ( ( ( TryStatement ) sub ) . resources . length > <NUM_LIT:0> ) { noAutoCloseables = false ; } } } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; if ( traversedContext instanceof InsideSubRoutineFlowContext ) { ASTNode node = traversedContext . associatedNode ; if ( node instanceof SynchronizedStatement ) { this . bits |= ASTNode . IsSynchronized ; } else if ( node instanceof TryStatement ) { TryStatement tryStatement = ( TryStatement ) node ; flowInfo . addInitializationsFrom ( tryStatement . subRoutineInits ) ; if ( hasValueToSave ) { if ( this . saveValueVariable == null ) { prepareSaveValueLocation ( tryStatement ) ; } saveValueNeeded = true ; this . initStateIndex = methodScope . recordInitializationStates ( flowInfo ) ; } } } else if ( traversedContext instanceof InitializationFlowContext ) { currentScope . problemReporter ( ) . cannotReturnInInitializer ( this ) ; return FlowInfo . DEAD_END ; } } while ( ( traversedContext = traversedContext . getLocalParent ( ) ) != null ) ; if ( ( this . subroutines != null ) && ( subCount != this . subroutines . length ) ) { System . arraycopy ( this . subroutines , <NUM_LIT:0> , ( this . subroutines = new SubRoutineStatement [ subCount ] ) , <NUM_LIT:0> , subCount ) ; } if ( saveValueNeeded ) { if ( this . saveValueVariable != null ) { this . saveValueVariable . useFlag = LocalVariableBinding . USED ; } } else { this . saveValueVariable = null ; if ( ( ( this . bits & ASTNode . IsSynchronized ) == <NUM_LIT:0> ) && this . expression != null && this . expression . resolvedType == TypeBinding . BOOLEAN ) { if ( noAutoCloseables ) { this . expression . bits |= ASTNode . IsReturnedValue ; } } } currentScope . checkUnclosedCloseables ( flowInfo , flowContext , this , currentScope ) ; return FlowInfo . DEAD_END ; } void checkAgainstNullAnnotation ( BlockScope scope , FlowContext flowContext , int nullStatus ) { if ( nullStatus != FlowInfo . NON_NULL ) { long tagBits ; MethodBinding methodBinding ; try { methodBinding = scope . methodScope ( ) . referenceMethod ( ) . binding ; tagBits = methodBinding . tagBits ; } catch ( NullPointerException npe ) { return ; } if ( ( tagBits & TagBits . AnnotationNonNull ) != <NUM_LIT:0> ) { flowContext . recordNullityMismatch ( scope , this . expression , this . expression . resolvedType , methodBinding . returnType , nullStatus ) ; } } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; boolean alreadyGeneratedExpression = false ; if ( needValueStore ( ) ) { alreadyGeneratedExpression = true ; this . expression . generateCode ( currentScope , codeStream , needValue ( ) ) ; generateStoreSaveValueIfNecessary ( codeStream ) ; } if ( this . subroutines != null ) { Object reusableJSRTarget = this . expression == null ? ( Object ) TypeBinding . VOID : this . expression . reusableJSRTarget ( ) ; for ( int i = <NUM_LIT:0> , max = this . subroutines . length ; i < max ; i ++ ) { SubRoutineStatement sub = this . subroutines [ i ] ; boolean didEscape = sub . generateSubRoutineInvocation ( currentScope , codeStream , reusableJSRTarget , this . initStateIndex , this . saveValueVariable ) ; if ( didEscape ) { codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; SubRoutineStatement . reenterAllExceptionHandlers ( this . subroutines , i , codeStream ) ; return ; } } } if ( this . saveValueVariable != null ) { codeStream . load ( this . saveValueVariable ) ; } if ( this . expression != null && ! alreadyGeneratedExpression ) { this . expression . generateCode ( currentScope , codeStream , true ) ; generateStoreSaveValueIfNecessary ( codeStream ) ; } generateReturnBytecode ( codeStream ) ; if ( this . saveValueVariable != null ) { codeStream . removeVariable ( this . saveValueVariable ) ; } if ( this . initStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . initStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . initStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; SubRoutineStatement . reenterAllExceptionHandlers ( this . subroutines , - <NUM_LIT:1> , codeStream ) ; } public void generateReturnBytecode ( CodeStream codeStream ) { codeStream . generateReturnBytecode ( this . expression ) ; } public void generateStoreSaveValueIfNecessary ( CodeStream codeStream ) { if ( this . saveValueVariable != null ) { codeStream . store ( this . saveValueVariable , false ) ; codeStream . addVariable ( this . saveValueVariable ) ; } } private boolean needValueStore ( ) { return this . expression != null && ( this . expression . constant == Constant . NotAConstant || ( this . expression . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) && ! ( this . expression instanceof NullLiteral ) ; } public boolean needValue ( ) { return this . saveValueVariable != null || ( this . bits & ASTNode . IsSynchronized ) != <NUM_LIT:0> || ( ( this . bits & ASTNode . IsAnySubRoutineEscaping ) == <NUM_LIT:0> ) ; } public void prepareSaveValueLocation ( TryStatement targetTryStatement ) { this . saveValueVariable = targetTryStatement . secretReturnValue ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( "<STR_LIT>" ) ; if ( this . expression != null ) this . expression . printExpression ( <NUM_LIT:0> , output ) ; return output . append ( '<CHAR_LIT:;>' ) ; } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; MethodBinding methodBinding ; TypeBinding methodType = ( methodScope . referenceContext instanceof AbstractMethodDeclaration ) ? ( ( methodBinding = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ) == null ? null : methodBinding . returnType ) : TypeBinding . VOID ; TypeBinding expressionType ; if ( methodType == TypeBinding . VOID ) { if ( this . expression == null ) return ; if ( ( expressionType = this . expression . resolveType ( scope ) ) != null ) scope . problemReporter ( ) . attemptToReturnNonVoidExpression ( this , expressionType ) ; return ; } if ( this . expression == null ) { if ( methodType != null ) scope . problemReporter ( ) . shouldReturn ( methodType , this ) ; return ; } this . expression . setExpectedType ( methodType ) ; if ( ( expressionType = this . expression . resolveType ( scope ) ) == null ) return ; if ( expressionType == TypeBinding . VOID ) { scope . problemReporter ( ) . attemptToReturnVoidValue ( this ) ; return ; } if ( methodType == null ) return ; if ( methodType != expressionType ) scope . compilationUnitScope ( ) . recordTypeConversion ( methodType , expressionType ) ; if ( this . expression . isConstantValueOfTypeAssignableToType ( expressionType , methodType ) || expressionType . isCompatibleWith ( methodType ) ) { this . expression . computeConversion ( scope , methodType , expressionType ) ; if ( expressionType . needsUncheckedConversion ( methodType ) ) { scope . problemReporter ( ) . unsafeTypeConversion ( this . expression , expressionType , methodType ) ; } if ( this . expression instanceof CastExpression && ( this . expression . bits & ( ASTNode . UnnecessaryCast | ASTNode . DisableUnnecessaryCastCheck ) ) == <NUM_LIT:0> ) { CastExpression . checkNeedForAssignedCast ( scope , methodType , ( CastExpression ) this . expression ) ; } return ; } else if ( isBoxingCompatible ( expressionType , methodType , this . expression , scope ) ) { this . expression . computeConversion ( scope , methodType , expressionType ) ; if ( this . expression instanceof CastExpression && ( this . expression . bits & ( ASTNode . UnnecessaryCast | ASTNode . DisableUnnecessaryCastCheck ) ) == <NUM_LIT:0> ) { CastExpression . checkNeedForAssignedCast ( scope , methodType , ( CastExpression ) this . expression ) ; } return ; } if ( ( methodType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . typeMismatchError ( expressionType , methodType , this . expression , null ) ; } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . expression != null ) this . expression . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; 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 . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class SuperReference extends ThisReference { public SuperReference ( int sourceStart , int sourceEnd ) { super ( sourceStart , sourceEnd ) ; } public static ExplicitConstructorCall implicitSuperConstructorCall ( ) { return new ExplicitConstructorCall ( ExplicitConstructorCall . ImplicitSuper ) ; } public boolean isImplicitThis ( ) { return false ; } public boolean isSuper ( ) { return true ; } public boolean isThis ( ) { return false ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return output . append ( "<STR_LIT>" ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( ! checkAccess ( scope . methodScope ( ) ) ) return null ; ReferenceBinding enclosingReceiverType = scope . enclosingReceiverType ( ) ; if ( enclosingReceiverType . id == T_JavaLangObject ) { scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this ) ; return null ; } return this . resolvedType = enclosingReceiverType . superclass ( ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { visitor . visit ( this , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { currentScope . resetEnclosingMethodStaticFlag ( ) ; return analyseCode ( currentScope , flowContext , flowInfo ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . IrritantSet ; import org . eclipse . jdt . internal . compiler . lookup . * ; public abstract class Annotation extends Expression { final static MemberValuePair [ ] NoValuePairs = new MemberValuePair [ <NUM_LIT:0> ] ; private static final long TAGBITS_NULLABLE_OR_NONNULL = TagBits . AnnotationNullable | TagBits . AnnotationNonNull ; public int declarationSourceEnd ; public Binding recipient ; public TypeReference type ; private AnnotationBinding compilerAnnotation = null ; public static long getRetentionPolicy ( char [ ] policyName ) { if ( policyName == null || policyName . length == <NUM_LIT:0> ) return <NUM_LIT:0> ; switch ( policyName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( policyName , TypeConstants . UPPER_CLASS ) ) return TagBits . AnnotationClassRetention ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( policyName , TypeConstants . UPPER_SOURCE ) ) return TagBits . AnnotationSourceRetention ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( policyName , TypeConstants . UPPER_RUNTIME ) ) return TagBits . AnnotationRuntimeRetention ; break ; } return <NUM_LIT:0> ; } public static long getTargetElementType ( char [ ] elementName ) { if ( elementName == null || elementName . length == <NUM_LIT:0> ) return <NUM_LIT:0> ; switch ( elementName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:A>' : if ( CharOperation . equals ( elementName , TypeConstants . UPPER_ANNOTATION_TYPE ) ) return TagBits . AnnotationForAnnotationType ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( elementName , TypeConstants . UPPER_CONSTRUCTOR ) ) return TagBits . AnnotationForConstructor ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( elementName , TypeConstants . UPPER_FIELD ) ) return TagBits . AnnotationForField ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( elementName , TypeConstants . UPPER_LOCAL_VARIABLE ) ) return TagBits . AnnotationForLocalVariable ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( elementName , TypeConstants . UPPER_METHOD ) ) return TagBits . AnnotationForMethod ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( elementName , TypeConstants . UPPER_PARAMETER ) ) return TagBits . AnnotationForParameter ; else if ( CharOperation . equals ( elementName , TypeConstants . UPPER_PACKAGE ) ) return TagBits . AnnotationForPackage ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( elementName , TypeConstants . TYPE ) ) return TagBits . AnnotationForType ; break ; } return <NUM_LIT:0> ; } public ElementValuePair [ ] computeElementValuePairs ( ) { return Binding . NO_ELEMENT_VALUE_PAIRS ; } private long detectStandardAnnotation ( Scope scope , ReferenceBinding annotationType , MemberValuePair valueAttribute ) { long tagBits = <NUM_LIT:0> ; switch ( annotationType . id ) { case TypeIds . T_JavaLangAnnotationRetention : if ( valueAttribute != null ) { Expression expr = valueAttribute . value ; if ( ( expr . bits & Binding . VARIABLE ) == Binding . FIELD ) { FieldBinding field = ( ( Reference ) expr ) . fieldBinding ( ) ; if ( field != null && field . declaringClass . id == T_JavaLangAnnotationRetentionPolicy ) { tagBits |= getRetentionPolicy ( field . name ) ; } } } break ; case TypeIds . T_JavaLangAnnotationTarget : tagBits |= TagBits . AnnotationTarget ; if ( valueAttribute != null ) { Expression expr = valueAttribute . value ; if ( expr instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) expr ; final Expression [ ] expressions = initializer . expressions ; if ( expressions != null ) { for ( int i = <NUM_LIT:0> , length = expressions . length ; i < length ; i ++ ) { Expression initExpr = expressions [ i ] ; if ( ( initExpr . bits & Binding . VARIABLE ) == Binding . FIELD ) { FieldBinding field = ( ( Reference ) initExpr ) . fieldBinding ( ) ; if ( field != null && field . declaringClass . id == T_JavaLangAnnotationElementType ) { long element = getTargetElementType ( field . name ) ; if ( ( tagBits & element ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . duplicateTargetInTargetAnnotation ( annotationType , ( NameReference ) initExpr ) ; } else { tagBits |= element ; } } } } } } else if ( ( expr . bits & Binding . VARIABLE ) == Binding . FIELD ) { FieldBinding field = ( ( Reference ) expr ) . fieldBinding ( ) ; if ( field != null && field . declaringClass . id == T_JavaLangAnnotationElementType ) { tagBits |= getTargetElementType ( field . name ) ; } } } break ; case TypeIds . T_JavaLangDeprecated : tagBits |= TagBits . AnnotationDeprecated ; break ; case TypeIds . T_JavaLangAnnotationDocumented : tagBits |= TagBits . AnnotationDocumented ; break ; case TypeIds . T_JavaLangAnnotationInherited : tagBits |= TagBits . AnnotationInherited ; break ; case TypeIds . T_JavaLangOverride : tagBits |= TagBits . AnnotationOverride ; break ; case TypeIds . T_JavaLangSuppressWarnings : tagBits |= TagBits . AnnotationSuppressWarnings ; break ; case TypeIds . T_JavaLangSafeVarargs : tagBits |= TagBits . AnnotationSafeVarargs ; break ; case TypeIds . T_JavaLangInvokeMethodHandlePolymorphicSignature : tagBits |= TagBits . AnnotationPolymorphicSignature ; break ; case TypeIds . T_ConfiguredAnnotationNullable : tagBits |= TagBits . AnnotationNullable ; break ; case TypeIds . T_ConfiguredAnnotationNonNull : tagBits |= TagBits . AnnotationNonNull ; break ; case TypeIds . T_ConfiguredAnnotationNonNullByDefault : if ( valueAttribute != null && valueAttribute . value instanceof FalseLiteral ) { tagBits |= TagBits . AnnotationNullUnspecifiedByDefault ; break ; } tagBits |= TagBits . AnnotationNonNullByDefault ; break ; } return tagBits ; } public AnnotationBinding getCompilerAnnotation ( ) { return this . compilerAnnotation ; } public boolean isRuntimeInvisible ( ) { final TypeBinding annotationBinding = this . resolvedType ; if ( annotationBinding == null ) { return false ; } long metaTagBits = annotationBinding . getAnnotationTagBits ( ) ; if ( ( metaTagBits & TagBits . AnnotationRetentionMASK ) == <NUM_LIT:0> ) return true ; return ( metaTagBits & TagBits . AnnotationRetentionMASK ) == TagBits . AnnotationClassRetention ; } public boolean isRuntimeVisible ( ) { final TypeBinding annotationBinding = this . resolvedType ; if ( annotationBinding == null ) { return false ; } long metaTagBits = annotationBinding . getAnnotationTagBits ( ) ; if ( ( metaTagBits & TagBits . AnnotationRetentionMASK ) == <NUM_LIT:0> ) return false ; return ( metaTagBits & TagBits . AnnotationRetentionMASK ) == TagBits . AnnotationRuntimeRetention ; } public abstract MemberValuePair [ ] memberValuePairs ( ) ; public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( '<CHAR_LIT>' ) ; this . type . printExpression ( <NUM_LIT:0> , output ) ; return output ; } public void recordSuppressWarnings ( Scope scope , int startSuppresss , int endSuppress , boolean isSuppressingWarnings ) { IrritantSet suppressWarningIrritants = null ; MemberValuePair [ ] pairs = memberValuePairs ( ) ; pairLoop : for ( int i = <NUM_LIT:0> , length = pairs . length ; i < length ; i ++ ) { MemberValuePair pair = pairs [ i ] ; if ( CharOperation . equals ( pair . name , TypeConstants . VALUE ) ) { Expression value = pair . value ; if ( value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) value ; Expression [ ] inits = initializer . expressions ; if ( inits != null ) { for ( int j = <NUM_LIT:0> , initsLength = inits . length ; j < initsLength ; j ++ ) { Constant cst = inits [ j ] . constant ; if ( cst != Constant . NotAConstant && cst . typeID ( ) == T_JavaLangString ) { IrritantSet irritants = CompilerOptions . warningTokenToIrritants ( cst . stringValue ( ) ) ; if ( irritants != null ) { if ( suppressWarningIrritants == null ) { suppressWarningIrritants = new IrritantSet ( irritants ) ; } else if ( suppressWarningIrritants . set ( irritants ) == null ) { scope . problemReporter ( ) . unusedWarningToken ( inits [ j ] ) ; } } else { scope . problemReporter ( ) . unhandledWarningToken ( inits [ j ] ) ; } } } } } else { Constant cst = value . constant ; if ( cst != Constant . NotAConstant && cst . typeID ( ) == T_JavaLangString ) { IrritantSet irritants = CompilerOptions . warningTokenToIrritants ( cst . stringValue ( ) ) ; if ( irritants != null ) { suppressWarningIrritants = new IrritantSet ( irritants ) ; } else { scope . problemReporter ( ) . unhandledWarningToken ( value ) ; } } } break pairLoop ; } } if ( isSuppressingWarnings && suppressWarningIrritants != null ) { scope . referenceCompilationUnit ( ) . recordSuppressWarnings ( suppressWarningIrritants , this , startSuppresss , endSuppress ) ; } } public TypeBinding resolveType ( BlockScope scope ) { if ( this . compilerAnnotation != null ) return this . resolvedType ; this . constant = Constant . NotAConstant ; TypeBinding typeBinding = this . type . resolveType ( scope ) ; if ( typeBinding == null ) { return null ; } this . resolvedType = typeBinding ; if ( ! typeBinding . isAnnotationType ( ) && typeBinding . isValidBinding ( ) ) { scope . problemReporter ( ) . typeMismatchError ( typeBinding , scope . getJavaLangAnnotationAnnotation ( ) , this . type , null ) ; return null ; } ReferenceBinding annotationType = ( ReferenceBinding ) this . resolvedType ; MethodBinding [ ] methods = annotationType . methods ( ) ; MemberValuePair [ ] originalValuePairs = memberValuePairs ( ) ; MemberValuePair valueAttribute = null ; MemberValuePair [ ] pairs ; int pairsLength = originalValuePairs . length ; if ( pairsLength > <NUM_LIT:0> ) { System . arraycopy ( originalValuePairs , <NUM_LIT:0> , pairs = new MemberValuePair [ pairsLength ] , <NUM_LIT:0> , pairsLength ) ; } else { pairs = originalValuePairs ; } nextMember : for ( int i = <NUM_LIT:0> , requiredLength = methods . length ; i < requiredLength ; i ++ ) { MethodBinding method = methods [ i ] ; char [ ] selector = method . selector ; boolean foundValue = false ; nextPair : for ( int j = <NUM_LIT:0> ; j < pairsLength ; j ++ ) { MemberValuePair pair = pairs [ j ] ; if ( pair == null ) continue nextPair ; char [ ] name = pair . name ; if ( CharOperation . equals ( name , selector ) ) { if ( valueAttribute == null && CharOperation . equals ( name , TypeConstants . VALUE ) ) { valueAttribute = pair ; } pair . binding = method ; pair . resolveTypeExpecting ( scope , method . returnType ) ; pairs [ j ] = null ; foundValue = true ; boolean foundDuplicate = false ; for ( int k = j + <NUM_LIT:1> ; k < pairsLength ; k ++ ) { MemberValuePair otherPair = pairs [ k ] ; if ( otherPair == null ) continue ; if ( CharOperation . equals ( otherPair . name , selector ) ) { foundDuplicate = true ; scope . problemReporter ( ) . duplicateAnnotationValue ( annotationType , otherPair ) ; otherPair . binding = method ; otherPair . resolveTypeExpecting ( scope , method . returnType ) ; pairs [ k ] = null ; } } if ( foundDuplicate ) { scope . problemReporter ( ) . duplicateAnnotationValue ( annotationType , pair ) ; continue nextMember ; } } } if ( ! foundValue && ( method . modifiers & ClassFileConstants . AccAnnotationDefault ) == <NUM_LIT:0> && ( this . bits & IsRecovered ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . missingValueForAnnotationMember ( this , selector ) ; } } for ( int i = <NUM_LIT:0> ; i < pairsLength ; i ++ ) { if ( pairs [ i ] != null ) { scope . problemReporter ( ) . undefinedAnnotationValue ( annotationType , pairs [ i ] ) ; pairs [ i ] . resolveTypeExpecting ( scope , null ) ; } } this . compilerAnnotation = scope . environment ( ) . createAnnotation ( ( ReferenceBinding ) this . resolvedType , computeElementValuePairs ( ) ) ; long tagBits = detectStandardAnnotation ( scope , annotationType , valueAttribute ) ; scope . referenceCompilationUnit ( ) . recordSuppressWarnings ( IrritantSet . NLS , null , this . sourceStart , this . declarationSourceEnd ) ; if ( this . recipient != null ) { if ( tagBits != <NUM_LIT:0> ) { switch ( this . recipient . kind ( ) ) { case Binding . PACKAGE : ( ( PackageBinding ) this . recipient ) . tagBits |= tagBits ; break ; case Binding . TYPE : case Binding . GENERIC_TYPE : SourceTypeBinding sourceType = ( SourceTypeBinding ) this . recipient ; sourceType . tagBits |= tagBits ; if ( ( tagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) { TypeDeclaration typeDeclaration = sourceType . scope . referenceContext ; int start ; if ( scope . referenceCompilationUnit ( ) . types [ <NUM_LIT:0> ] == typeDeclaration ) { start = <NUM_LIT:0> ; } else { start = typeDeclaration . declarationSourceStart ; } recordSuppressWarnings ( scope , start , typeDeclaration . declarationSourceEnd , scope . compilerOptions ( ) . suppressWarnings ) ; } break ; case Binding . METHOD : MethodBinding sourceMethod = ( MethodBinding ) this . recipient ; sourceMethod . tagBits |= tagBits ; if ( ( tagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) { sourceType = ( SourceTypeBinding ) sourceMethod . declaringClass ; AbstractMethodDeclaration methodDeclaration = sourceType . scope . referenceContext . declarationOf ( sourceMethod ) ; recordSuppressWarnings ( scope , methodDeclaration . declarationSourceStart , methodDeclaration . declarationSourceEnd , scope . compilerOptions ( ) . suppressWarnings ) ; } if ( ( sourceMethod . tagBits & TAGBITS_NULLABLE_OR_NONNULL ) == TAGBITS_NULLABLE_OR_NONNULL ) { scope . problemReporter ( ) . contradictoryNullAnnotations ( this ) ; sourceMethod . tagBits &= ~ TAGBITS_NULLABLE_OR_NONNULL ; } break ; case Binding . FIELD : FieldBinding sourceField = ( FieldBinding ) this . recipient ; sourceField . tagBits |= tagBits ; if ( ( tagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) { sourceType = ( SourceTypeBinding ) sourceField . declaringClass ; FieldDeclaration fieldDeclaration = sourceType . scope . referenceContext . declarationOf ( sourceField ) ; recordSuppressWarnings ( scope , fieldDeclaration . declarationSourceStart , fieldDeclaration . declarationSourceEnd , scope . compilerOptions ( ) . suppressWarnings ) ; } break ; case Binding . LOCAL : LocalVariableBinding variable = ( LocalVariableBinding ) this . recipient ; variable . tagBits |= tagBits ; if ( ( tagBits & TagBits . AnnotationSuppressWarnings ) != <NUM_LIT:0> ) { LocalDeclaration localDeclaration = variable . declaration ; recordSuppressWarnings ( scope , localDeclaration . declarationSourceStart , localDeclaration . declarationSourceEnd , scope . compilerOptions ( ) . suppressWarnings ) ; } if ( ( variable . tagBits & TAGBITS_NULLABLE_OR_NONNULL ) == TAGBITS_NULLABLE_OR_NONNULL ) { scope . problemReporter ( ) . contradictoryNullAnnotations ( this ) ; variable . tagBits &= ~ TAGBITS_NULLABLE_OR_NONNULL ; } break ; } } if ( scope . compilationUnitScope ( ) . checkTargetCompatibility ( ) ) { checkTargetCompatibility : { long metaTagBits = annotationType . getAnnotationTagBits ( ) ; if ( ( metaTagBits & TagBits . AnnotationTargetMASK ) == <NUM_LIT:0> ) break checkTargetCompatibility ; switch ( this . recipient . kind ( ) ) { case Binding . PACKAGE : if ( ( metaTagBits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) break checkTargetCompatibility ; break ; case Binding . TYPE : case Binding . GENERIC_TYPE : if ( ( ( ReferenceBinding ) this . recipient ) . isAnnotationType ( ) ) { if ( ( metaTagBits & ( TagBits . AnnotationForAnnotationType | TagBits . AnnotationForType ) ) != <NUM_LIT:0> ) break checkTargetCompatibility ; } else if ( ( metaTagBits & TagBits . AnnotationForType ) != <NUM_LIT:0> ) { break checkTargetCompatibility ; } else if ( ( metaTagBits & TagBits . AnnotationForPackage ) != <NUM_LIT:0> ) { if ( CharOperation . equals ( ( ( ReferenceBinding ) this . recipient ) . sourceName , TypeConstants . PACKAGE_INFO_NAME ) ) break checkTargetCompatibility ; } break ; case Binding . METHOD : if ( ( ( MethodBinding ) this . recipient ) . isConstructor ( ) ) { if ( ( metaTagBits & TagBits . AnnotationForConstructor ) != <NUM_LIT:0> ) break checkTargetCompatibility ; } else if ( ( metaTagBits & TagBits . AnnotationForMethod ) != <NUM_LIT:0> ) break checkTargetCompatibility ; break ; case Binding . FIELD : if ( ( metaTagBits & TagBits . AnnotationForField ) != <NUM_LIT:0> ) break checkTargetCompatibility ; break ; case Binding . LOCAL : if ( ( ( ( LocalVariableBinding ) this . recipient ) . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) { if ( ( metaTagBits & TagBits . AnnotationForParameter ) != <NUM_LIT:0> ) break checkTargetCompatibility ; } else if ( ( annotationType . tagBits & TagBits . AnnotationForLocalVariable ) != <NUM_LIT:0> ) break checkTargetCompatibility ; break ; } scope . problemReporter ( ) . disallowedTargetForAnnotation ( this ) ; } } } return this . resolvedType ; } public abstract void traverse ( ASTVisitor visitor , BlockScope scope ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class UnaryExpression extends OperatorExpression { public Expression expression ; public Constant optimizedBooleanConstant ; public UnaryExpression ( Expression expression , int operator ) { this . expression = expression ; this . bits |= operator << OperatorSHIFT ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . expression . checkNPE ( currentScope , flowContext , flowInfo ) ; if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == NOT ) { return this . expression . analyseCode ( currentScope , flowContext , flowInfo ) . asNegatedCondition ( ) ; } else { return this . expression . analyseCode ( currentScope , flowContext , flowInfo ) ; } } public Constant optimizedBooleanConstant ( ) { return this . optimizedBooleanConstant == null ? this . constant : this . optimizedBooleanConstant ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; BranchLabel falseLabel , endifLabel ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } switch ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) { case NOT : switch ( ( this . expression . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_boolean : this . expression . generateOptimizedBoolean ( currentScope , codeStream , null , ( falseLabel = new BranchLabel ( codeStream ) ) , valueRequired ) ; if ( valueRequired ) { codeStream . iconst_0 ( ) ; if ( falseLabel . forwardReferenceCount ( ) > <NUM_LIT:0> ) { codeStream . goto_ ( endifLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_1 ( ) ; endifLabel . place ( ) ; } } else { falseLabel . place ( ) ; } break ; } break ; case TWIDDLE : switch ( ( this . expression . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : this . expression . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . iconst_m1 ( ) ; codeStream . ixor ( ) ; } break ; case T_long : this . expression . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . ldc2_w ( - <NUM_LIT:1L> ) ; codeStream . lxor ( ) ; } } break ; case MINUS : if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) { switch ( ( this . expression . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : codeStream . generateInlinedValue ( this . constant . intValue ( ) * - <NUM_LIT:1> ) ; break ; case T_float : codeStream . generateInlinedValue ( this . constant . floatValue ( ) * - <NUM_LIT:1.0f> ) ; break ; case T_long : codeStream . generateInlinedValue ( this . constant . longValue ( ) * - <NUM_LIT:1L> ) ; break ; case T_double : codeStream . generateInlinedValue ( this . constant . doubleValue ( ) * - <NUM_LIT:1.0> ) ; } } } else { this . expression . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { switch ( ( this . expression . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : codeStream . ineg ( ) ; break ; case T_float : codeStream . fneg ( ) ; break ; case T_long : codeStream . lneg ( ) ; break ; case T_double : codeStream . dneg ( ) ; } } } break ; case PLUS : this . expression . generateCode ( currentScope , codeStream , valueRequired ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { if ( ( this . constant != Constant . NotAConstant ) && ( this . constant . typeID ( ) == T_boolean ) ) { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == NOT ) { this . expression . generateOptimizedBoolean ( currentScope , codeStream , falseLabel , trueLabel , valueRequired ) ; } else { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { output . append ( operatorToString ( ) ) . append ( '<CHAR_LIT:U+0020>' ) ; return this . expression . printExpression ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { boolean expressionIsCast ; if ( ( expressionIsCast = this . expression instanceof CastExpression ) == true ) this . expression . bits |= DisableUnnecessaryCastCheck ; TypeBinding expressionType = this . expression . resolveType ( scope ) ; if ( expressionType == null ) { this . constant = Constant . NotAConstant ; return null ; } int expressionTypeID = expressionType . id ; boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; if ( use15specifics ) { if ( ! expressionType . isBaseType ( ) ) { expressionTypeID = scope . environment ( ) . computeBoxingType ( expressionType ) . id ; } } if ( expressionTypeID > <NUM_LIT:15> ) { this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , expressionType ) ; return null ; } int tableId ; switch ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) { case NOT : tableId = AND_AND ; break ; case TWIDDLE : tableId = LEFT_SHIFT ; break ; default : tableId = MINUS ; } int operatorSignature = OperatorSignatures [ tableId ] [ ( expressionTypeID << <NUM_LIT:4> ) + expressionTypeID ] ; this . expression . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:16> ) & <NUM_LIT> ) , expressionType ) ; this . bits |= operatorSignature & <NUM_LIT> ; switch ( operatorSignature & <NUM_LIT> ) { case T_boolean : this . resolvedType = TypeBinding . BOOLEAN ; break ; case T_byte : this . resolvedType = TypeBinding . BYTE ; break ; case T_char : this . resolvedType = TypeBinding . CHAR ; break ; case T_double : this . resolvedType = TypeBinding . DOUBLE ; break ; case T_float : this . resolvedType = TypeBinding . FLOAT ; break ; case T_int : this . resolvedType = TypeBinding . INT ; break ; case T_long : this . resolvedType = TypeBinding . LONG ; break ; default : this . constant = Constant . NotAConstant ; if ( expressionTypeID != T_undefined ) scope . problemReporter ( ) . invalidOperator ( this , expressionType ) ; return null ; } if ( this . expression . constant != Constant . NotAConstant ) { this . constant = Constant . computeConstantOperation ( this . expression . constant , expressionTypeID , ( this . bits & OperatorMASK ) > > OperatorSHIFT ) ; } else { this . constant = Constant . NotAConstant ; if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == NOT ) { Constant cst = this . expression . optimizedBooleanConstant ( ) ; if ( cst != Constant . NotAConstant ) this . optimizedBooleanConstant = BooleanConstant . fromValue ( ! cst . booleanValue ( ) ) ; } } if ( expressionIsCast ) { CastExpression . checkNeedForArgumentCast ( scope , tableId , operatorSignature , this . expression , expressionTypeID ) ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . expression . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public abstract class Literal extends Expression { public Literal ( int s , int e ) { this . sourceStart = s ; this . sourceEnd = e ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return flowInfo ; } public abstract void computeConstant ( ) ; public abstract TypeBinding literalType ( BlockScope scope ) ; public StringBuffer printExpression ( int indent , StringBuffer output ) { return output . append ( source ( ) ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . resolvedType = literalType ( scope ) ; computeConstant ( ) ; if ( this . constant == null ) { scope . problemReporter ( ) . constantOutOfRange ( this , this . resolvedType ) ; this . constant = Constant . NotAConstant ; } return this . resolvedType ; } public abstract char [ ] source ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class IfStatement extends Statement { public Expression condition ; public Statement thenStatement ; public Statement elseStatement ; int thenInitStateIndex = - <NUM_LIT:1> ; int elseInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; public IfStatement ( Expression condition , Statement thenStatement , int sourceStart , int sourceEnd ) { this . condition = condition ; this . thenStatement = thenStatement ; if ( thenStatement instanceof EmptyStatement ) thenStatement . bits |= IsUsefulEmptyStatement ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public IfStatement ( Expression condition , Statement thenStatement , Statement elseStatement , int sourceStart , int sourceEnd ) { this . condition = condition ; this . thenStatement = thenStatement ; if ( thenStatement instanceof EmptyStatement ) thenStatement . bits |= IsUsefulEmptyStatement ; this . elseStatement = elseStatement ; if ( elseStatement instanceof IfStatement ) elseStatement . bits |= IsElseIfStatement ; if ( elseStatement instanceof EmptyStatement ) elseStatement . bits |= IsUsefulEmptyStatement ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowInfo conditionFlowInfo = this . condition . analyseCode ( currentScope , flowContext , flowInfo ) ; int initialComplaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; Constant cst = this . condition . optimizedBooleanConstant ( ) ; if ( ( this . condition . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . condition . checkNPE ( currentScope , flowContext , flowInfo ) ; } boolean isConditionOptimizedTrue = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isConditionOptimizedFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; FlowInfo thenFlowInfo = conditionFlowInfo . safeInitsWhenTrue ( ) ; if ( isConditionOptimizedFalse ) { thenFlowInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } FlowInfo elseFlowInfo = conditionFlowInfo . initsWhenFalse ( ) . copy ( ) ; if ( isConditionOptimizedTrue ) { elseFlowInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) && ( ( thenFlowInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ) ) { this . bits |= ASTNode . IsThenStatementUnreachable ; } else if ( ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) && ( ( elseFlowInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ) ) { this . bits |= ASTNode . IsElseStatementUnreachable ; } boolean reportDeadCodeForKnownPattern = ! isKnowDeadCodePattern ( this . condition ) || currentScope . compilerOptions ( ) . reportDeadCodeInTrivialIfStatement ; if ( this . thenStatement != null ) { this . thenInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( thenFlowInfo ) ; if ( isConditionOptimizedFalse || ( ( this . bits & ASTNode . IsThenStatementUnreachable ) != <NUM_LIT:0> ) ) { if ( reportDeadCodeForKnownPattern ) { this . thenStatement . complainIfUnreachable ( thenFlowInfo , currentScope , initialComplaintLevel , false ) ; } else { this . bits &= ~ ASTNode . IsThenStatementUnreachable ; } } thenFlowInfo = this . thenStatement . analyseCode ( currentScope , flowContext , thenFlowInfo ) ; } if ( ( thenFlowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) { this . bits |= ASTNode . ThenExit ; } if ( this . elseStatement != null ) { if ( thenFlowInfo == FlowInfo . DEAD_END && ( this . bits & IsElseIfStatement ) == <NUM_LIT:0> && ! ( this . elseStatement instanceof IfStatement ) ) { currentScope . problemReporter ( ) . unnecessaryElse ( this . elseStatement ) ; } this . elseInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( elseFlowInfo ) ; if ( isConditionOptimizedTrue || ( ( this . bits & ASTNode . IsElseStatementUnreachable ) != <NUM_LIT:0> ) ) { if ( reportDeadCodeForKnownPattern ) { this . elseStatement . complainIfUnreachable ( elseFlowInfo , currentScope , initialComplaintLevel , false ) ; } else { this . bits &= ~ ASTNode . IsElseStatementUnreachable ; } } elseFlowInfo = this . elseStatement . analyseCode ( currentScope , flowContext , elseFlowInfo ) ; } currentScope . correlateTrackingVarsIfElse ( thenFlowInfo , elseFlowInfo ) ; FlowInfo mergedInfo = FlowInfo . mergedOptimizedBranchesIfElse ( thenFlowInfo , isConditionOptimizedTrue , elseFlowInfo , isConditionOptimizedFalse , true , flowInfo , this , reportDeadCodeForKnownPattern ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; BranchLabel endifLabel = new BranchLabel ( codeStream ) ; Constant cst ; boolean hasThenPart = ! ( ( ( cst = this . condition . optimizedBooleanConstant ( ) ) != Constant . NotAConstant && cst . booleanValue ( ) == false ) || this . thenStatement == null || this . thenStatement . isEmptyBlock ( ) ) ; boolean hasElsePart = ! ( ( cst != Constant . NotAConstant && cst . booleanValue ( ) == true ) || this . elseStatement == null || this . elseStatement . isEmptyBlock ( ) ) ; if ( hasThenPart ) { BranchLabel falseLabel = null ; if ( cst != Constant . NotAConstant && cst . booleanValue ( ) == true ) { this . condition . generateCode ( currentScope , codeStream , false ) ; } else { this . condition . generateOptimizedBoolean ( currentScope , codeStream , null , hasElsePart ? ( falseLabel = new BranchLabel ( codeStream ) ) : endifLabel , true ) ; } if ( this . thenInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . thenInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . thenInitStateIndex ) ; } this . thenStatement . generateCode ( currentScope , codeStream ) ; if ( hasElsePart ) { if ( ( this . bits & ASTNode . ThenExit ) == <NUM_LIT:0> ) { this . thenStatement . branchChainTo ( endifLabel ) ; int position = codeStream . position ; codeStream . goto_ ( endifLabel ) ; codeStream . recordPositionsFrom ( position , this . thenStatement . sourceEnd ) ; } if ( this . elseInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . elseInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . elseInitStateIndex ) ; } if ( falseLabel != null ) falseLabel . place ( ) ; this . elseStatement . generateCode ( currentScope , codeStream ) ; } } else if ( hasElsePart ) { if ( cst != Constant . NotAConstant && cst . booleanValue ( ) == false ) { this . condition . generateCode ( currentScope , codeStream , false ) ; } else { this . condition . generateOptimizedBoolean ( currentScope , codeStream , endifLabel , null , true ) ; } if ( this . elseInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . elseInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . elseInitStateIndex ) ; } this . elseStatement . generateCode ( currentScope , codeStream ) ; } else { this . condition . generateCode ( currentScope , codeStream , false ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } endifLabel . place ( ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . condition . printExpression ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; this . thenStatement . printStatement ( indent + <NUM_LIT:2> , output ) ; if ( this . elseStatement != null ) { output . append ( '<STR_LIT:\n>' ) ; printIndent ( indent , output ) ; output . append ( "<STR_LIT>" ) ; this . elseStatement . printStatement ( indent + <NUM_LIT:2> , output ) ; } return output ; } public void resolve ( BlockScope scope ) { TypeBinding type = this . condition . resolveTypeExpecting ( scope , TypeBinding . BOOLEAN ) ; this . condition . computeConversion ( scope , type , type ) ; if ( this . thenStatement != null ) this . thenStatement . resolve ( scope ) ; if ( this . elseStatement != null ) this . elseStatement . resolve ( scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . condition . traverse ( visitor , blockScope ) ; if ( this . thenStatement != null ) this . thenStatement . traverse ( visitor , blockScope ) ; if ( this . elseStatement != null ) this . elseStatement . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . JavadocTagConstants ; public class Javadoc extends ASTNode { public JavadocSingleNameReference [ ] paramReferences ; public JavadocSingleTypeReference [ ] paramTypeParameters ; public TypeReference [ ] exceptionReferences ; public JavadocReturnStatement returnStatement ; public Expression [ ] seeReferences ; public long [ ] inheritedPositions = null ; public JavadocSingleNameReference [ ] invalidParameters ; public long valuePositions = - <NUM_LIT:1> ; public Javadoc ( int sourceStart , int sourceEnd ) { this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; this . bits |= ASTNode . ResolveJavadoc ; } boolean canBeSeen ( int visibility , int modifiers ) { if ( modifiers < <NUM_LIT:0> ) return true ; switch ( modifiers & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : return true ; case ClassFileConstants . AccProtected : return ( visibility != ClassFileConstants . AccPublic ) ; case ClassFileConstants . AccDefault : return ( visibility == ClassFileConstants . AccDefault || visibility == ClassFileConstants . AccPrivate ) ; case ClassFileConstants . AccPrivate : return ( visibility == ClassFileConstants . AccPrivate ) ; } return true ; } public ASTNode getNodeStartingAt ( int start ) { int length = <NUM_LIT:0> ; if ( this . paramReferences != null ) { length = this . paramReferences . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { JavadocSingleNameReference param = this . paramReferences [ i ] ; if ( param . sourceStart == start ) { return param ; } } } if ( this . invalidParameters != null ) { length = this . invalidParameters . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { JavadocSingleNameReference param = this . invalidParameters [ i ] ; if ( param . sourceStart == start ) { return param ; } } } if ( this . paramTypeParameters != null ) { length = this . paramTypeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { JavadocSingleTypeReference param = this . paramTypeParameters [ i ] ; if ( param . sourceStart == start ) { return param ; } } } if ( this . exceptionReferences != null ) { length = this . exceptionReferences . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference typeRef = this . exceptionReferences [ i ] ; if ( typeRef . sourceStart == start ) { return typeRef ; } } } if ( this . seeReferences != null ) { length = this . seeReferences . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { org . eclipse . jdt . internal . compiler . ast . Expression expression = this . seeReferences [ i ] ; if ( expression . sourceStart == start ) { return expression ; } else if ( expression instanceof JavadocAllocationExpression ) { JavadocAllocationExpression allocationExpr = ( JavadocAllocationExpression ) this . seeReferences [ i ] ; if ( allocationExpr . binding != null && allocationExpr . binding . isValidBinding ( ) ) { if ( allocationExpr . arguments != null ) { for ( int j = <NUM_LIT:0> , l = allocationExpr . arguments . length ; j < l ; j ++ ) { if ( allocationExpr . arguments [ j ] . sourceStart == start ) { return allocationExpr . arguments [ j ] ; } } } } } else if ( expression instanceof JavadocMessageSend ) { JavadocMessageSend messageSend = ( JavadocMessageSend ) this . seeReferences [ i ] ; if ( messageSend . binding != null && messageSend . binding . isValidBinding ( ) ) { if ( messageSend . arguments != null ) { for ( int j = <NUM_LIT:0> , l = messageSend . arguments . length ; j < l ; j ++ ) { if ( messageSend . arguments [ j ] . sourceStart == start ) { return messageSend . arguments [ j ] ; } } } } } } } return null ; } public StringBuffer print ( int indent , StringBuffer output ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; if ( this . paramReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . paramReferences . length ; i < length ; i ++ ) { printIndent ( indent + <NUM_LIT:1> , output ) . append ( "<STR_LIT>" ) ; this . paramReferences [ i ] . print ( indent , output ) . append ( '<STR_LIT:\n>' ) ; } } if ( this . paramTypeParameters != null ) { for ( int i = <NUM_LIT:0> , length = this . paramTypeParameters . length ; i < length ; i ++ ) { printIndent ( indent + <NUM_LIT:1> , output ) . append ( "<STR_LIT>" ) ; this . paramTypeParameters [ i ] . print ( indent , output ) . append ( "<STR_LIT>" ) ; } } if ( this . returnStatement != null ) { printIndent ( indent + <NUM_LIT:1> , output ) . append ( "<STR_LIT>" ) ; this . returnStatement . print ( indent , output ) . append ( '<STR_LIT:\n>' ) ; } if ( this . exceptionReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . exceptionReferences . length ; i < length ; i ++ ) { printIndent ( indent + <NUM_LIT:1> , output ) . append ( "<STR_LIT>" ) ; this . exceptionReferences [ i ] . print ( indent , output ) . append ( '<STR_LIT:\n>' ) ; } } if ( this . seeReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . seeReferences . length ; i < length ; i ++ ) { printIndent ( indent + <NUM_LIT:1> , output ) . append ( "<STR_LIT>" ) ; this . seeReferences [ i ] . print ( indent , output ) . append ( '<STR_LIT:\n>' ) ; } } printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; return output ; } public void resolve ( ClassScope scope ) { if ( ( this . bits & ASTNode . ResolveJavadoc ) == <NUM_LIT:0> ) { return ; } if ( this . inheritedPositions != null ) { int length = this . inheritedPositions . length ; for ( int i = <NUM_LIT:0> ; i < length ; ++ i ) { int start = ( int ) ( this . inheritedPositions [ i ] > > > <NUM_LIT:32> ) ; int end = ( int ) this . inheritedPositions [ i ] ; scope . problemReporter ( ) . javadocUnexpectedTag ( start , end ) ; } } int paramTagsSize = this . paramReferences == null ? <NUM_LIT:0> : this . paramReferences . length ; for ( int i = <NUM_LIT:0> ; i < paramTagsSize ; i ++ ) { JavadocSingleNameReference param = this . paramReferences [ i ] ; scope . problemReporter ( ) . javadocUnexpectedTag ( param . tagSourceStart , param . tagSourceEnd ) ; } resolveTypeParameterTags ( scope , true ) ; if ( this . returnStatement != null ) { scope . problemReporter ( ) . javadocUnexpectedTag ( this . returnStatement . sourceStart , this . returnStatement . sourceEnd ) ; } int throwsTagsLength = this . exceptionReferences == null ? <NUM_LIT:0> : this . exceptionReferences . length ; for ( int i = <NUM_LIT:0> ; i < throwsTagsLength ; i ++ ) { TypeReference typeRef = this . exceptionReferences [ i ] ; int start , end ; if ( typeRef instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference singleRef = ( JavadocSingleTypeReference ) typeRef ; start = singleRef . tagSourceStart ; end = singleRef . tagSourceEnd ; } else if ( typeRef instanceof JavadocQualifiedTypeReference ) { JavadocQualifiedTypeReference qualifiedRef = ( JavadocQualifiedTypeReference ) typeRef ; start = qualifiedRef . tagSourceStart ; end = qualifiedRef . tagSourceEnd ; } else { start = typeRef . sourceStart ; end = typeRef . sourceEnd ; } scope . problemReporter ( ) . javadocUnexpectedTag ( start , end ) ; } int seeTagsLength = this . seeReferences == null ? <NUM_LIT:0> : this . seeReferences . length ; for ( int i = <NUM_LIT:0> ; i < seeTagsLength ; i ++ ) { resolveReference ( this . seeReferences [ i ] , scope ) ; } boolean source15 = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; if ( ! source15 && this . valuePositions != - <NUM_LIT:1> ) { scope . problemReporter ( ) . javadocUnexpectedTag ( ( int ) ( this . valuePositions > > > <NUM_LIT:32> ) , ( int ) this . valuePositions ) ; } } public void resolve ( CompilationUnitScope unitScope ) { if ( ( this . bits & ASTNode . ResolveJavadoc ) == <NUM_LIT:0> ) { return ; } } public void resolve ( MethodScope methScope ) { if ( ( this . bits & ASTNode . ResolveJavadoc ) == <NUM_LIT:0> ) { return ; } AbstractMethodDeclaration methDecl = methScope . referenceMethod ( ) ; boolean overriding = methDecl == null || methDecl . binding == null ? false : ! methDecl . binding . isStatic ( ) && ( ( methDecl . binding . modifiers & ( ExtraCompilerModifiers . AccImplementing | ExtraCompilerModifiers . AccOverriding ) ) != <NUM_LIT:0> ) ; int seeTagsLength = this . seeReferences == null ? <NUM_LIT:0> : this . seeReferences . length ; boolean superRef = false ; for ( int i = <NUM_LIT:0> ; i < seeTagsLength ; i ++ ) { resolveReference ( this . seeReferences [ i ] , methScope ) ; if ( methDecl != null && ! superRef ) { if ( ! methDecl . isConstructor ( ) ) { if ( overriding && this . seeReferences [ i ] instanceof JavadocMessageSend ) { JavadocMessageSend messageSend = ( JavadocMessageSend ) this . seeReferences [ i ] ; if ( messageSend . binding != null && messageSend . binding . isValidBinding ( ) && messageSend . actualReceiverType instanceof ReferenceBinding ) { ReferenceBinding methodReceiverType = ( ReferenceBinding ) messageSend . actualReceiverType ; TypeBinding superType = methDecl . binding . declaringClass . findSuperTypeOriginatingFrom ( methodReceiverType ) ; if ( superType != null && superType . original ( ) != methDecl . binding . declaringClass && CharOperation . equals ( messageSend . selector , methDecl . selector ) ) { if ( methScope . environment ( ) . methodVerifier ( ) . doesMethodOverride ( methDecl . binding , messageSend . binding . original ( ) ) ) { superRef = true ; } } } } } else if ( this . seeReferences [ i ] instanceof JavadocAllocationExpression ) { JavadocAllocationExpression allocationExpr = ( JavadocAllocationExpression ) this . seeReferences [ i ] ; if ( allocationExpr . binding != null && allocationExpr . binding . isValidBinding ( ) ) { ReferenceBinding allocType = ( ReferenceBinding ) allocationExpr . resolvedType . original ( ) ; ReferenceBinding superType = ( ReferenceBinding ) methDecl . binding . declaringClass . findSuperTypeOriginatingFrom ( allocType ) ; if ( superType != null && superType . original ( ) != methDecl . binding . declaringClass ) { MethodBinding superConstructor = methScope . getConstructor ( superType , methDecl . binding . parameters , allocationExpr ) ; if ( superConstructor . isValidBinding ( ) && superConstructor . original ( ) == allocationExpr . binding . original ( ) ) { if ( superConstructor . areParametersEqual ( methDecl . binding ) ) { superRef = true ; } } } } } } } if ( ! superRef && methDecl != null && methDecl . annotations != null ) { int length = methDecl . annotations . length ; for ( int i = <NUM_LIT:0> ; i < length && ! superRef ; i ++ ) { superRef = ( methDecl . binding . tagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ; } } boolean reportMissing = methDecl == null || ! ( ( overriding && this . inheritedPositions != null ) || superRef || ( methDecl . binding . declaringClass != null && methDecl . binding . declaringClass . isLocalType ( ) ) ) ; if ( ! overriding && this . inheritedPositions != null ) { int length = this . inheritedPositions . length ; for ( int i = <NUM_LIT:0> ; i < length ; ++ i ) { int start = ( int ) ( this . inheritedPositions [ i ] > > > <NUM_LIT:32> ) ; int end = ( int ) this . inheritedPositions [ i ] ; methScope . problemReporter ( ) . javadocUnexpectedTag ( start , end ) ; } } CompilerOptions compilerOptions = methScope . compilerOptions ( ) ; resolveParamTags ( methScope , reportMissing , compilerOptions . reportUnusedParameterIncludeDocCommentReference ) ; resolveTypeParameterTags ( methScope , reportMissing && compilerOptions . reportMissingJavadocTagsMethodTypeParameters ) ; if ( this . returnStatement == null ) { if ( reportMissing && methDecl != null ) { if ( methDecl . isMethod ( ) ) { MethodDeclaration meth = ( MethodDeclaration ) methDecl ; if ( meth . binding . returnType != TypeBinding . VOID ) { methScope . problemReporter ( ) . javadocMissingReturnTag ( meth . returnType . sourceStart , meth . returnType . sourceEnd , methDecl . binding . modifiers ) ; } } } } else { this . returnStatement . resolve ( methScope ) ; } resolveThrowsTags ( methScope , reportMissing ) ; boolean source15 = compilerOptions . sourceLevel >= ClassFileConstants . JDK1_5 ; if ( ! source15 && methDecl != null && this . valuePositions != - <NUM_LIT:1> ) { methScope . problemReporter ( ) . javadocUnexpectedTag ( ( int ) ( this . valuePositions > > > <NUM_LIT:32> ) , ( int ) this . valuePositions ) ; } int length = this . invalidParameters == null ? <NUM_LIT:0> : this . invalidParameters . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . invalidParameters [ i ] . resolve ( methScope , false , false ) ; } } private void resolveReference ( Expression reference , Scope scope ) { int problemCount = scope . referenceContext ( ) . compilationResult ( ) . problemCount ; switch ( scope . kind ) { case Scope . METHOD_SCOPE : reference . resolveType ( ( MethodScope ) scope ) ; break ; case Scope . CLASS_SCOPE : reference . resolveType ( ( ClassScope ) scope ) ; break ; } boolean hasProblems = scope . referenceContext ( ) . compilationResult ( ) . problemCount > problemCount ; boolean source15 = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; int scopeModifiers = - <NUM_LIT:1> ; if ( reference instanceof JavadocFieldReference ) { JavadocFieldReference fieldRef = ( JavadocFieldReference ) reference ; if ( fieldRef . methodBinding != null ) { if ( fieldRef . tagValue == JavadocTagConstants . TAG_VALUE_VALUE ) { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidValueReference ( fieldRef . sourceStart , fieldRef . sourceEnd , scopeModifiers ) ; } else if ( fieldRef . actualReceiverType != null ) { if ( scope . enclosingSourceType ( ) . isCompatibleWith ( fieldRef . actualReceiverType ) ) { fieldRef . bits |= ASTNode . SuperAccess ; } ReferenceBinding resolvedType = ( ReferenceBinding ) fieldRef . actualReceiverType ; if ( CharOperation . equals ( resolvedType . sourceName ( ) , fieldRef . token ) ) { fieldRef . methodBinding = scope . getConstructor ( resolvedType , Binding . NO_TYPES , fieldRef ) ; } else { fieldRef . methodBinding = scope . findMethod ( resolvedType , fieldRef . token , Binding . NO_TYPES , fieldRef ) ; } } } else if ( source15 && fieldRef . binding != null && fieldRef . binding . isValidBinding ( ) ) { if ( fieldRef . tagValue == JavadocTagConstants . TAG_VALUE_VALUE && ! fieldRef . binding . isStatic ( ) ) { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidValueReference ( fieldRef . sourceStart , fieldRef . sourceEnd , scopeModifiers ) ; } } if ( ! hasProblems && fieldRef . binding != null && fieldRef . binding . isValidBinding ( ) && fieldRef . actualReceiverType instanceof ReferenceBinding ) { ReferenceBinding resolvedType = ( ReferenceBinding ) fieldRef . actualReceiverType ; verifyTypeReference ( fieldRef , fieldRef . receiver , scope , source15 , resolvedType , fieldRef . binding . modifiers ) ; } return ; } if ( ! hasProblems && ( reference instanceof JavadocSingleTypeReference || reference instanceof JavadocQualifiedTypeReference ) && reference . resolvedType instanceof ReferenceBinding ) { ReferenceBinding resolvedType = ( ReferenceBinding ) reference . resolvedType ; verifyTypeReference ( reference , reference , scope , source15 , resolvedType , resolvedType . modifiers ) ; } if ( reference instanceof JavadocMessageSend ) { JavadocMessageSend msgSend = ( JavadocMessageSend ) reference ; if ( source15 && msgSend . tagValue == JavadocTagConstants . TAG_VALUE_VALUE ) { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidValueReference ( msgSend . sourceStart , msgSend . sourceEnd , scopeModifiers ) ; } if ( ! hasProblems && msgSend . binding != null && msgSend . binding . isValidBinding ( ) && msgSend . actualReceiverType instanceof ReferenceBinding ) { ReferenceBinding resolvedType = ( ReferenceBinding ) msgSend . actualReceiverType ; verifyTypeReference ( msgSend , msgSend . receiver , scope , source15 , resolvedType , msgSend . binding . modifiers ) ; } } else if ( reference instanceof JavadocAllocationExpression ) { JavadocAllocationExpression alloc = ( JavadocAllocationExpression ) reference ; if ( source15 && alloc . tagValue == JavadocTagConstants . TAG_VALUE_VALUE ) { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidValueReference ( alloc . sourceStart , alloc . sourceEnd , scopeModifiers ) ; } if ( ! hasProblems && alloc . binding != null && alloc . binding . isValidBinding ( ) && alloc . resolvedType instanceof ReferenceBinding ) { ReferenceBinding resolvedType = ( ReferenceBinding ) alloc . resolvedType ; verifyTypeReference ( alloc , alloc . type , scope , source15 , resolvedType , alloc . binding . modifiers ) ; } } if ( reference . resolvedType != null && reference . resolvedType . isTypeVariable ( ) ) { scope . problemReporter ( ) . javadocInvalidReference ( reference . sourceStart , reference . sourceEnd ) ; } } private void resolveParamTags ( MethodScope scope , boolean reportMissing , boolean considerParamRefAsUsage ) { AbstractMethodDeclaration methodDecl = scope . referenceMethod ( ) ; int paramTagsSize = this . paramReferences == null ? <NUM_LIT:0> : this . paramReferences . length ; if ( methodDecl == null ) { for ( int i = <NUM_LIT:0> ; i < paramTagsSize ; i ++ ) { JavadocSingleNameReference param = this . paramReferences [ i ] ; scope . problemReporter ( ) . javadocUnexpectedTag ( param . tagSourceStart , param . tagSourceEnd ) ; } return ; } int argumentsSize = methodDecl . arguments == null ? <NUM_LIT:0> : methodDecl . arguments . length ; if ( paramTagsSize == <NUM_LIT:0> ) { if ( reportMissing ) { for ( int i = <NUM_LIT:0> ; i < argumentsSize ; i ++ ) { Argument arg = methodDecl . arguments [ i ] ; scope . problemReporter ( ) . javadocMissingParamTag ( arg . name , arg . sourceStart , arg . sourceEnd , methodDecl . binding . modifiers ) ; } } } else { LocalVariableBinding [ ] bindings = new LocalVariableBinding [ paramTagsSize ] ; int maxBindings = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < paramTagsSize ; i ++ ) { JavadocSingleNameReference param = this . paramReferences [ i ] ; param . resolve ( scope , true , considerParamRefAsUsage ) ; if ( param . binding != null && param . binding . isValidBinding ( ) ) { boolean found = false ; for ( int j = <NUM_LIT:0> ; j < maxBindings && ! found ; j ++ ) { if ( bindings [ j ] == param . binding ) { scope . problemReporter ( ) . javadocDuplicatedParamTag ( param . token , param . sourceStart , param . sourceEnd , methodDecl . binding . modifiers ) ; found = true ; } } if ( ! found ) { bindings [ maxBindings ++ ] = ( LocalVariableBinding ) param . binding ; } } } if ( reportMissing ) { for ( int i = <NUM_LIT:0> ; i < argumentsSize ; i ++ ) { Argument arg = methodDecl . arguments [ i ] ; boolean found = false ; for ( int j = <NUM_LIT:0> ; j < maxBindings && ! found ; j ++ ) { LocalVariableBinding binding = bindings [ j ] ; if ( arg . binding == binding ) { found = true ; } } if ( ! found ) { scope . problemReporter ( ) . javadocMissingParamTag ( arg . name , arg . sourceStart , arg . sourceEnd , methodDecl . binding . modifiers ) ; } } } } } private void resolveTypeParameterTags ( Scope scope , boolean reportMissing ) { int paramTypeParamLength = this . paramTypeParameters == null ? <NUM_LIT:0> : this . paramTypeParameters . length ; TypeParameter [ ] parameters = null ; TypeVariableBinding [ ] typeVariables = null ; int modifiers = - <NUM_LIT:1> ; switch ( scope . kind ) { case Scope . METHOD_SCOPE : AbstractMethodDeclaration methodDeclaration = ( ( MethodScope ) scope ) . referenceMethod ( ) ; if ( methodDeclaration == null ) { for ( int i = <NUM_LIT:0> ; i < paramTypeParamLength ; i ++ ) { JavadocSingleTypeReference param = this . paramTypeParameters [ i ] ; scope . problemReporter ( ) . javadocUnexpectedTag ( param . tagSourceStart , param . tagSourceEnd ) ; } return ; } parameters = methodDeclaration . typeParameters ( ) ; typeVariables = methodDeclaration . binding . typeVariables ; modifiers = methodDeclaration . binding . modifiers ; break ; case Scope . CLASS_SCOPE : TypeDeclaration typeDeclaration = ( ( ClassScope ) scope ) . referenceContext ; parameters = typeDeclaration . typeParameters ; typeVariables = typeDeclaration . binding . typeVariables ; modifiers = typeDeclaration . binding . modifiers ; break ; } if ( typeVariables == null || typeVariables . length == <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < paramTypeParamLength ; i ++ ) { JavadocSingleTypeReference param = this . paramTypeParameters [ i ] ; scope . problemReporter ( ) . javadocUnexpectedTag ( param . tagSourceStart , param . tagSourceEnd ) ; } return ; } if ( parameters != null ) { reportMissing = reportMissing && scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; int typeParametersLength = parameters . length ; if ( paramTypeParamLength == <NUM_LIT:0> ) { if ( reportMissing ) { for ( int i = <NUM_LIT:0> , l = typeParametersLength ; i < l ; i ++ ) { scope . problemReporter ( ) . javadocMissingParamTag ( parameters [ i ] . name , parameters [ i ] . sourceStart , parameters [ i ] . sourceEnd , modifiers ) ; } } } else if ( typeVariables . length == typeParametersLength ) { TypeVariableBinding [ ] bindings = new TypeVariableBinding [ paramTypeParamLength ] ; for ( int i = <NUM_LIT:0> ; i < paramTypeParamLength ; i ++ ) { JavadocSingleTypeReference param = this . paramTypeParameters [ i ] ; TypeBinding paramBindind = param . internalResolveType ( scope ) ; if ( paramBindind != null && paramBindind . isValidBinding ( ) ) { if ( paramBindind . isTypeVariable ( ) ) { boolean duplicate = false ; for ( int j = <NUM_LIT:0> ; j < i && ! duplicate ; j ++ ) { if ( bindings [ j ] == param . resolvedType ) { scope . problemReporter ( ) . javadocDuplicatedParamTag ( param . token , param . sourceStart , param . sourceEnd , modifiers ) ; duplicate = true ; } } if ( ! duplicate ) { bindings [ i ] = ( TypeVariableBinding ) param . resolvedType ; } } else { scope . problemReporter ( ) . javadocUndeclaredParamTagName ( param . token , param . sourceStart , param . sourceEnd , modifiers ) ; } } } for ( int i = <NUM_LIT:0> ; i < typeParametersLength ; i ++ ) { TypeParameter parameter = parameters [ i ] ; boolean found = false ; for ( int j = <NUM_LIT:0> ; j < paramTypeParamLength && ! found ; j ++ ) { if ( parameter . binding == bindings [ j ] ) { found = true ; bindings [ j ] = null ; } } if ( ! found && reportMissing ) { scope . problemReporter ( ) . javadocMissingParamTag ( parameter . name , parameter . sourceStart , parameter . sourceEnd , modifiers ) ; } } for ( int i = <NUM_LIT:0> ; i < paramTypeParamLength ; i ++ ) { if ( bindings [ i ] != null ) { JavadocSingleTypeReference param = this . paramTypeParameters [ i ] ; scope . problemReporter ( ) . javadocUndeclaredParamTagName ( param . token , param . sourceStart , param . sourceEnd , modifiers ) ; } } } } } private void resolveThrowsTags ( MethodScope methScope , boolean reportMissing ) { AbstractMethodDeclaration md = methScope . referenceMethod ( ) ; int throwsTagsLength = this . exceptionReferences == null ? <NUM_LIT:0> : this . exceptionReferences . length ; if ( md == null ) { for ( int i = <NUM_LIT:0> ; i < throwsTagsLength ; i ++ ) { TypeReference typeRef = this . exceptionReferences [ i ] ; int start = typeRef . sourceStart ; int end = typeRef . sourceEnd ; if ( typeRef instanceof JavadocQualifiedTypeReference ) { start = ( ( JavadocQualifiedTypeReference ) typeRef ) . tagSourceStart ; end = ( ( JavadocQualifiedTypeReference ) typeRef ) . tagSourceEnd ; } else if ( typeRef instanceof JavadocSingleTypeReference ) { start = ( ( JavadocSingleTypeReference ) typeRef ) . tagSourceStart ; end = ( ( JavadocSingleTypeReference ) typeRef ) . tagSourceEnd ; } methScope . problemReporter ( ) . javadocUnexpectedTag ( start , end ) ; } return ; } int boundExceptionLength = ( md . binding == null ) ? <NUM_LIT:0> : md . binding . thrownExceptions . length ; int thrownExceptionLength = md . thrownExceptions == null ? <NUM_LIT:0> : md . thrownExceptions . length ; if ( throwsTagsLength == <NUM_LIT:0> ) { if ( reportMissing ) { for ( int i = <NUM_LIT:0> ; i < boundExceptionLength ; i ++ ) { ReferenceBinding exceptionBinding = md . binding . thrownExceptions [ i ] ; if ( exceptionBinding != null && exceptionBinding . isValidBinding ( ) ) { int j = i ; while ( j < thrownExceptionLength && exceptionBinding != md . thrownExceptions [ j ] . resolvedType ) j ++ ; if ( j < thrownExceptionLength ) { methScope . problemReporter ( ) . javadocMissingThrowsTag ( md . thrownExceptions [ j ] , md . binding . modifiers ) ; } } } } } else { int maxRef = <NUM_LIT:0> ; TypeReference [ ] typeReferences = new TypeReference [ throwsTagsLength ] ; for ( int i = <NUM_LIT:0> ; i < throwsTagsLength ; i ++ ) { TypeReference typeRef = this . exceptionReferences [ i ] ; typeRef . resolve ( methScope ) ; TypeBinding typeBinding = typeRef . resolvedType ; if ( typeBinding != null && typeBinding . isValidBinding ( ) && typeBinding . isClass ( ) ) { typeReferences [ maxRef ++ ] = typeRef ; } } for ( int i = <NUM_LIT:0> ; i < boundExceptionLength ; i ++ ) { ReferenceBinding exceptionBinding = md . binding . thrownExceptions [ i ] ; if ( exceptionBinding != null ) exceptionBinding = ( ReferenceBinding ) exceptionBinding . erasure ( ) ; boolean found = false ; for ( int j = <NUM_LIT:0> ; j < maxRef && ! found ; j ++ ) { if ( typeReferences [ j ] != null ) { TypeBinding typeBinding = typeReferences [ j ] . resolvedType ; if ( exceptionBinding == typeBinding ) { found = true ; typeReferences [ j ] = null ; } } } if ( ! found && reportMissing ) { if ( exceptionBinding != null && exceptionBinding . isValidBinding ( ) ) { int k = i ; while ( k < thrownExceptionLength && exceptionBinding != md . thrownExceptions [ k ] . resolvedType ) k ++ ; if ( k < thrownExceptionLength ) { methScope . problemReporter ( ) . javadocMissingThrowsTag ( md . thrownExceptions [ k ] , md . binding . modifiers ) ; } } } } for ( int i = <NUM_LIT:0> ; i < maxRef ; i ++ ) { TypeReference typeRef = typeReferences [ i ] ; if ( typeRef != null ) { boolean compatible = false ; for ( int j = <NUM_LIT:0> ; j < thrownExceptionLength && ! compatible ; j ++ ) { TypeBinding exceptionBinding = md . thrownExceptions [ j ] . resolvedType ; if ( exceptionBinding != null ) { compatible = typeRef . resolvedType . isCompatibleWith ( exceptionBinding ) ; } } if ( ! compatible && ! typeRef . resolvedType . isUncheckedException ( false ) ) { methScope . problemReporter ( ) . javadocInvalidThrowsClassName ( typeRef , md . binding . modifiers ) ; } } } } } private void verifyTypeReference ( Expression reference , Expression typeReference , Scope scope , boolean source15 , ReferenceBinding resolvedType , int modifiers ) { if ( resolvedType . isValidBinding ( ) ) { int scopeModifiers = - <NUM_LIT:1> ; if ( ! canBeSeen ( scope . problemReporter ( ) . options . reportInvalidJavadocTagsVisibility , modifiers ) ) { scope . problemReporter ( ) . javadocHiddenReference ( typeReference . sourceStart , reference . sourceEnd , scope , modifiers ) ; return ; } if ( reference != typeReference ) { if ( ! canBeSeen ( scope . problemReporter ( ) . options . reportInvalidJavadocTagsVisibility , resolvedType . modifiers ) ) { scope . problemReporter ( ) . javadocHiddenReference ( typeReference . sourceStart , typeReference . sourceEnd , scope , resolvedType . modifiers ) ; return ; } } if ( resolvedType . isMemberType ( ) ) { ReferenceBinding topLevelType = resolvedType ; int packageLength = topLevelType . fPackage . compoundName . length ; int depth = resolvedType . depth ( ) ; int idx = depth + packageLength ; char [ ] [ ] computedCompoundName = new char [ idx + <NUM_LIT:1> ] [ ] ; computedCompoundName [ idx ] = topLevelType . sourceName ; while ( topLevelType . enclosingType ( ) != null ) { topLevelType = topLevelType . enclosingType ( ) ; computedCompoundName [ -- idx ] = topLevelType . sourceName ; } for ( int i = packageLength ; -- i >= <NUM_LIT:0> ; ) { computedCompoundName [ -- idx ] = topLevelType . fPackage . compoundName [ i ] ; } ClassScope topLevelScope = scope . classScope ( ) ; if ( topLevelScope . parent . kind != Scope . COMPILATION_UNIT_SCOPE || ! CharOperation . equals ( topLevelType . sourceName , topLevelScope . referenceContext . name ) ) { topLevelScope = topLevelScope . outerMostClassScope ( ) ; if ( typeReference instanceof JavadocSingleTypeReference ) { if ( ( ! source15 && depth == <NUM_LIT:1> ) || topLevelType != topLevelScope . referenceContext . binding ) { boolean hasValidImport = false ; if ( source15 ) { CompilationUnitScope unitScope = topLevelScope . compilationUnitScope ( ) ; ImportBinding [ ] imports = unitScope . imports ; int length = imports == null ? <NUM_LIT:0> : imports . length ; mainLoop : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char [ ] [ ] compoundName = imports [ i ] . compoundName ; int compoundNameLength = compoundName . length ; if ( ( imports [ i ] . onDemand && compoundNameLength == computedCompoundName . length - <NUM_LIT:1> ) || ( compoundNameLength == computedCompoundName . length ) ) { for ( int j = compoundNameLength ; -- j >= <NUM_LIT:0> ; ) { if ( CharOperation . equals ( imports [ i ] . compoundName [ j ] , computedCompoundName [ j ] ) ) { if ( j == <NUM_LIT:0> ) { hasValidImport = true ; ImportReference importReference = imports [ i ] . reference ; if ( importReference != null ) { importReference . bits |= ASTNode . Used ; } break mainLoop ; } } else { break ; } } } } if ( ! hasValidImport ) { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( typeReference . sourceStart , typeReference . sourceEnd , scopeModifiers ) ; } } else { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( typeReference . sourceStart , typeReference . sourceEnd , scopeModifiers ) ; return ; } } } } if ( typeReference instanceof JavadocQualifiedTypeReference && ! scope . isDefinedInSameUnit ( resolvedType ) ) { char [ ] [ ] typeRefName = ( ( JavadocQualifiedTypeReference ) typeReference ) . getTypeName ( ) ; int skipLength = <NUM_LIT:0> ; if ( topLevelScope . getCurrentPackage ( ) == resolvedType . getPackage ( ) && typeRefName . length < computedCompoundName . length ) { skipLength = resolvedType . fPackage . compoundName . length ; } boolean valid = true ; if ( typeRefName . length == computedCompoundName . length - skipLength ) { checkQualification : for ( int i = <NUM_LIT:0> ; i < typeRefName . length ; i ++ ) { if ( ! CharOperation . equals ( typeRefName [ i ] , computedCompoundName [ i + skipLength ] ) ) { valid = false ; break checkQualification ; } } } else { valid = false ; } if ( ! valid ) { if ( scopeModifiers == - <NUM_LIT:1> ) scopeModifiers = scope . getDeclarationModifiers ( ) ; scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( typeReference . sourceStart , typeReference . sourceEnd , scopeModifiers ) ; return ; } } } if ( scope . referenceCompilationUnit ( ) . isPackageInfo ( ) && typeReference instanceof JavadocSingleTypeReference ) { if ( resolvedType . fPackage . compoundName . length > <NUM_LIT:0> ) { scope . problemReporter ( ) . javadocInvalidReference ( typeReference . sourceStart , typeReference . sourceEnd ) ; return ; } } } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . paramReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . paramReferences . length ; i < length ; i ++ ) { this . paramReferences [ i ] . traverse ( visitor , scope ) ; } } if ( this . paramTypeParameters != null ) { for ( int i = <NUM_LIT:0> , length = this . paramTypeParameters . length ; i < length ; i ++ ) { this . paramTypeParameters [ i ] . traverse ( visitor , scope ) ; } } if ( this . returnStatement != null ) { this . returnStatement . traverse ( visitor , scope ) ; } if ( this . exceptionReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . exceptionReferences . length ; i < length ; i ++ ) { this . exceptionReferences [ i ] . traverse ( visitor , scope ) ; } } if ( this . seeReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . seeReferences . length ; i < length ; i ++ ) { this . seeReferences [ i ] . traverse ( visitor , scope ) ; } } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . paramReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . paramReferences . length ; i < length ; i ++ ) { this . paramReferences [ i ] . traverse ( visitor , scope ) ; } } if ( this . paramTypeParameters != null ) { for ( int i = <NUM_LIT:0> , length = this . paramTypeParameters . length ; i < length ; i ++ ) { this . paramTypeParameters [ i ] . traverse ( visitor , scope ) ; } } if ( this . returnStatement != null ) { this . returnStatement . traverse ( visitor , scope ) ; } if ( this . exceptionReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . exceptionReferences . length ; i < length ; i ++ ) { this . exceptionReferences [ i ] . traverse ( visitor , scope ) ; } } if ( this . seeReferences != null ) { for ( int i = <NUM_LIT:0> , length = this . seeReferences . length ; i < length ; i ++ ) { this . seeReferences [ i ] . traverse ( visitor , scope ) ; } } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class OR_OR_Expression extends BinaryExpression { int rightInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; public OR_OR_Expression ( Expression left , Expression right , int operator ) { super ( left , right , operator ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { Constant cst = this . left . optimizedBooleanConstant ( ) ; boolean isLeftOptimizedTrue = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isLeftOptimizedFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; if ( isLeftOptimizedFalse ) { FlowInfo mergedInfo = this . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; mergedInfo = this . right . analyseCode ( currentScope , flowContext , mergedInfo ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } FlowInfo leftInfo = this . left . analyseCode ( currentScope , flowContext , flowInfo ) ; FlowInfo rightInfo = leftInfo . initsWhenFalse ( ) . unconditionalCopy ( ) ; this . rightInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( rightInfo ) ; int previousMode = rightInfo . reachMode ( ) ; if ( isLeftOptimizedTrue ) { if ( ( rightInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { currentScope . problemReporter ( ) . fakeReachable ( this . right ) ; rightInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } } rightInfo = this . right . analyseCode ( currentScope , flowContext , rightInfo ) ; if ( ( this . left . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . left . checkNPE ( currentScope , flowContext , flowInfo ) ; } if ( ( this . right . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . right . checkNPE ( currentScope , flowContext , flowInfo ) ; } FlowInfo leftInfoWhenTrueForMerging = leftInfo . initsWhenTrue ( ) . unconditionalCopy ( ) . addPotentialInitializationsFrom ( rightInfo . unconditionalInitsWithoutSideEffect ( ) ) ; FlowInfo mergedInfo = FlowInfo . conditional ( leftInfoWhenTrueForMerging . unconditionalInits ( ) . mergedWith ( rightInfo . safeInitsWhenTrue ( ) . setReachMode ( previousMode ) . unconditionalInits ( ) ) , rightInfo . initsWhenFalse ( ) ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } Constant cst = this . right . constant ; if ( cst != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) codeStream . iconst_1 ( ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } BranchLabel trueLabel = new BranchLabel ( codeStream ) , endLabel ; cst = this . left . optimizedBooleanConstant ( ) ; boolean leftIsConst = cst != Constant . NotAConstant ; boolean leftIsTrue = leftIsConst && cst . booleanValue ( ) == true ; cst = this . right . optimizedBooleanConstant ( ) ; boolean rightIsConst = cst != Constant . NotAConstant ; boolean rightIsTrue = rightIsConst && cst . booleanValue ( ) == true ; generateOperands : { if ( leftIsConst ) { this . left . generateCode ( currentScope , codeStream , false ) ; if ( leftIsTrue ) { break generateOperands ; } } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , null , true ) ; } if ( this . rightInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . rightInitStateIndex ) ; } if ( rightIsConst ) { this . right . generateCode ( currentScope , codeStream , false ) ; } else { this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , null , valueRequired ) ; } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } if ( valueRequired ) { if ( leftIsConst && leftIsTrue ) { codeStream . iconst_1 ( ) ; codeStream . recordPositionsFrom ( codeStream . position , this . left . sourceEnd ) ; } else { if ( rightIsConst && rightIsTrue ) { codeStream . iconst_1 ( ) ; codeStream . recordPositionsFrom ( codeStream . position , this . left . sourceEnd ) ; } else { codeStream . iconst_0 ( ) ; } if ( trueLabel . forwardReferenceCount ( ) > <NUM_LIT:0> ) { if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; trueLabel . place ( ) ; codeStream . iconst_1 ( ) ; } else { codeStream . goto_ ( endLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; trueLabel . place ( ) ; codeStream . iconst_1 ( ) ; endLabel . place ( ) ; } } else { trueLabel . place ( ) ; } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } else { trueLabel . place ( ) ; } } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { if ( this . constant != Constant . NotAConstant ) { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } Constant cst = this . right . constant ; if ( cst != Constant . NotAConstant && cst . booleanValue ( ) == false ) { int pc = codeStream . position ; this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } cst = this . left . optimizedBooleanConstant ( ) ; boolean leftIsConst = cst != Constant . NotAConstant ; boolean leftIsTrue = leftIsConst && cst . booleanValue ( ) == true ; cst = this . right . optimizedBooleanConstant ( ) ; boolean rightIsConst = cst != Constant . NotAConstant ; boolean rightIsTrue = rightIsConst && cst . booleanValue ( ) == true ; generateOperands : { if ( falseLabel == null ) { if ( trueLabel != null ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , null , ! leftIsConst ) ; if ( leftIsTrue ) { if ( valueRequired ) codeStream . goto_ ( trueLabel ) ; codeStream . recordPositionsFrom ( codeStream . position , this . left . sourceEnd ) ; break generateOperands ; } if ( this . rightInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . rightInitStateIndex ) ; } this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , null , valueRequired && ! rightIsConst ) ; if ( valueRequired && rightIsTrue ) { codeStream . goto_ ( trueLabel ) ; codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } } } else { if ( trueLabel == null ) { BranchLabel internalTrueLabel = new BranchLabel ( codeStream ) ; this . left . generateOptimizedBoolean ( currentScope , codeStream , internalTrueLabel , null , ! leftIsConst ) ; if ( leftIsTrue ) { internalTrueLabel . place ( ) ; break generateOperands ; } if ( this . rightInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . rightInitStateIndex ) ; } this . right . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , valueRequired && ! rightIsConst ) ; int pc = codeStream . position ; if ( valueRequired && rightIsConst && ! rightIsTrue ) { codeStream . goto_ ( falseLabel ) ; codeStream . recordPositionsFrom ( pc , this . sourceEnd ) ; } internalTrueLabel . place ( ) ; } else { } } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } } public boolean isCompactableOperation ( ) { return false ; } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding result = super . resolveType ( scope ) ; Binding leftDirect = Expression . getDirectBinding ( this . left ) ; if ( leftDirect != null && leftDirect == Expression . getDirectBinding ( this . right ) ) { if ( ! ( this . right instanceof Assignment ) ) scope . problemReporter ( ) . comparingIdenticalExpressions ( this ) ; } return result ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . left . traverse ( visitor , scope ) ; this . right . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class CombinedBinaryExpression extends BinaryExpression { public int arity ; public int arityMax ; public static final int ARITY_MAX_MAX = <NUM_LIT> ; public static final int ARITY_MAX_MIN = <NUM_LIT:20> ; public static int defaultArityMaxStartingValue = ARITY_MAX_MIN ; public BinaryExpression referencesTable [ ] ; public CombinedBinaryExpression ( Expression left , Expression right , int operator , int arity ) { super ( left , right , operator ) ; initArity ( left , arity ) ; } public CombinedBinaryExpression ( CombinedBinaryExpression expression ) { super ( expression ) ; initArity ( expression . left , expression . arity ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . referencesTable == null ) { return super . analyseCode ( currentScope , flowContext , flowInfo ) ; } BinaryExpression cursor ; if ( ( cursor = this . referencesTable [ <NUM_LIT:0> ] ) . resolvedType . id != TypeIds . T_JavaLangString ) { cursor . left . checkNPE ( currentScope , flowContext , flowInfo ) ; } flowInfo = cursor . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; for ( int i = <NUM_LIT:0> , end = this . arity ; i < end ; i ++ ) { if ( ( cursor = this . referencesTable [ i ] ) . resolvedType . id != TypeIds . T_JavaLangString ) { cursor . right . checkNPE ( currentScope , flowContext , flowInfo ) ; } flowInfo = cursor . right . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } if ( this . resolvedType . id != TypeIds . T_JavaLangString ) { this . right . checkNPE ( currentScope , flowContext , flowInfo ) ; } return this . right . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } public void generateOptimizedStringConcatenation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { if ( this . referencesTable == null ) { super . generateOptimizedStringConcatenation ( blockScope , codeStream , typeID ) ; } else { if ( ( ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) && ( ( this . bits & ASTNode . ReturnTypeIDMASK ) == TypeIds . T_JavaLangString ) ) { if ( this . constant != Constant . NotAConstant ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . invokeStringConcatenationAppendForType ( this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; } else { BinaryExpression cursor = this . referencesTable [ <NUM_LIT:0> ] ; int restart = <NUM_LIT:0> ; int pc = codeStream . position ; for ( restart = this . arity - <NUM_LIT:1> ; restart >= <NUM_LIT:0> ; restart -- ) { if ( ( cursor = this . referencesTable [ restart ] ) . constant != Constant . NotAConstant ) { codeStream . generateConstant ( cursor . constant , cursor . implicitConversion ) ; codeStream . invokeStringConcatenationAppendForType ( cursor . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; break ; } } restart ++ ; if ( restart == <NUM_LIT:0> ) { cursor . left . generateOptimizedStringConcatenation ( blockScope , codeStream , cursor . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; } int pcAux ; for ( int i = restart ; i < this . arity ; i ++ ) { codeStream . recordPositionsFrom ( pc , ( cursor = this . referencesTable [ i ] ) . left . sourceStart ) ; pcAux = codeStream . position ; cursor . right . generateOptimizedStringConcatenation ( blockScope , codeStream , cursor . right . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pcAux , cursor . right . sourceStart ) ; } codeStream . recordPositionsFrom ( pc , this . left . sourceStart ) ; pc = codeStream . position ; this . right . generateOptimizedStringConcatenation ( blockScope , codeStream , this . right . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pc , this . right . sourceStart ) ; } } else { super . generateOptimizedStringConcatenation ( blockScope , codeStream , typeID ) ; } } } public void generateOptimizedStringConcatenationCreation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { if ( this . referencesTable == null ) { super . generateOptimizedStringConcatenationCreation ( blockScope , codeStream , typeID ) ; } else { if ( ( ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) && ( ( this . bits & ASTNode . ReturnTypeIDMASK ) == TypeIds . T_JavaLangString ) && this . constant == Constant . NotAConstant ) { int pc = codeStream . position ; BinaryExpression cursor = this . referencesTable [ this . arity - <NUM_LIT:1> ] ; int restart = <NUM_LIT:0> ; for ( restart = this . arity - <NUM_LIT:1> ; restart >= <NUM_LIT:0> ; restart -- ) { if ( ( ( ( ( cursor = this . referencesTable [ restart ] ) . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) && ( ( cursor . bits & ASTNode . ReturnTypeIDMASK ) == TypeIds . T_JavaLangString ) ) { if ( cursor . constant != Constant . NotAConstant ) { codeStream . newStringContatenation ( ) ; codeStream . dup ( ) ; codeStream . ldc ( cursor . constant . stringValue ( ) ) ; codeStream . invokeStringConcatenationStringConstructor ( ) ; break ; } } else { cursor . generateOptimizedStringConcatenationCreation ( blockScope , codeStream , cursor . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; break ; } } restart ++ ; if ( restart == <NUM_LIT:0> ) { cursor . left . generateOptimizedStringConcatenationCreation ( blockScope , codeStream , cursor . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; } int pcAux ; for ( int i = restart ; i < this . arity ; i ++ ) { codeStream . recordPositionsFrom ( pc , ( cursor = this . referencesTable [ i ] ) . left . sourceStart ) ; pcAux = codeStream . position ; cursor . right . generateOptimizedStringConcatenation ( blockScope , codeStream , cursor . right . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pcAux , cursor . right . sourceStart ) ; } codeStream . recordPositionsFrom ( pc , this . left . sourceStart ) ; pc = codeStream . position ; this . right . generateOptimizedStringConcatenation ( blockScope , codeStream , this . right . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pc , this . right . sourceStart ) ; } else { super . generateOptimizedStringConcatenationCreation ( blockScope , codeStream , typeID ) ; } } } private void initArity ( Expression expression , int value ) { this . arity = value ; if ( value > <NUM_LIT:1> ) { this . referencesTable = new BinaryExpression [ value ] ; this . referencesTable [ value - <NUM_LIT:1> ] = ( BinaryExpression ) expression ; for ( int i = value - <NUM_LIT:1> ; i > <NUM_LIT:0> ; i -- ) { this . referencesTable [ i - <NUM_LIT:1> ] = ( BinaryExpression ) this . referencesTable [ i ] . left ; } } else { this . arityMax = defaultArityMaxStartingValue ; } } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { if ( this . referencesTable == null ) { return super . printExpressionNoParenthesis ( indent , output ) ; } String operatorString = operatorToString ( ) ; for ( int i = this . arity - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { output . append ( '<CHAR_LIT:(>' ) ; } output = this . referencesTable [ <NUM_LIT:0> ] . left . printExpression ( indent , output ) ; for ( int i = <NUM_LIT:0> , end = this . arity ; i < end ; i ++ ) { output . append ( '<CHAR_LIT:U+0020>' ) . append ( operatorString ) . append ( '<CHAR_LIT:U+0020>' ) ; output = this . referencesTable [ i ] . right . printExpression ( <NUM_LIT:0> , output ) ; output . append ( '<CHAR_LIT:)>' ) ; } output . append ( '<CHAR_LIT:U+0020>' ) . append ( operatorString ) . append ( '<CHAR_LIT:U+0020>' ) ; return this . right . printExpression ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { if ( this . referencesTable == null ) { return super . resolveType ( scope ) ; } BinaryExpression cursor ; if ( ( cursor = this . referencesTable [ <NUM_LIT:0> ] ) . left instanceof CastExpression ) { cursor . left . bits |= ASTNode . DisableUnnecessaryCastCheck ; } cursor . left . resolveType ( scope ) ; for ( int i = <NUM_LIT:0> , end = this . arity ; i < end ; i ++ ) { this . referencesTable [ i ] . nonRecursiveResolveTypeUpwards ( scope ) ; } nonRecursiveResolveTypeUpwards ( scope ) ; return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( this . referencesTable == null ) { super . traverse ( visitor , scope ) ; } else { if ( visitor . visit ( this , scope ) ) { int restart ; for ( restart = this . arity - <NUM_LIT:1> ; restart >= <NUM_LIT:0> ; restart -- ) { if ( ! visitor . visit ( this . referencesTable [ restart ] , scope ) ) { visitor . endVisit ( this . referencesTable [ restart ] , scope ) ; break ; } } restart ++ ; if ( restart == <NUM_LIT:0> ) { this . referencesTable [ <NUM_LIT:0> ] . left . traverse ( visitor , scope ) ; } for ( int i = restart , end = this . arity ; i < end ; i ++ ) { this . referencesTable [ i ] . right . traverse ( visitor , scope ) ; visitor . endVisit ( this . referencesTable [ i ] , scope ) ; } this . right . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } public void tuneArityMax ( ) { if ( this . arityMax < ARITY_MAX_MAX ) { this . arityMax *= <NUM_LIT:2> ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class TryStatement extends SubRoutineStatement { static final char [ ] SECRET_RETURN_ADDRESS_NAME = "<STR_LIT>" . toCharArray ( ) ; static final char [ ] SECRET_ANY_HANDLER_NAME = "<STR_LIT>" . toCharArray ( ) ; static final char [ ] SECRET_PRIMARY_EXCEPTION_VARIABLE_NAME = "<STR_LIT>" . toCharArray ( ) ; static final char [ ] SECRET_CAUGHT_THROWABLE_VARIABLE_NAME = "<STR_LIT>" . toCharArray ( ) ; static final char [ ] SECRET_RETURN_VALUE_NAME = "<STR_LIT>" . toCharArray ( ) ; private static LocalDeclaration [ ] NO_RESOURCES = new LocalDeclaration [ <NUM_LIT:0> ] ; public LocalDeclaration [ ] resources = NO_RESOURCES ; public Block tryBlock ; public Block [ ] catchBlocks ; public Argument [ ] catchArguments ; public Block finallyBlock ; BlockScope scope ; public UnconditionalFlowInfo subRoutineInits ; ReferenceBinding [ ] caughtExceptionTypes ; boolean [ ] catchExits ; BranchLabel subRoutineStartLabel ; public LocalVariableBinding anyExceptionVariable , returnAddressVariable , secretReturnValue ; ExceptionLabel [ ] declaredExceptionLabels ; private Object [ ] reusableJSRTargets ; private BranchLabel [ ] reusableJSRSequenceStartLabels ; private int [ ] reusableJSRStateIndexes ; private int reusableJSRTargetsCount = <NUM_LIT:0> ; private static final int NO_FINALLY = <NUM_LIT:0> ; private static final int FINALLY_SUBROUTINE = <NUM_LIT:1> ; private static final int FINALLY_DOES_NOT_COMPLETE = <NUM_LIT:2> ; private static final int FINALLY_INLINE = <NUM_LIT:3> ; int mergedInitStateIndex = - <NUM_LIT:1> ; int preTryInitStateIndex = - <NUM_LIT:1> ; int postTryInitStateIndex = - <NUM_LIT:1> ; int [ ] postResourcesInitStateIndexes ; int naturalExitMergeInitStateIndex = - <NUM_LIT:1> ; int [ ] catchExitInitStateIndexes ; private LocalVariableBinding primaryExceptionVariable ; private LocalVariableBinding caughtThrowableVariable ; private ExceptionLabel [ ] resourceExceptionLabels ; private int [ ] caughtExceptionsCatchBlocks ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . preTryInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; if ( this . anyExceptionVariable != null ) { this . anyExceptionVariable . useFlag = LocalVariableBinding . USED ; } if ( this . primaryExceptionVariable != null ) { this . primaryExceptionVariable . useFlag = LocalVariableBinding . USED ; } if ( this . caughtThrowableVariable != null ) { this . caughtThrowableVariable . useFlag = LocalVariableBinding . USED ; } if ( this . returnAddressVariable != null ) { this . returnAddressVariable . useFlag = LocalVariableBinding . USED ; } int resourcesLength = this . resources . length ; if ( resourcesLength > <NUM_LIT:0> ) { this . postResourcesInitStateIndexes = new int [ resourcesLength ] ; } if ( this . subRoutineStartLabel == null ) { ExceptionHandlingFlowContext handlingContext = new ExceptionHandlingFlowContext ( flowContext , this , this . caughtExceptionTypes , this . caughtExceptionsCatchBlocks , this . catchArguments , null , this . scope , flowInfo . unconditionalInits ( ) ) ; handlingContext . initsOnFinally = new NullInfoRegistry ( flowInfo . unconditionalInits ( ) ) ; FlowInfo tryInfo = flowInfo . copy ( ) ; for ( int i = <NUM_LIT:0> ; i < resourcesLength ; i ++ ) { final LocalDeclaration resource = this . resources [ i ] ; tryInfo = resource . analyseCode ( currentScope , handlingContext , tryInfo ) ; this . postResourcesInitStateIndexes [ i ] = currentScope . methodScope ( ) . recordInitializationStates ( tryInfo ) ; LocalVariableBinding resourceBinding = resource . binding ; resourceBinding . useFlag = LocalVariableBinding . USED ; if ( resourceBinding . closeTracker != null ) { this . tryBlock . scope . removeTrackingVar ( resourceBinding . closeTracker ) ; } TypeBinding type = resourceBinding . type ; if ( type != null && type . isValidBinding ( ) ) { ReferenceBinding binding = ( ReferenceBinding ) type ; MethodBinding closeMethod = binding . getExactMethod ( ConstantPool . Close , new TypeBinding [ <NUM_LIT:0> ] , this . scope . compilationUnitScope ( ) ) ; if ( closeMethod == null ) { InvocationSite site = new InvocationSite ( ) { public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public boolean isSuperAccess ( ) { return false ; } public boolean isTypeAccess ( ) { return false ; } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public int sourceEnd ( ) { return resource . sourceEnd ( ) ; } public int sourceStart ( ) { return resource . sourceStart ( ) ; } public TypeBinding expectedType ( ) { return null ; } } ; closeMethod = this . scope . compilationUnitScope ( ) . findMethod ( binding , ConstantPool . Close , new TypeBinding [ <NUM_LIT:0> ] , site , false ) ; } if ( closeMethod != null && closeMethod . isValidBinding ( ) && closeMethod . returnType . id == TypeIds . T_void ) { ReferenceBinding [ ] thrownExceptions = closeMethod . thrownExceptions ; for ( int j = <NUM_LIT:0> , length = thrownExceptions . length ; j < length ; j ++ ) { handlingContext . checkExceptionHandlers ( thrownExceptions [ j ] , this . resources [ i ] , tryInfo , currentScope , true ) ; } } } } if ( ! this . tryBlock . isEmptyBlock ( ) ) { tryInfo = this . tryBlock . analyseCode ( currentScope , handlingContext , tryInfo ) ; if ( ( tryInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) this . bits |= ASTNode . IsTryBlockExiting ; } if ( resourcesLength > <NUM_LIT:0> ) { this . postTryInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( tryInfo ) ; for ( int i = <NUM_LIT:0> ; i < resourcesLength ; i ++ ) { tryInfo . resetAssignmentInfo ( this . resources [ i ] . binding ) ; } } handlingContext . complainIfUnusedExceptionHandlers ( this . scope , this ) ; if ( this . catchArguments != null ) { int catchCount ; this . catchExits = new boolean [ catchCount = this . catchBlocks . length ] ; this . catchExitInitStateIndexes = new int [ catchCount ] ; for ( int i = <NUM_LIT:0> ; i < catchCount ; i ++ ) { FlowInfo catchInfo ; if ( isUncheckedCatchBlock ( i ) ) { catchInfo = handlingContext . initsOnFinally . mitigateNullInfoOf ( flowInfo . unconditionalCopy ( ) . addPotentialInitializationsFrom ( handlingContext . initsOnException ( i ) ) . addPotentialInitializationsFrom ( tryInfo ) . addPotentialInitializationsFrom ( handlingContext . initsOnReturn ) ) ; } else { FlowInfo initsOnException = handlingContext . initsOnException ( i ) ; catchInfo = flowInfo . nullInfoLessUnconditionalCopy ( ) . addPotentialInitializationsFrom ( initsOnException ) . addNullInfoFrom ( initsOnException ) . addPotentialInitializationsFrom ( tryInfo . nullInfoLessUnconditionalCopy ( ) ) . addPotentialInitializationsFrom ( handlingContext . initsOnReturn . nullInfoLessUnconditionalCopy ( ) ) ; } LocalVariableBinding catchArg = this . catchArguments [ i ] . binding ; catchInfo . markAsDefinitelyAssigned ( catchArg ) ; catchInfo . markAsDefinitelyNonNull ( catchArg ) ; if ( this . tryBlock . statements == null && this . resources == NO_RESOURCES ) { catchInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } catchInfo = this . catchBlocks [ i ] . analyseCode ( currentScope , flowContext , catchInfo ) ; this . catchExitInitStateIndexes [ i ] = currentScope . methodScope ( ) . recordInitializationStates ( catchInfo ) ; this . catchExits [ i ] = ( catchInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ; tryInfo = tryInfo . mergedWith ( catchInfo . unconditionalInits ( ) ) ; } } this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( tryInfo ) ; if ( flowContext . initsOnFinally != null ) { flowContext . initsOnFinally . add ( handlingContext . initsOnFinally ) ; } return tryInfo ; } else { InsideSubRoutineFlowContext insideSubContext ; FinallyFlowContext finallyContext ; UnconditionalFlowInfo subInfo ; insideSubContext = new InsideSubRoutineFlowContext ( flowContext , this ) ; subInfo = this . finallyBlock . analyseCode ( currentScope , finallyContext = new FinallyFlowContext ( flowContext , this . finallyBlock ) , flowInfo . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; if ( subInfo == FlowInfo . DEAD_END ) { this . bits |= ASTNode . IsSubRoutineEscaping ; this . scope . problemReporter ( ) . finallyMustCompleteNormally ( this . finallyBlock ) ; } else { FlowInfo finallyInfo = subInfo . copy ( ) ; this . tryBlock . scope . finallyInfo = finallyInfo ; if ( this . catchBlocks != null ) { for ( int i = <NUM_LIT:0> ; i < this . catchBlocks . length ; i ++ ) this . catchBlocks [ i ] . scope . finallyInfo = finallyInfo ; } } this . subRoutineInits = subInfo ; ExceptionHandlingFlowContext handlingContext = new ExceptionHandlingFlowContext ( insideSubContext , this , this . caughtExceptionTypes , this . caughtExceptionsCatchBlocks , this . catchArguments , null , this . scope , flowInfo . unconditionalInits ( ) ) ; handlingContext . initsOnFinally = new NullInfoRegistry ( flowInfo . unconditionalInits ( ) ) ; FlowInfo tryInfo = flowInfo . copy ( ) ; for ( int i = <NUM_LIT:0> ; i < resourcesLength ; i ++ ) { final LocalDeclaration resource = this . resources [ i ] ; tryInfo = resource . analyseCode ( currentScope , handlingContext , tryInfo ) ; this . postResourcesInitStateIndexes [ i ] = currentScope . methodScope ( ) . recordInitializationStates ( tryInfo ) ; LocalVariableBinding resourceBinding = resource . binding ; resourceBinding . useFlag = LocalVariableBinding . USED ; if ( resourceBinding . closeTracker != null ) { this . tryBlock . scope . removeTrackingVar ( resourceBinding . closeTracker ) ; } TypeBinding type = resourceBinding . type ; if ( type != null && type . isValidBinding ( ) ) { ReferenceBinding binding = ( ReferenceBinding ) type ; MethodBinding closeMethod = binding . getExactMethod ( ConstantPool . Close , new TypeBinding [ <NUM_LIT:0> ] , this . scope . compilationUnitScope ( ) ) ; if ( closeMethod == null ) { InvocationSite site = new InvocationSite ( ) { public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public boolean isSuperAccess ( ) { return false ; } public boolean isTypeAccess ( ) { return false ; } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public int sourceEnd ( ) { return resource . sourceEnd ( ) ; } public int sourceStart ( ) { return resource . sourceStart ( ) ; } public TypeBinding expectedType ( ) { return null ; } } ; closeMethod = this . scope . compilationUnitScope ( ) . findMethod ( binding , ConstantPool . Close , new TypeBinding [ <NUM_LIT:0> ] , site , false ) ; } if ( closeMethod != null && closeMethod . isValidBinding ( ) && closeMethod . returnType . id == TypeIds . T_void ) { ReferenceBinding [ ] thrownExceptions = closeMethod . thrownExceptions ; for ( int j = <NUM_LIT:0> , length = thrownExceptions . length ; j < length ; j ++ ) { handlingContext . checkExceptionHandlers ( thrownExceptions [ j ] , this . resources [ i ] , tryInfo , currentScope , true ) ; } } } } if ( ! this . tryBlock . isEmptyBlock ( ) ) { tryInfo = this . tryBlock . analyseCode ( currentScope , handlingContext , tryInfo ) ; if ( ( tryInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) this . bits |= ASTNode . IsTryBlockExiting ; } if ( resourcesLength > <NUM_LIT:0> ) { this . postTryInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( tryInfo ) ; for ( int i = <NUM_LIT:0> ; i < resourcesLength ; i ++ ) { tryInfo . resetAssignmentInfo ( this . resources [ i ] . binding ) ; } } handlingContext . complainIfUnusedExceptionHandlers ( this . scope , this ) ; if ( this . catchArguments != null ) { int catchCount ; this . catchExits = new boolean [ catchCount = this . catchBlocks . length ] ; this . catchExitInitStateIndexes = new int [ catchCount ] ; for ( int i = <NUM_LIT:0> ; i < catchCount ; i ++ ) { FlowInfo catchInfo ; if ( isUncheckedCatchBlock ( i ) ) { catchInfo = handlingContext . initsOnFinally . mitigateNullInfoOf ( flowInfo . unconditionalCopy ( ) . addPotentialInitializationsFrom ( handlingContext . initsOnException ( i ) ) . addPotentialInitializationsFrom ( tryInfo ) . addPotentialInitializationsFrom ( handlingContext . initsOnReturn ) ) ; } else { FlowInfo initsOnException = handlingContext . initsOnException ( i ) ; catchInfo = flowInfo . nullInfoLessUnconditionalCopy ( ) . addPotentialInitializationsFrom ( initsOnException ) . addNullInfoFrom ( initsOnException ) . addPotentialInitializationsFrom ( tryInfo . nullInfoLessUnconditionalCopy ( ) ) . addPotentialInitializationsFrom ( handlingContext . initsOnReturn . nullInfoLessUnconditionalCopy ( ) ) ; } LocalVariableBinding catchArg = this . catchArguments [ i ] . binding ; catchInfo . markAsDefinitelyAssigned ( catchArg ) ; catchInfo . markAsDefinitelyNonNull ( catchArg ) ; if ( this . tryBlock . statements == null && this . resources == NO_RESOURCES ) { catchInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } catchInfo = this . catchBlocks [ i ] . analyseCode ( currentScope , insideSubContext , catchInfo ) ; this . catchExitInitStateIndexes [ i ] = currentScope . methodScope ( ) . recordInitializationStates ( catchInfo ) ; this . catchExits [ i ] = ( catchInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ; tryInfo = tryInfo . mergedWith ( catchInfo . unconditionalInits ( ) ) ; } } finallyContext . complainOnDeferredChecks ( handlingContext . initsOnFinally . mitigateNullInfoOf ( ( tryInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ? flowInfo . unconditionalCopy ( ) . addPotentialInitializationsFrom ( tryInfo ) . addPotentialInitializationsFrom ( insideSubContext . initsOnReturn ) : insideSubContext . initsOnReturn ) , currentScope ) ; if ( flowContext . initsOnFinally != null ) { flowContext . initsOnFinally . add ( handlingContext . initsOnFinally ) ; } this . naturalExitMergeInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( tryInfo ) ; if ( subInfo == FlowInfo . DEAD_END ) { this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( subInfo ) ; return subInfo ; } else { FlowInfo mergedInfo = tryInfo . addInitializationsFrom ( subInfo ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } } } private boolean isUncheckedCatchBlock ( int catchBlock ) { if ( this . caughtExceptionsCatchBlocks == null ) { return this . caughtExceptionTypes [ catchBlock ] . isUncheckedException ( true ) ; } for ( int i = <NUM_LIT:0> , length = this . caughtExceptionsCatchBlocks . length ; i < length ; i ++ ) { if ( this . caughtExceptionsCatchBlocks [ i ] == catchBlock ) { if ( this . caughtExceptionTypes [ i ] . isUncheckedException ( true ) ) { return true ; } } } return false ; } public ExceptionLabel enterAnyExceptionHandler ( CodeStream codeStream ) { if ( this . subRoutineStartLabel == null ) return null ; return super . enterAnyExceptionHandler ( codeStream ) ; } public void enterDeclaredExceptionHandlers ( CodeStream codeStream ) { for ( int i = <NUM_LIT:0> , length = this . declaredExceptionLabels == null ? <NUM_LIT:0> : this . declaredExceptionLabels . length ; i < length ; i ++ ) { this . declaredExceptionLabels [ i ] . placeStart ( ) ; } } public void exitAnyExceptionHandler ( ) { if ( this . subRoutineStartLabel == null ) return ; super . exitAnyExceptionHandler ( ) ; } public void exitDeclaredExceptionHandlers ( CodeStream codeStream ) { for ( int i = <NUM_LIT:0> , length = this . declaredExceptionLabels == null ? <NUM_LIT:0> : this . declaredExceptionLabels . length ; i < length ; i ++ ) { this . declaredExceptionLabels [ i ] . placeEnd ( ) ; } } private int finallyMode ( ) { if ( this . subRoutineStartLabel == null ) { return NO_FINALLY ; } else if ( isSubRoutineEscaping ( ) ) { return FINALLY_DOES_NOT_COMPLETE ; } else if ( this . scope . compilerOptions ( ) . inlineJsrBytecode ) { return FINALLY_INLINE ; } else { return FINALLY_SUBROUTINE ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } boolean isStackMapFrameCodeStream = codeStream instanceof StackMapFrameCodeStream ; this . anyExceptionLabel = null ; this . reusableJSRTargets = null ; this . reusableJSRSequenceStartLabels = null ; this . reusableJSRTargetsCount = <NUM_LIT:0> ; int pc = codeStream . position ; int finallyMode = finallyMode ( ) ; boolean requiresNaturalExit = false ; int maxCatches = this . catchArguments == null ? <NUM_LIT:0> : this . catchArguments . length ; ExceptionLabel [ ] exceptionLabels ; if ( maxCatches > <NUM_LIT:0> ) { exceptionLabels = new ExceptionLabel [ maxCatches ] ; for ( int i = <NUM_LIT:0> ; i < maxCatches ; i ++ ) { Argument argument = this . catchArguments [ i ] ; ExceptionLabel exceptionLabel = null ; if ( ( argument . binding . tagBits & TagBits . MultiCatchParameter ) != <NUM_LIT:0> ) { MultiCatchExceptionLabel multiCatchExceptionLabel = new MultiCatchExceptionLabel ( codeStream , argument . binding . type ) ; multiCatchExceptionLabel . initialize ( ( UnionTypeReference ) argument . type ) ; exceptionLabel = multiCatchExceptionLabel ; } else { exceptionLabel = new ExceptionLabel ( codeStream , argument . binding . type ) ; } exceptionLabel . placeStart ( ) ; exceptionLabels [ i ] = exceptionLabel ; } } else { exceptionLabels = null ; } if ( this . subRoutineStartLabel != null ) { this . subRoutineStartLabel . initialize ( codeStream ) ; enterAnyExceptionHandler ( codeStream ) ; } try { this . declaredExceptionLabels = exceptionLabels ; int resourceCount = this . resources . length ; if ( resourceCount > <NUM_LIT:0> ) { this . resourceExceptionLabels = new ExceptionLabel [ resourceCount + <NUM_LIT:1> ] ; codeStream . aconst_null ( ) ; codeStream . store ( this . primaryExceptionVariable , false ) ; codeStream . addVariable ( this . primaryExceptionVariable ) ; codeStream . aconst_null ( ) ; codeStream . store ( this . caughtThrowableVariable , false ) ; codeStream . addVariable ( this . caughtThrowableVariable ) ; for ( int i = <NUM_LIT:0> ; i <= resourceCount ; i ++ ) { this . resourceExceptionLabels [ i ] = new ExceptionLabel ( codeStream , null ) ; this . resourceExceptionLabels [ i ] . placeStart ( ) ; if ( i < resourceCount ) { this . resources [ i ] . generateCode ( this . scope , codeStream ) ; } } } this . tryBlock . generateCode ( this . scope , codeStream ) ; if ( resourceCount > <NUM_LIT:0> ) { for ( int i = resourceCount ; i >= <NUM_LIT:0> ; i -- ) { BranchLabel exitLabel = new BranchLabel ( codeStream ) ; this . resourceExceptionLabels [ i ] . placeEnd ( ) ; LocalVariableBinding localVariable = i > <NUM_LIT:0> ? this . resources [ i - <NUM_LIT:1> ] . binding : null ; if ( ( this . bits & ASTNode . IsTryBlockExiting ) == <NUM_LIT:0> ) { if ( i > <NUM_LIT:0> ) { int invokeCloseStartPc = codeStream . position ; if ( this . postTryInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . postTryInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . postTryInitStateIndex ) ; } codeStream . load ( localVariable ) ; codeStream . ifnull ( exitLabel ) ; codeStream . load ( localVariable ) ; codeStream . invokeAutoCloseableClose ( localVariable . type ) ; codeStream . recordPositionsFrom ( invokeCloseStartPc , this . tryBlock . sourceEnd ) ; } codeStream . goto_ ( exitLabel ) ; } if ( i > <NUM_LIT:0> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . postResourcesInitStateIndexes [ i - <NUM_LIT:1> ] ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . postResourcesInitStateIndexes [ i - <NUM_LIT:1> ] ) ; } else { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; } codeStream . pushExceptionOnStack ( this . scope . getJavaLangThrowable ( ) ) ; this . resourceExceptionLabels [ i ] . place ( ) ; if ( i == resourceCount ) { codeStream . store ( this . primaryExceptionVariable , false ) ; } else { BranchLabel elseLabel = new BranchLabel ( codeStream ) , postElseLabel = new BranchLabel ( codeStream ) ; codeStream . store ( this . caughtThrowableVariable , false ) ; codeStream . load ( this . primaryExceptionVariable ) ; codeStream . ifnonnull ( elseLabel ) ; codeStream . load ( this . caughtThrowableVariable ) ; codeStream . store ( this . primaryExceptionVariable , false ) ; codeStream . goto_ ( postElseLabel ) ; elseLabel . place ( ) ; codeStream . load ( this . primaryExceptionVariable ) ; codeStream . load ( this . caughtThrowableVariable ) ; codeStream . if_acmpeq ( postElseLabel ) ; codeStream . load ( this . primaryExceptionVariable ) ; codeStream . load ( this . caughtThrowableVariable ) ; codeStream . invokeThrowableAddSuppressed ( ) ; postElseLabel . place ( ) ; } if ( i > <NUM_LIT:0> ) { BranchLabel postCloseLabel = new BranchLabel ( codeStream ) ; int invokeCloseStartPc = codeStream . position ; codeStream . load ( localVariable ) ; codeStream . ifnull ( postCloseLabel ) ; codeStream . load ( localVariable ) ; codeStream . invokeAutoCloseableClose ( localVariable . type ) ; codeStream . recordPositionsFrom ( invokeCloseStartPc , this . tryBlock . sourceEnd ) ; codeStream . removeVariable ( localVariable ) ; postCloseLabel . place ( ) ; } codeStream . load ( this . primaryExceptionVariable ) ; codeStream . athrow ( ) ; exitLabel . place ( ) ; } codeStream . removeVariable ( this . primaryExceptionVariable ) ; codeStream . removeVariable ( this . caughtThrowableVariable ) ; } } finally { this . declaredExceptionLabels = null ; this . resourceExceptionLabels = null ; } boolean tryBlockHasSomeCode = codeStream . position != pc ; if ( tryBlockHasSomeCode ) { BranchLabel naturalExitLabel = new BranchLabel ( codeStream ) ; BranchLabel postCatchesFinallyLabel = null ; for ( int i = <NUM_LIT:0> ; i < maxCatches ; i ++ ) { exceptionLabels [ i ] . placeEnd ( ) ; } if ( ( this . bits & ASTNode . IsTryBlockExiting ) == <NUM_LIT:0> ) { int position = codeStream . position ; switch ( finallyMode ) { case FINALLY_SUBROUTINE : case FINALLY_INLINE : requiresNaturalExit = true ; if ( this . naturalExitMergeInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; } codeStream . goto_ ( naturalExitLabel ) ; break ; case NO_FINALLY : if ( this . naturalExitMergeInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; } codeStream . goto_ ( naturalExitLabel ) ; break ; case FINALLY_DOES_NOT_COMPLETE : codeStream . goto_ ( this . subRoutineStartLabel ) ; break ; } codeStream . recordPositionsFrom ( position , this . tryBlock . sourceEnd ) ; } exitAnyExceptionHandler ( ) ; if ( this . catchArguments != null ) { postCatchesFinallyLabel = new BranchLabel ( codeStream ) ; for ( int i = <NUM_LIT:0> ; i < maxCatches ; i ++ ) { if ( exceptionLabels [ i ] . getCount ( ) == <NUM_LIT:0> ) continue ; enterAnyExceptionHandler ( codeStream ) ; if ( this . preTryInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; } codeStream . pushExceptionOnStack ( exceptionLabels [ i ] . exceptionType ) ; exceptionLabels [ i ] . place ( ) ; LocalVariableBinding catchVar ; int varPC = codeStream . position ; if ( ( catchVar = this . catchArguments [ i ] . binding ) . resolvedPosition != - <NUM_LIT:1> ) { codeStream . store ( catchVar , false ) ; catchVar . recordInitializationStartPC ( codeStream . position ) ; codeStream . addVisibleLocalVariable ( catchVar ) ; } else { codeStream . pop ( ) ; } codeStream . recordPositionsFrom ( varPC , this . catchArguments [ i ] . sourceStart ) ; this . catchBlocks [ i ] . generateCode ( this . scope , codeStream ) ; exitAnyExceptionHandler ( ) ; if ( ! this . catchExits [ i ] ) { switch ( finallyMode ) { case FINALLY_INLINE : if ( isStackMapFrameCodeStream ) { ( ( StackMapFrameCodeStream ) codeStream ) . pushStateIndex ( this . naturalExitMergeInitStateIndex ) ; } if ( this . catchExitInitStateIndexes [ i ] != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . catchExitInitStateIndexes [ i ] ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . catchExitInitStateIndexes [ i ] ) ; } this . finallyBlock . generateCode ( this . scope , codeStream ) ; codeStream . goto_ ( postCatchesFinallyLabel ) ; if ( isStackMapFrameCodeStream ) { ( ( StackMapFrameCodeStream ) codeStream ) . popStateIndex ( ) ; } break ; case FINALLY_SUBROUTINE : requiresNaturalExit = true ; case NO_FINALLY : if ( this . naturalExitMergeInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; } codeStream . goto_ ( naturalExitLabel ) ; break ; case FINALLY_DOES_NOT_COMPLETE : codeStream . goto_ ( this . subRoutineStartLabel ) ; break ; } } } } ExceptionLabel naturalExitExceptionHandler = requiresNaturalExit && ( finallyMode == FINALLY_SUBROUTINE ) ? new ExceptionLabel ( codeStream , null ) : null ; int finallySequenceStartPC = codeStream . position ; if ( this . subRoutineStartLabel != null && this . anyExceptionLabel . getCount ( ) != <NUM_LIT:0> ) { codeStream . pushExceptionOnStack ( this . scope . getJavaLangThrowable ( ) ) ; if ( this . preTryInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; } placeAllAnyExceptionHandler ( ) ; if ( naturalExitExceptionHandler != null ) naturalExitExceptionHandler . place ( ) ; switch ( finallyMode ) { case FINALLY_SUBROUTINE : codeStream . store ( this . anyExceptionVariable , false ) ; codeStream . jsr ( this . subRoutineStartLabel ) ; codeStream . recordPositionsFrom ( finallySequenceStartPC , this . finallyBlock . sourceStart ) ; int position = codeStream . position ; codeStream . throwAnyException ( this . anyExceptionVariable ) ; codeStream . recordPositionsFrom ( position , this . finallyBlock . sourceEnd ) ; this . subRoutineStartLabel . place ( ) ; codeStream . pushExceptionOnStack ( this . scope . getJavaLangThrowable ( ) ) ; position = codeStream . position ; codeStream . store ( this . returnAddressVariable , false ) ; codeStream . recordPositionsFrom ( position , this . finallyBlock . sourceStart ) ; this . finallyBlock . generateCode ( this . scope , codeStream ) ; position = codeStream . position ; codeStream . ret ( this . returnAddressVariable . resolvedPosition ) ; codeStream . recordPositionsFrom ( position , this . finallyBlock . sourceEnd ) ; break ; case FINALLY_INLINE : codeStream . store ( this . anyExceptionVariable , false ) ; codeStream . addVariable ( this . anyExceptionVariable ) ; codeStream . recordPositionsFrom ( finallySequenceStartPC , this . finallyBlock . sourceStart ) ; this . finallyBlock . generateCode ( currentScope , codeStream ) ; position = codeStream . position ; codeStream . throwAnyException ( this . anyExceptionVariable ) ; codeStream . removeVariable ( this . anyExceptionVariable ) ; if ( this . preTryInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preTryInitStateIndex ) ; } this . subRoutineStartLabel . place ( ) ; codeStream . recordPositionsFrom ( position , this . finallyBlock . sourceEnd ) ; break ; case FINALLY_DOES_NOT_COMPLETE : codeStream . pop ( ) ; this . subRoutineStartLabel . place ( ) ; codeStream . recordPositionsFrom ( finallySequenceStartPC , this . finallyBlock . sourceStart ) ; this . finallyBlock . generateCode ( this . scope , codeStream ) ; break ; } if ( requiresNaturalExit ) { switch ( finallyMode ) { case FINALLY_SUBROUTINE : naturalExitLabel . place ( ) ; int position = codeStream . position ; naturalExitExceptionHandler . placeStart ( ) ; codeStream . jsr ( this . subRoutineStartLabel ) ; naturalExitExceptionHandler . placeEnd ( ) ; codeStream . recordPositionsFrom ( position , this . finallyBlock . sourceEnd ) ; break ; case FINALLY_INLINE : if ( isStackMapFrameCodeStream ) { ( ( StackMapFrameCodeStream ) codeStream ) . pushStateIndex ( this . naturalExitMergeInitStateIndex ) ; } if ( this . naturalExitMergeInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . naturalExitMergeInitStateIndex ) ; } naturalExitLabel . place ( ) ; this . finallyBlock . generateCode ( this . scope , codeStream ) ; if ( postCatchesFinallyLabel != null ) { position = codeStream . position ; codeStream . goto_ ( postCatchesFinallyLabel ) ; codeStream . recordPositionsFrom ( position , this . finallyBlock . sourceEnd ) ; } if ( isStackMapFrameCodeStream ) { ( ( StackMapFrameCodeStream ) codeStream ) . popStateIndex ( ) ; } break ; case FINALLY_DOES_NOT_COMPLETE : break ; default : naturalExitLabel . place ( ) ; break ; } } if ( postCatchesFinallyLabel != null ) { postCatchesFinallyLabel . place ( ) ; } } else { naturalExitLabel . place ( ) ; } } else { if ( this . subRoutineStartLabel != null ) { this . finallyBlock . generateCode ( this . scope , codeStream ) ; } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public boolean generateSubRoutineInvocation ( BlockScope currentScope , CodeStream codeStream , Object targetLocation , int stateIndex , LocalVariableBinding secretLocal ) { int resourceCount = this . resources . length ; if ( resourceCount > <NUM_LIT:0> && this . resourceExceptionLabels != null ) { for ( int i = resourceCount ; i > <NUM_LIT:0> ; -- i ) { this . resourceExceptionLabels [ i ] . placeEnd ( ) ; LocalVariableBinding localVariable = this . resources [ i - <NUM_LIT:1> ] . binding ; BranchLabel exitLabel = new BranchLabel ( codeStream ) ; int invokeCloseStartPc = codeStream . position ; codeStream . load ( localVariable ) ; codeStream . ifnull ( exitLabel ) ; codeStream . load ( localVariable ) ; codeStream . invokeAutoCloseableClose ( localVariable . type ) ; codeStream . recordPositionsFrom ( invokeCloseStartPc , this . tryBlock . sourceEnd ) ; exitLabel . place ( ) ; } for ( int i = resourceCount ; i > <NUM_LIT:0> ; -- i ) { this . resourceExceptionLabels [ i ] . placeStart ( ) ; } } boolean isStackMapFrameCodeStream = codeStream instanceof StackMapFrameCodeStream ; int finallyMode = finallyMode ( ) ; switch ( finallyMode ) { case FINALLY_DOES_NOT_COMPLETE : codeStream . goto_ ( this . subRoutineStartLabel ) ; return true ; case NO_FINALLY : exitDeclaredExceptionHandlers ( codeStream ) ; return false ; } if ( targetLocation != null ) { boolean reuseTargetLocation = true ; if ( this . reusableJSRTargetsCount > <NUM_LIT:0> ) { nextReusableTarget : for ( int i = <NUM_LIT:0> , count = this . reusableJSRTargetsCount ; i < count ; i ++ ) { Object reusableJSRTarget = this . reusableJSRTargets [ i ] ; differentTarget : { if ( targetLocation == reusableJSRTarget ) break differentTarget ; if ( targetLocation instanceof Constant && reusableJSRTarget instanceof Constant && ( ( Constant ) targetLocation ) . hasSameValue ( ( Constant ) reusableJSRTarget ) ) { break differentTarget ; } continue nextReusableTarget ; } if ( ( this . reusableJSRStateIndexes [ i ] != stateIndex ) && finallyMode == FINALLY_INLINE ) { reuseTargetLocation = false ; break nextReusableTarget ; } else { codeStream . goto_ ( this . reusableJSRSequenceStartLabels [ i ] ) ; return true ; } } } else { this . reusableJSRTargets = new Object [ <NUM_LIT:3> ] ; this . reusableJSRSequenceStartLabels = new BranchLabel [ <NUM_LIT:3> ] ; this . reusableJSRStateIndexes = new int [ <NUM_LIT:3> ] ; } if ( reuseTargetLocation ) { if ( this . reusableJSRTargetsCount == this . reusableJSRTargets . length ) { System . arraycopy ( this . reusableJSRTargets , <NUM_LIT:0> , this . reusableJSRTargets = new Object [ <NUM_LIT:2> * this . reusableJSRTargetsCount ] , <NUM_LIT:0> , this . reusableJSRTargetsCount ) ; System . arraycopy ( this . reusableJSRSequenceStartLabels , <NUM_LIT:0> , this . reusableJSRSequenceStartLabels = new BranchLabel [ <NUM_LIT:2> * this . reusableJSRTargetsCount ] , <NUM_LIT:0> , this . reusableJSRTargetsCount ) ; System . arraycopy ( this . reusableJSRStateIndexes , <NUM_LIT:0> , this . reusableJSRStateIndexes = new int [ <NUM_LIT:2> * this . reusableJSRTargetsCount ] , <NUM_LIT:0> , this . reusableJSRTargetsCount ) ; } this . reusableJSRTargets [ this . reusableJSRTargetsCount ] = targetLocation ; BranchLabel reusableJSRSequenceStartLabel = new BranchLabel ( codeStream ) ; reusableJSRSequenceStartLabel . place ( ) ; this . reusableJSRStateIndexes [ this . reusableJSRTargetsCount ] = stateIndex ; this . reusableJSRSequenceStartLabels [ this . reusableJSRTargetsCount ++ ] = reusableJSRSequenceStartLabel ; } } if ( finallyMode == FINALLY_INLINE ) { if ( isStackMapFrameCodeStream ) { ( ( StackMapFrameCodeStream ) codeStream ) . pushStateIndex ( stateIndex ) ; } exitAnyExceptionHandler ( ) ; exitDeclaredExceptionHandlers ( codeStream ) ; this . finallyBlock . generateCode ( currentScope , codeStream ) ; if ( isStackMapFrameCodeStream ) { ( ( StackMapFrameCodeStream ) codeStream ) . popStateIndex ( ) ; } } else { codeStream . jsr ( this . subRoutineStartLabel ) ; exitAnyExceptionHandler ( ) ; exitDeclaredExceptionHandlers ( codeStream ) ; } return false ; } public boolean isSubRoutineEscaping ( ) { return ( this . bits & ASTNode . IsSubRoutineEscaping ) != <NUM_LIT:0> ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { int length = this . resources . length ; printIndent ( indent , output ) . append ( "<STR_LIT>" + ( length == <NUM_LIT:0> ? "<STR_LIT:n>" : "<STR_LIT:U+0020(>" ) ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . resources [ i ] . printAsExpression ( <NUM_LIT:0> , output ) ; if ( i != length - <NUM_LIT:1> ) { output . append ( "<STR_LIT>" ) ; printIndent ( indent + <NUM_LIT:2> , output ) ; } } if ( length > <NUM_LIT:0> ) { output . append ( "<STR_LIT>" ) ; } this . tryBlock . printStatement ( indent + <NUM_LIT:1> , output ) ; if ( this . catchBlocks != null ) for ( int i = <NUM_LIT:0> ; i < this . catchBlocks . length ; i ++ ) { output . append ( '<STR_LIT:\n>' ) ; printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . catchArguments [ i ] . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; this . catchBlocks [ i ] . printStatement ( indent + <NUM_LIT:1> , output ) ; } if ( this . finallyBlock != null ) { output . append ( '<STR_LIT:\n>' ) ; printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . finallyBlock . printStatement ( indent + <NUM_LIT:1> , output ) ; } return output ; } public void resolve ( BlockScope upperScope ) { this . scope = new BlockScope ( upperScope ) ; BlockScope finallyScope = null ; BlockScope resourceManagementScope = null ; int resourceCount = this . resources . length ; if ( resourceCount > <NUM_LIT:0> ) { resourceManagementScope = new BlockScope ( this . scope ) ; this . primaryExceptionVariable = new LocalVariableBinding ( TryStatement . SECRET_PRIMARY_EXCEPTION_VARIABLE_NAME , this . scope . getJavaLangThrowable ( ) , ClassFileConstants . AccDefault , false ) ; resourceManagementScope . addLocalVariable ( this . primaryExceptionVariable ) ; this . primaryExceptionVariable . setConstant ( Constant . NotAConstant ) ; this . caughtThrowableVariable = new LocalVariableBinding ( TryStatement . SECRET_CAUGHT_THROWABLE_VARIABLE_NAME , this . scope . getJavaLangThrowable ( ) , ClassFileConstants . AccDefault , false ) ; resourceManagementScope . addLocalVariable ( this . caughtThrowableVariable ) ; this . caughtThrowableVariable . setConstant ( Constant . NotAConstant ) ; } for ( int i = <NUM_LIT:0> ; i < resourceCount ; i ++ ) { this . resources [ i ] . resolve ( resourceManagementScope ) ; LocalVariableBinding localVariableBinding = this . resources [ i ] . binding ; if ( localVariableBinding != null && localVariableBinding . isValidBinding ( ) ) { localVariableBinding . modifiers |= ClassFileConstants . AccFinal ; localVariableBinding . tagBits |= TagBits . IsResource ; TypeBinding resourceType = localVariableBinding . type ; if ( resourceType instanceof ReferenceBinding ) { if ( resourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangAutoCloseable , false ) == null && resourceType . isValidBinding ( ) ) { upperScope . problemReporter ( ) . resourceHasToImplementAutoCloseable ( resourceType , this . resources [ i ] . type ) ; localVariableBinding . type = new ProblemReferenceBinding ( CharOperation . splitOn ( '<CHAR_LIT:.>' , resourceType . shortReadableName ( ) ) , null , ProblemReasons . InvalidTypeForAutoManagedResource ) ; } } else if ( resourceType != null ) { upperScope . problemReporter ( ) . resourceHasToImplementAutoCloseable ( resourceType , this . resources [ i ] . type ) ; localVariableBinding . type = new ProblemReferenceBinding ( CharOperation . splitOn ( '<CHAR_LIT:.>' , resourceType . shortReadableName ( ) ) , null , ProblemReasons . InvalidTypeForAutoManagedResource ) ; } } } BlockScope tryScope = new BlockScope ( resourceManagementScope != null ? resourceManagementScope : this . scope ) ; if ( this . finallyBlock != null ) { if ( this . finallyBlock . isEmptyBlock ( ) ) { if ( ( this . finallyBlock . bits & ASTNode . UndocumentedEmptyBlock ) != <NUM_LIT:0> ) { this . scope . problemReporter ( ) . undocumentedEmptyBlock ( this . finallyBlock . sourceStart , this . finallyBlock . sourceEnd ) ; } } else { finallyScope = new BlockScope ( this . scope , false ) ; MethodScope methodScope = this . scope . methodScope ( ) ; if ( ! upperScope . compilerOptions ( ) . inlineJsrBytecode ) { this . returnAddressVariable = new LocalVariableBinding ( TryStatement . SECRET_RETURN_ADDRESS_NAME , upperScope . getJavaLangObject ( ) , ClassFileConstants . AccDefault , false ) ; finallyScope . addLocalVariable ( this . returnAddressVariable ) ; this . returnAddressVariable . setConstant ( Constant . NotAConstant ) ; } this . subRoutineStartLabel = new BranchLabel ( ) ; this . anyExceptionVariable = new LocalVariableBinding ( TryStatement . SECRET_ANY_HANDLER_NAME , this . scope . getJavaLangThrowable ( ) , ClassFileConstants . AccDefault , false ) ; finallyScope . addLocalVariable ( this . anyExceptionVariable ) ; this . anyExceptionVariable . setConstant ( Constant . NotAConstant ) ; if ( ! methodScope . isInsideInitializer ( ) ) { MethodBinding methodBinding = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ; if ( methodBinding != null ) { TypeBinding methodReturnType = methodBinding . returnType ; if ( methodReturnType . id != TypeIds . T_void ) { this . secretReturnValue = new LocalVariableBinding ( TryStatement . SECRET_RETURN_VALUE_NAME , methodReturnType , ClassFileConstants . AccDefault , false ) ; finallyScope . addLocalVariable ( this . secretReturnValue ) ; this . secretReturnValue . setConstant ( Constant . NotAConstant ) ; } } } this . finallyBlock . resolveUsing ( finallyScope ) ; int shiftScopesLength = this . catchArguments == null ? <NUM_LIT:1> : this . catchArguments . length + <NUM_LIT:1> ; finallyScope . shiftScopes = new BlockScope [ shiftScopesLength ] ; finallyScope . shiftScopes [ <NUM_LIT:0> ] = tryScope ; } } this . tryBlock . resolveUsing ( tryScope ) ; if ( this . catchBlocks != null ) { int length = this . catchArguments . length ; TypeBinding [ ] argumentTypes = new TypeBinding [ length ] ; boolean containsUnionTypes = false ; boolean catchHasError = false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { BlockScope catchScope = new BlockScope ( this . scope ) ; if ( finallyScope != null ) { finallyScope . shiftScopes [ i + <NUM_LIT:1> ] = catchScope ; } Argument catchArgument = this . catchArguments [ i ] ; containsUnionTypes |= ( catchArgument . type . bits & ASTNode . IsUnionType ) != <NUM_LIT:0> ; if ( ( argumentTypes [ i ] = catchArgument . resolveForCatch ( catchScope ) ) == null ) { catchHasError = true ; } this . catchBlocks [ i ] . resolveUsing ( catchScope ) ; } if ( catchHasError ) { return ; } verifyDuplicationAndOrder ( length , argumentTypes , containsUnionTypes ) ; } else { this . caughtExceptionTypes = new ReferenceBinding [ <NUM_LIT:0> ] ; } if ( finallyScope != null ) { this . scope . addSubscope ( finallyScope ) ; } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { LocalDeclaration [ ] localDeclarations = this . resources ; for ( int i = <NUM_LIT:0> , max = localDeclarations . length ; i < max ; i ++ ) { localDeclarations [ i ] . traverse ( visitor , this . scope ) ; } this . tryBlock . traverse ( visitor , this . scope ) ; if ( this . catchArguments != null ) { for ( int i = <NUM_LIT:0> , max = this . catchBlocks . length ; i < max ; i ++ ) { this . catchArguments [ i ] . traverse ( visitor , this . scope ) ; this . catchBlocks [ i ] . traverse ( visitor , this . scope ) ; } } if ( this . finallyBlock != null ) this . finallyBlock . traverse ( visitor , this . scope ) ; } visitor . endVisit ( this , blockScope ) ; } protected void verifyDuplicationAndOrder ( int length , TypeBinding [ ] argumentTypes , boolean containsUnionTypes ) { if ( containsUnionTypes ) { int totalCount = <NUM_LIT:0> ; ReferenceBinding [ ] [ ] allExceptionTypes = new ReferenceBinding [ length ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding currentExceptionType = ( ReferenceBinding ) argumentTypes [ i ] ; TypeReference catchArgumentType = this . catchArguments [ i ] . type ; if ( ( catchArgumentType . bits & ASTNode . IsUnionType ) != <NUM_LIT:0> ) { TypeReference [ ] typeReferences = ( ( UnionTypeReference ) catchArgumentType ) . typeReferences ; int typeReferencesLength = typeReferences . length ; ReferenceBinding [ ] unionExceptionTypes = new ReferenceBinding [ typeReferencesLength ] ; for ( int j = <NUM_LIT:0> ; j < typeReferencesLength ; j ++ ) { unionExceptionTypes [ j ] = ( ReferenceBinding ) typeReferences [ j ] . resolvedType ; } totalCount += typeReferencesLength ; allExceptionTypes [ i ] = unionExceptionTypes ; } else { allExceptionTypes [ i ] = new ReferenceBinding [ ] { currentExceptionType } ; totalCount ++ ; } } this . caughtExceptionTypes = new ReferenceBinding [ totalCount ] ; this . caughtExceptionsCatchBlocks = new int [ totalCount ] ; for ( int i = <NUM_LIT:0> , l = <NUM_LIT:0> ; i < length ; i ++ ) { ReferenceBinding [ ] currentExceptions = allExceptionTypes [ i ] ; loop : for ( int j = <NUM_LIT:0> , max = currentExceptions . length ; j < max ; j ++ ) { ReferenceBinding exception = currentExceptions [ j ] ; this . caughtExceptionTypes [ l ] = exception ; this . caughtExceptionsCatchBlocks [ l ++ ] = i ; for ( int k = <NUM_LIT:0> ; k < i ; k ++ ) { ReferenceBinding [ ] exceptions = allExceptionTypes [ k ] ; for ( int n = <NUM_LIT:0> , max2 = exceptions . length ; n < max2 ; n ++ ) { ReferenceBinding currentException = exceptions [ n ] ; if ( exception . isCompatibleWith ( currentException ) ) { TypeReference catchArgumentType = this . catchArguments [ i ] . type ; if ( ( catchArgumentType . bits & ASTNode . IsUnionType ) != <NUM_LIT:0> ) { catchArgumentType = ( ( UnionTypeReference ) catchArgumentType ) . typeReferences [ j ] ; } this . scope . problemReporter ( ) . wrongSequenceOfExceptionTypesError ( catchArgumentType , exception , currentException ) ; break loop ; } } } } } } else { this . caughtExceptionTypes = new ReferenceBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . caughtExceptionTypes [ i ] = ( ReferenceBinding ) argumentTypes [ i ] ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( this . caughtExceptionTypes [ i ] . isCompatibleWith ( argumentTypes [ j ] ) ) { this . scope . problemReporter ( ) . wrongSequenceOfExceptionTypesError ( this . catchArguments [ i ] . type , this . caughtExceptionTypes [ i ] , argumentTypes [ j ] ) ; } } } } } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; public class StringLiteralConcatenation extends StringLiteral { private static final int INITIAL_SIZE = <NUM_LIT:5> ; public Expression [ ] literals ; public int counter ; public StringLiteralConcatenation ( StringLiteral str1 , StringLiteral str2 ) { super ( str1 . sourceStart , str1 . sourceEnd ) ; this . source = str1 . source ; this . literals = new StringLiteral [ INITIAL_SIZE ] ; this . counter = <NUM_LIT:0> ; this . literals [ this . counter ++ ] = str1 ; extendsWith ( str2 ) ; } public StringLiteralConcatenation extendsWith ( StringLiteral lit ) { this . sourceEnd = lit . sourceEnd ; final int literalsLength = this . literals . length ; if ( this . counter == literalsLength ) { System . arraycopy ( this . literals , <NUM_LIT:0> , this . literals = new StringLiteral [ literalsLength + INITIAL_SIZE ] , <NUM_LIT:0> , literalsLength ) ; } int length = this . source . length ; System . arraycopy ( this . source , <NUM_LIT:0> , this . source = new char [ length + lit . source . length ] , <NUM_LIT:0> , length ) ; System . arraycopy ( lit . source , <NUM_LIT:0> , this . source , length , lit . source . length ) ; this . literals [ this . counter ++ ] = lit ; return this ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , max = this . counter ; i < max ; i ++ ) { this . literals [ i ] . printExpression ( indent , output ) ; output . append ( "<STR_LIT>" ) ; } return output . append ( '<CHAR_LIT:}>' ) ; } public char [ ] source ( ) { return this . source ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { for ( int i = <NUM_LIT:0> , max = this . counter ; i < max ; i ++ ) { this . literals [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . lookup . * ; public abstract class NameReference extends Reference implements InvocationSite { public Binding binding ; public TypeBinding actualReceiverType ; public NameReference ( ) { this . bits |= Binding . TYPE | Binding . VARIABLE ; } public FieldBinding fieldBinding ( ) { return ( FieldBinding ) this . binding ; } public boolean isSuperAccess ( ) { return false ; } public boolean isTypeAccess ( ) { return this . binding == null || this . binding instanceof ReferenceBinding ; } public boolean isTypeReference ( ) { return this . binding instanceof ReferenceBinding ; } public void setActualReceiverType ( ReferenceBinding receiverType ) { if ( receiverType == null ) return ; this . actualReceiverType = receiverType ; } public void setDepth ( int depth ) { this . bits &= ~ DepthMASK ; if ( depth > <NUM_LIT:0> ) { this . bits |= ( depth & <NUM_LIT> ) << DepthSHIFT ; } } public void setFieldIndex ( int index ) { } public abstract String unboundReferenceErrorName ( ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class BinaryExpression extends OperatorExpression { public Expression left , right ; public Constant optimizedBooleanConstant ; public BinaryExpression ( Expression left , Expression right , int operator ) { this . left = left ; this . right = right ; this . bits |= operator << ASTNode . OperatorSHIFT ; this . sourceStart = left . sourceStart ; this . sourceEnd = right . sourceEnd ; } public BinaryExpression ( BinaryExpression expression ) { this . left = expression . left ; this . right = expression . right ; this . bits = expression . bits ; this . sourceStart = expression . sourceStart ; this . sourceEnd = expression . sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . resolvedType . id == TypeIds . T_JavaLangString ) { return this . right . analyseCode ( currentScope , flowContext , this . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ) . unconditionalInits ( ) ; } else { this . left . checkNPE ( currentScope , flowContext , flowInfo ) ; flowInfo = this . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; this . right . checkNPE ( currentScope , flowContext , flowInfo ) ; return this . right . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } } public void computeConstant ( BlockScope scope , int leftId , int rightId ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . right . constant != Constant . NotAConstant ) ) { try { this . constant = Constant . computeConstantOperation ( this . left . constant , leftId , ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT , this . right . constant , rightId ) ; } catch ( ArithmeticException e ) { this . constant = Constant . NotAConstant ; } } else { this . constant = Constant . NotAConstant ; this . optimizedBooleanConstant ( leftId , ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT , rightId ) ; } } public Constant optimizedBooleanConstant ( ) { return this . optimizedBooleanConstant == null ? this . constant : this . optimizedBooleanConstant ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } switch ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) { case PLUS : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_JavaLangString : codeStream . generateStringConcatenationAppend ( currentScope , this . left , this . right ) ; if ( ! valueRequired ) codeStream . pop ( ) ; break ; case T_int : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . iadd ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . ladd ( ) ; break ; case T_double : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . dadd ( ) ; break ; case T_float : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . fadd ( ) ; break ; } break ; case MINUS : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . isub ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lsub ( ) ; break ; case T_double : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . dsub ( ) ; break ; case T_float : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . fsub ( ) ; break ; } break ; case MULTIPLY : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . imul ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lmul ( ) ; break ; case T_double : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . dmul ( ) ; break ; case T_float : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . fmul ( ) ; break ; } break ; case DIVIDE : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , true ) ; this . right . generateCode ( currentScope , codeStream , true ) ; codeStream . idiv ( ) ; if ( ! valueRequired ) codeStream . pop ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , true ) ; this . right . generateCode ( currentScope , codeStream , true ) ; codeStream . ldiv ( ) ; if ( ! valueRequired ) codeStream . pop2 ( ) ; break ; case T_double : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . ddiv ( ) ; break ; case T_float : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . fdiv ( ) ; break ; } break ; case REMAINDER : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , true ) ; this . right . generateCode ( currentScope , codeStream , true ) ; codeStream . irem ( ) ; if ( ! valueRequired ) codeStream . pop ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , true ) ; this . right . generateCode ( currentScope , codeStream , true ) ; codeStream . lrem ( ) ; if ( ! valueRequired ) codeStream . pop2 ( ) ; break ; case T_double : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . drem ( ) ; break ; case T_float : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . frem ( ) ; break ; } break ; case AND : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == TypeIds . T_int ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) codeStream . iconst_0 ( ) ; } else { if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == TypeIds . T_int ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) codeStream . iconst_0 ( ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . iand ( ) ; } } break ; case T_long : if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == TypeIds . T_long ) && ( this . left . constant . longValue ( ) == <NUM_LIT> ) ) { this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) codeStream . lconst_0 ( ) ; } else { if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == TypeIds . T_long ) && ( this . right . constant . longValue ( ) == <NUM_LIT> ) ) { this . left . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) codeStream . lconst_0 ( ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . land ( ) ; } } break ; case T_boolean : generateLogicalAnd ( currentScope , codeStream , valueRequired ) ; break ; } break ; case OR : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == TypeIds . T_int ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } else { if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == TypeIds . T_int ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . ior ( ) ; } } break ; case T_long : if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == TypeIds . T_long ) && ( this . left . constant . longValue ( ) == <NUM_LIT> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } else { if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == TypeIds . T_long ) && ( this . right . constant . longValue ( ) == <NUM_LIT> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lor ( ) ; } } break ; case T_boolean : generateLogicalOr ( currentScope , codeStream , valueRequired ) ; break ; } break ; case XOR : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == TypeIds . T_int ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } else { if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == TypeIds . T_int ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . ixor ( ) ; } } break ; case T_long : if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == TypeIds . T_long ) && ( this . left . constant . longValue ( ) == <NUM_LIT> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } else { if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == TypeIds . T_long ) && ( this . right . constant . longValue ( ) == <NUM_LIT> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lxor ( ) ; } } break ; case T_boolean : generateLogicalXor ( currentScope , codeStream , valueRequired ) ; break ; } break ; case LEFT_SHIFT : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . ishl ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lshl ( ) ; } break ; case RIGHT_SHIFT : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . ishr ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lshr ( ) ; } break ; case UNSIGNED_RIGHT_SHIFT : switch ( this . bits & ASTNode . ReturnTypeIDMASK ) { case T_int : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . iushr ( ) ; break ; case T_long : this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) codeStream . lushr ( ) ; } break ; case GREATER : BranchLabel falseLabel , endLabel ; generateOptimizedGreaterThan ( currentScope , codeStream , null , ( falseLabel = new BranchLabel ( codeStream ) ) , valueRequired ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; if ( ( this . bits & ASTNode . IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { codeStream . goto_ ( endLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } break ; case GREATER_EQUAL : generateOptimizedGreaterThanOrEqual ( currentScope , codeStream , null , ( falseLabel = new BranchLabel ( codeStream ) ) , valueRequired ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; if ( ( this . bits & ASTNode . IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { codeStream . goto_ ( endLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } break ; case LESS : generateOptimizedLessThan ( currentScope , codeStream , null , ( falseLabel = new BranchLabel ( codeStream ) ) , valueRequired ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; if ( ( this . bits & ASTNode . IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { codeStream . goto_ ( endLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } break ; case LESS_EQUAL : generateOptimizedLessThanOrEqual ( currentScope , codeStream , null , ( falseLabel = new BranchLabel ( codeStream ) ) , valueRequired ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; if ( ( this . bits & ASTNode . IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { codeStream . goto_ ( endLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { if ( ( this . constant != Constant . NotAConstant ) && ( this . constant . typeID ( ) == TypeIds . T_boolean ) ) { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } switch ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) { case LESS : generateOptimizedLessThan ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; case LESS_EQUAL : generateOptimizedLessThanOrEqual ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; case GREATER : generateOptimizedGreaterThan ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; case GREATER_EQUAL : generateOptimizedGreaterThanOrEqual ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; case AND : generateOptimizedLogicalAnd ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; case OR : generateOptimizedLogicalOr ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; case XOR : generateOptimizedLogicalXor ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } public void generateOptimizedGreaterThan ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int promotedTypeID = ( this . left . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; if ( promotedTypeID == TypeIds . T_int ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . iflt ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifge ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifgt ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifle ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmpgt ( trueLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifgt ( trueLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifgt ( trueLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifgt ( trueLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } else { if ( trueLabel == null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmple ( falseLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifle ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifle ( falseLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifle ( falseLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } else { } } } } public void generateOptimizedGreaterThanOrEqual ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int promotedTypeID = ( this . left . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; if ( promotedTypeID == TypeIds . T_int ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifle ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifgt ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifge ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . iflt ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmpge ( trueLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifge ( trueLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifge ( trueLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifge ( trueLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } else { if ( trueLabel == null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmplt ( falseLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . iflt ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . iflt ( falseLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . iflt ( falseLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } else { } } } } public void generateOptimizedLessThan ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int promotedTypeID = ( this . left . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; if ( promotedTypeID == TypeIds . T_int ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifgt ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifle ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . iflt ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifge ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmplt ( trueLabel ) ; break ; case T_float : codeStream . fcmpg ( ) ; codeStream . iflt ( trueLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . iflt ( trueLabel ) ; break ; case T_double : codeStream . dcmpg ( ) ; codeStream . iflt ( trueLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } else { if ( trueLabel == null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmpge ( falseLabel ) ; break ; case T_float : codeStream . fcmpg ( ) ; codeStream . ifge ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifge ( falseLabel ) ; break ; case T_double : codeStream . dcmpg ( ) ; codeStream . ifge ( falseLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } else { } } } } public void generateOptimizedLessThanOrEqual ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int promotedTypeID = ( this . left . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; if ( promotedTypeID == TypeIds . T_int ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifge ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . iflt ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifle ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifgt ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmple ( trueLabel ) ; break ; case T_float : codeStream . fcmpg ( ) ; codeStream . ifle ( trueLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifle ( trueLabel ) ; break ; case T_double : codeStream . dcmpg ( ) ; codeStream . ifle ( trueLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } } else { if ( trueLabel == null ) { switch ( promotedTypeID ) { case T_int : codeStream . if_icmpgt ( falseLabel ) ; break ; case T_float : codeStream . fcmpg ( ) ; codeStream . ifgt ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifgt ( falseLabel ) ; break ; case T_double : codeStream . dcmpg ( ) ; codeStream . ifgt ( falseLabel ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; return ; } else { } } } } public void generateLogicalAnd ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { Constant condConst ; if ( ( this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) == TypeIds . T_boolean ) { if ( ( condConst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } else { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { codeStream . iconst_0 ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } return ; } if ( ( condConst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , false ) ; } else { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { codeStream . iconst_0 ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . iand ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } public void generateLogicalOr ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { Constant condConst ; if ( ( this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) == TypeIds . T_boolean ) { if ( ( condConst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } else { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } return ; } if ( ( condConst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , false ) ; } return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . ior ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } public void generateLogicalXor ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { Constant condConst ; if ( ( this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) == TypeIds . T_boolean ) { if ( ( condConst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; } this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . ixor ( ) ; codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } } else { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } return ; } if ( ( condConst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { codeStream . iconst_1 ( ) ; codeStream . ixor ( ) ; codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , false ) ; } return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . ixor ( ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } public void generateOptimizedLogicalAnd ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { Constant condConst ; if ( ( this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) == TypeIds . T_boolean ) { if ( ( condConst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; if ( valueRequired ) { if ( falseLabel != null ) { codeStream . goto_ ( falseLabel ) ; } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } return ; } if ( ( condConst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; } else { BranchLabel internalTrueLabel = new BranchLabel ( codeStream ) ; this . left . generateOptimizedBoolean ( currentScope , codeStream , internalTrueLabel , falseLabel , false ) ; internalTrueLabel . place ( ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; if ( valueRequired ) { if ( falseLabel != null ) { codeStream . goto_ ( falseLabel ) ; } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . iand ( ) ; if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifne ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifeq ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } public void generateOptimizedLogicalOr ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { Constant condConst ; if ( ( this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) == TypeIds . T_boolean ) { if ( ( condConst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; BranchLabel internalFalseLabel = new BranchLabel ( codeStream ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , internalFalseLabel , false ) ; internalFalseLabel . place ( ) ; if ( valueRequired ) { if ( trueLabel != null ) { codeStream . goto_ ( trueLabel ) ; } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } return ; } if ( ( condConst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { BranchLabel internalFalseLabel = new BranchLabel ( codeStream ) ; this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , internalFalseLabel , false ) ; internalFalseLabel . place ( ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; if ( valueRequired ) { if ( trueLabel != null ) { codeStream . goto_ ( trueLabel ) ; } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; } return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . ior ( ) ; if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifne ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifeq ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } public void generateOptimizedLogicalXor ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { Constant condConst ; if ( ( this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) == TypeIds . T_boolean ) { if ( ( condConst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , falseLabel , trueLabel , valueRequired ) ; } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } return ; } if ( ( condConst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( condConst . booleanValue ( ) == true ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , falseLabel , trueLabel , valueRequired ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , false ) ; } return ; } } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . ixor ( ) ; if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifne ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifeq ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } public void generateOptimizedStringConcatenation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { if ( ( ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) && ( ( this . bits & ASTNode . ReturnTypeIDMASK ) == TypeIds . T_JavaLangString ) ) { if ( this . constant != Constant . NotAConstant ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . invokeStringConcatenationAppendForType ( this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; } else { int pc = codeStream . position ; this . left . generateOptimizedStringConcatenation ( blockScope , codeStream , this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pc , this . left . sourceStart ) ; pc = codeStream . position ; this . right . generateOptimizedStringConcatenation ( blockScope , codeStream , this . right . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pc , this . right . sourceStart ) ; } } else { super . generateOptimizedStringConcatenation ( blockScope , codeStream , typeID ) ; } } public void generateOptimizedStringConcatenationCreation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { if ( ( ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) && ( ( this . bits & ASTNode . ReturnTypeIDMASK ) == TypeIds . T_JavaLangString ) ) { if ( this . constant != Constant . NotAConstant ) { codeStream . newStringContatenation ( ) ; codeStream . dup ( ) ; codeStream . ldc ( this . constant . stringValue ( ) ) ; codeStream . invokeStringConcatenationStringConstructor ( ) ; } else { int pc = codeStream . position ; this . left . generateOptimizedStringConcatenationCreation ( blockScope , codeStream , this . left . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pc , this . left . sourceStart ) ; pc = codeStream . position ; this . right . generateOptimizedStringConcatenation ( blockScope , codeStream , this . right . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . recordPositionsFrom ( pc , this . right . sourceStart ) ; } } else { super . generateOptimizedStringConcatenationCreation ( blockScope , codeStream , typeID ) ; } } public boolean isCompactableOperation ( ) { return true ; } void nonRecursiveResolveTypeUpwards ( BlockScope scope ) { boolean leftIsCast , rightIsCast ; TypeBinding leftType = this . left . resolvedType ; if ( ( rightIsCast = this . right instanceof CastExpression ) == true ) { this . right . bits |= ASTNode . DisableUnnecessaryCastCheck ; } TypeBinding rightType = this . right . resolveType ( scope ) ; if ( leftType == null || rightType == null ) { this . constant = Constant . NotAConstant ; return ; } int leftTypeID = leftType . id ; int rightTypeID = rightType . id ; boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; if ( use15specifics ) { if ( ! leftType . isBaseType ( ) && rightTypeID != TypeIds . T_JavaLangString && rightTypeID != TypeIds . T_null ) { leftTypeID = scope . environment ( ) . computeBoxingType ( leftType ) . id ; } if ( ! rightType . isBaseType ( ) && leftTypeID != TypeIds . T_JavaLangString && leftTypeID != TypeIds . T_null ) { rightTypeID = scope . environment ( ) . computeBoxingType ( rightType ) . id ; } } if ( leftTypeID > <NUM_LIT:15> || rightTypeID > <NUM_LIT:15> ) { if ( leftTypeID == TypeIds . T_JavaLangString ) { rightTypeID = TypeIds . T_JavaLangObject ; } else if ( rightTypeID == TypeIds . T_JavaLangString ) { leftTypeID = TypeIds . T_JavaLangObject ; } else { this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , leftType , rightType ) ; return ; } } if ( ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) { if ( leftTypeID == TypeIds . T_JavaLangString ) { this . left . computeConversion ( scope , leftType , leftType ) ; if ( rightType . isArrayType ( ) && ( ( ArrayBinding ) rightType ) . elementsType ( ) == TypeBinding . CHAR ) { scope . problemReporter ( ) . signalNoImplicitStringConversionForCharArrayExpression ( this . right ) ; } } if ( rightTypeID == TypeIds . T_JavaLangString ) { this . right . computeConversion ( scope , rightType , rightType ) ; if ( leftType . isArrayType ( ) && ( ( ArrayBinding ) leftType ) . elementsType ( ) == TypeBinding . CHAR ) { scope . problemReporter ( ) . signalNoImplicitStringConversionForCharArrayExpression ( this . left ) ; } } } int operator = ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ; int operatorSignature = OperatorExpression . OperatorSignatures [ operator ] [ ( leftTypeID << <NUM_LIT:4> ) + rightTypeID ] ; this . left . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:16> ) & <NUM_LIT> ) , leftType ) ; this . right . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:8> ) & <NUM_LIT> ) , rightType ) ; this . bits |= operatorSignature & <NUM_LIT> ; switch ( operatorSignature & <NUM_LIT> ) { case T_boolean : this . resolvedType = TypeBinding . BOOLEAN ; break ; case T_byte : this . resolvedType = TypeBinding . BYTE ; break ; case T_char : this . resolvedType = TypeBinding . CHAR ; break ; case T_double : this . resolvedType = TypeBinding . DOUBLE ; break ; case T_float : this . resolvedType = TypeBinding . FLOAT ; break ; case T_int : this . resolvedType = TypeBinding . INT ; break ; case T_long : this . resolvedType = TypeBinding . LONG ; break ; case T_JavaLangString : this . resolvedType = scope . getJavaLangString ( ) ; break ; default : this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , leftType , rightType ) ; return ; } if ( ( leftIsCast = ( this . left instanceof CastExpression ) ) == true || rightIsCast ) { CastExpression . checkNeedForArgumentCasts ( scope , operator , operatorSignature , this . left , leftTypeID , leftIsCast , this . right , rightTypeID , rightIsCast ) ; } computeConstant ( scope , leftTypeID , rightTypeID ) ; } public void optimizedBooleanConstant ( int leftId , int operator , int rightId ) { switch ( operator ) { case AND : if ( ( leftId != TypeIds . T_boolean ) || ( rightId != TypeIds . T_boolean ) ) return ; case AND_AND : Constant cst ; if ( ( cst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == false ) { this . optimizedBooleanConstant = cst ; return ; } else { if ( ( cst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { this . optimizedBooleanConstant = cst ; } return ; } } if ( ( cst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == false ) { this . optimizedBooleanConstant = cst ; } } return ; case OR : if ( ( leftId != TypeIds . T_boolean ) || ( rightId != TypeIds . T_boolean ) ) return ; case OR_OR : if ( ( cst = this . left . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == true ) { this . optimizedBooleanConstant = cst ; return ; } else { if ( ( cst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { this . optimizedBooleanConstant = cst ; } return ; } } if ( ( cst = this . right . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == true ) { this . optimizedBooleanConstant = cst ; } } } } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { this . left . printExpression ( indent , output ) . append ( '<CHAR_LIT:U+0020>' ) . append ( operatorToString ( ) ) . append ( '<CHAR_LIT:U+0020>' ) ; return this . right . printExpression ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { boolean leftIsCast , rightIsCast ; if ( ( leftIsCast = this . left instanceof CastExpression ) == true ) this . left . bits |= ASTNode . DisableUnnecessaryCastCheck ; TypeBinding leftType = this . left . resolveType ( scope ) ; if ( ( rightIsCast = this . right instanceof CastExpression ) == true ) this . right . bits |= ASTNode . DisableUnnecessaryCastCheck ; TypeBinding rightType = this . right . resolveType ( scope ) ; if ( leftType == null || rightType == null ) { this . constant = Constant . NotAConstant ; return null ; } int leftTypeID = leftType . id ; int rightTypeID = rightType . id ; boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; if ( use15specifics ) { if ( ! leftType . isBaseType ( ) && rightTypeID != TypeIds . T_JavaLangString && rightTypeID != TypeIds . T_null ) { leftTypeID = scope . environment ( ) . computeBoxingType ( leftType ) . id ; } if ( ! rightType . isBaseType ( ) && leftTypeID != TypeIds . T_JavaLangString && leftTypeID != TypeIds . T_null ) { rightTypeID = scope . environment ( ) . computeBoxingType ( rightType ) . id ; } } if ( leftTypeID > <NUM_LIT:15> || rightTypeID > <NUM_LIT:15> ) { if ( leftTypeID == TypeIds . T_JavaLangString ) { rightTypeID = TypeIds . T_JavaLangObject ; } else if ( rightTypeID == TypeIds . T_JavaLangString ) { leftTypeID = TypeIds . T_JavaLangObject ; } else { this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , leftType , rightType ) ; return null ; } } if ( ( ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) { if ( leftTypeID == TypeIds . T_JavaLangString ) { this . left . computeConversion ( scope , leftType , leftType ) ; if ( rightType . isArrayType ( ) && ( ( ArrayBinding ) rightType ) . elementsType ( ) == TypeBinding . CHAR ) { scope . problemReporter ( ) . signalNoImplicitStringConversionForCharArrayExpression ( this . right ) ; } } if ( rightTypeID == TypeIds . T_JavaLangString ) { this . right . computeConversion ( scope , rightType , rightType ) ; if ( leftType . isArrayType ( ) && ( ( ArrayBinding ) leftType ) . elementsType ( ) == TypeBinding . CHAR ) { scope . problemReporter ( ) . signalNoImplicitStringConversionForCharArrayExpression ( this . left ) ; } } } int operator = ( this . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ; int operatorSignature = OperatorExpression . OperatorSignatures [ operator ] [ ( leftTypeID << <NUM_LIT:4> ) + rightTypeID ] ; this . left . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:16> ) & <NUM_LIT> ) , leftType ) ; this . right . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:8> ) & <NUM_LIT> ) , rightType ) ; this . bits |= operatorSignature & <NUM_LIT> ; switch ( operatorSignature & <NUM_LIT> ) { case T_boolean : this . resolvedType = TypeBinding . BOOLEAN ; break ; case T_byte : this . resolvedType = TypeBinding . BYTE ; break ; case T_char : this . resolvedType = TypeBinding . CHAR ; break ; case T_double : this . resolvedType = TypeBinding . DOUBLE ; break ; case T_float : this . resolvedType = TypeBinding . FLOAT ; break ; case T_int : this . resolvedType = TypeBinding . INT ; break ; case T_long : this . resolvedType = TypeBinding . LONG ; break ; case T_JavaLangString : this . resolvedType = scope . getJavaLangString ( ) ; break ; default : this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , leftType , rightType ) ; return null ; } if ( leftIsCast || rightIsCast ) { CastExpression . checkNeedForArgumentCasts ( scope , operator , operatorSignature , this . left , leftTypeID , leftIsCast , this . right , rightTypeID , rightIsCast ) ; } computeConstant ( scope , leftTypeID , rightTypeID ) ; return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . left . traverse ( visitor , scope ) ; this . right . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public abstract class Statement extends ASTNode { protected static boolean isKnowDeadCodePattern ( Expression expression ) { if ( expression instanceof UnaryExpression ) { expression = ( ( UnaryExpression ) expression ) . expression ; } if ( expression instanceof Reference ) return true ; return false ; } public abstract FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) ; public static final int NOT_COMPLAINED = <NUM_LIT:0> ; public static final int COMPLAINED_FAKE_REACHABLE = <NUM_LIT:1> ; public static final int COMPLAINED_UNREACHABLE = <NUM_LIT:2> ; protected void analyseArguments ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , MethodBinding methodBinding , Expression [ ] arguments ) { if ( arguments != null && methodBinding . parameterNonNullness != null ) { int numParamsToCheck = methodBinding . parameters . length ; boolean passThrough = false ; if ( methodBinding . isVarargs ( ) ) { int varArgPos = numParamsToCheck - <NUM_LIT:1> ; if ( numParamsToCheck == arguments . length ) { TypeBinding varArgsType = methodBinding . parameters [ varArgPos ] ; TypeBinding lastType = arguments [ varArgPos ] . resolvedType ; if ( lastType == TypeBinding . NULL || ( varArgsType . dimensions ( ) == lastType . dimensions ( ) && lastType . isCompatibleWith ( varArgsType ) ) ) passThrough = true ; } if ( ! passThrough ) numParamsToCheck -- ; } for ( int i = <NUM_LIT:0> ; i < numParamsToCheck ; i ++ ) { if ( methodBinding . parameterNonNullness [ i ] == Boolean . TRUE ) { TypeBinding expectedType = methodBinding . parameters [ i ] ; Expression argument = arguments [ i ] ; int nullStatus = argument . nullStatus ( flowInfo ) ; if ( nullStatus != FlowInfo . NON_NULL ) flowContext . recordNullityMismatch ( currentScope , argument , argument . resolvedType , expectedType , nullStatus ) ; } } } } protected int checkAssignmentAgainstNullAnnotation ( BlockScope currentScope , FlowContext flowContext , LocalVariableBinding local , int nullStatus , Expression expression , TypeBinding providedType ) { if ( local != null ) { if ( ( local . tagBits & TagBits . AnnotationNonNull ) != <NUM_LIT:0> && nullStatus != FlowInfo . NON_NULL ) { flowContext . recordNullityMismatch ( currentScope , expression , providedType , local . type , nullStatus ) ; return FlowInfo . NON_NULL ; } else if ( ( local . tagBits & TagBits . AnnotationNullable ) != <NUM_LIT:0> && nullStatus == FlowInfo . UNKNOWN ) { return FlowInfo . POTENTIALLY_NULL ; } } return nullStatus ; } public void branchChainTo ( BranchLabel label ) { } public int complainIfUnreachable ( FlowInfo flowInfo , BlockScope scope , int previousComplaintLevel , boolean endOfBlock ) { if ( ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ) { if ( ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) this . bits &= ~ ASTNode . IsReachable ; if ( flowInfo == FlowInfo . DEAD_END ) { if ( previousComplaintLevel < COMPLAINED_UNREACHABLE ) { scope . problemReporter ( ) . unreachableCode ( this ) ; if ( endOfBlock ) scope . checkUnclosedCloseables ( flowInfo , null , null , null ) ; } return COMPLAINED_UNREACHABLE ; } else { if ( previousComplaintLevel < COMPLAINED_FAKE_REACHABLE ) { scope . problemReporter ( ) . fakeReachable ( this ) ; if ( endOfBlock ) scope . checkUnclosedCloseables ( flowInfo , null , null , null ) ; } return COMPLAINED_FAKE_REACHABLE ; } } return previousComplaintLevel ; } public void generateArguments ( MethodBinding binding , Expression [ ] arguments , BlockScope currentScope , CodeStream codeStream ) { if ( binding . isVarargs ( ) ) { TypeBinding [ ] params = binding . parameters ; int paramLength = params . length ; int varArgIndex = paramLength - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < varArgIndex ; i ++ ) { arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; } ArrayBinding varArgsType = ( ArrayBinding ) params [ varArgIndex ] ; ArrayBinding codeGenVarArgsType = ( ArrayBinding ) binding . parameters [ varArgIndex ] . erasure ( ) ; int elementsTypeID = varArgsType . elementsType ( ) . id ; int argLength = arguments == null ? <NUM_LIT:0> : arguments . length ; if ( argLength > paramLength ) { codeStream . generateInlinedValue ( argLength - varArgIndex ) ; codeStream . newArray ( codeGenVarArgsType ) ; for ( int i = varArgIndex ; i < argLength ; i ++ ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i - varArgIndex ) ; arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } else if ( argLength == paramLength ) { TypeBinding lastType = arguments [ varArgIndex ] . resolvedType ; if ( lastType == TypeBinding . NULL || ( varArgsType . dimensions ( ) == lastType . dimensions ( ) && lastType . isCompatibleWith ( varArgsType ) ) ) { arguments [ varArgIndex ] . generateCode ( currentScope , codeStream , true ) ; } else { codeStream . generateInlinedValue ( <NUM_LIT:1> ) ; codeStream . newArray ( codeGenVarArgsType ) ; codeStream . dup ( ) ; codeStream . generateInlinedValue ( <NUM_LIT:0> ) ; arguments [ varArgIndex ] . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } else { codeStream . generateInlinedValue ( <NUM_LIT:0> ) ; codeStream . newArray ( codeGenVarArgsType ) ; } } else if ( arguments != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; } } public abstract void generateCode ( BlockScope currentScope , CodeStream codeStream ) ; protected boolean isBoxingCompatible ( TypeBinding expressionType , TypeBinding targetType , Expression expression , Scope scope ) { if ( scope . isBoxingCompatibleWith ( expressionType , targetType ) ) return true ; return expressionType . isBaseType ( ) && ! targetType . isBaseType ( ) && ! targetType . isTypeVariable ( ) && scope . compilerOptions ( ) . sourceLevel >= org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants . JDK1_5 && ( targetType . id == TypeIds . T_JavaLangByte || targetType . id == TypeIds . T_JavaLangShort || targetType . id == TypeIds . T_JavaLangCharacter ) && expression . isConstantValueOfTypeAssignableToType ( expressionType , scope . environment ( ) . computeBoxingType ( targetType ) ) ; } public boolean isEmptyBlock ( ) { return false ; } public boolean isValidJavaStatement ( ) { return true ; } public StringBuffer print ( int indent , StringBuffer output ) { return printStatement ( indent , output ) ; } public abstract StringBuffer printStatement ( int indent , StringBuffer output ) ; public abstract void resolve ( BlockScope scope ) ; public Constant resolveCase ( BlockScope scope , TypeBinding testType , SwitchStatement switchStatement ) { resolve ( scope ) ; return Constant . NotAConstant ; } public TypeBinding expectedType ( ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public abstract class AbstractVariableDeclaration extends Statement implements InvocationSite { public int declarationEnd ; public int declarationSourceEnd ; public int declarationSourceStart ; public int hiddenVariableDepth ; public Expression initialization ; public int modifiers ; public int modifiersSourceStart ; public Annotation [ ] annotations ; public char [ ] name ; public TypeReference type ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return flowInfo ; } public static final int FIELD = <NUM_LIT:1> ; public static final int INITIALIZER = <NUM_LIT:2> ; public static final int ENUM_CONSTANT = <NUM_LIT:3> ; public static final int LOCAL_VARIABLE = <NUM_LIT:4> ; public static final int PARAMETER = <NUM_LIT:5> ; public static final int TYPE_PARAMETER = <NUM_LIT:6> ; public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public abstract int getKind ( ) ; public boolean isSuperAccess ( ) { return false ; } public boolean isTypeAccess ( ) { return false ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { printAsExpression ( indent , output ) ; switch ( getKind ( ) ) { case ENUM_CONSTANT : return output . append ( '<CHAR_LIT:U+002C>' ) ; default : return output . append ( '<CHAR_LIT:;>' ) ; } } public StringBuffer printAsExpression ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; printModifiers ( this . modifiers , output ) ; if ( this . annotations != null ) printAnnotations ( this . annotations , output ) ; if ( this . type != null ) { this . type . print ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:U+0020>' ) ; } output . append ( this . name ) ; switch ( getKind ( ) ) { case ENUM_CONSTANT : if ( this . initialization != null ) { this . initialization . printExpression ( indent , output ) ; } break ; default : if ( this . initialization != null ) { output . append ( "<STR_LIT:U+0020=U+0020>" ) ; this . initialization . printExpression ( indent , output ) ; } } return output ; } public void resolve ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { this . hiddenVariableDepth = depth ; } public void setFieldIndex ( int depth ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . MissingTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemFieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . VariableBinding ; import org . eclipse . jdt . internal . compiler . problem . AbortMethod ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class SingleNameReference extends NameReference implements OperatorIds { public static final int READ = <NUM_LIT:0> ; public static final int WRITE = <NUM_LIT:1> ; public char [ ] token ; public MethodBinding [ ] syntheticAccessors ; public TypeBinding genericCast ; public SingleNameReference ( char [ ] source , long pos ) { super ( ) ; this . token = source ; this . sourceStart = ( int ) ( pos > > > <NUM_LIT:32> ) ; this . sourceEnd = ( int ) pos ; } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { boolean isReachable = ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ; if ( isCompound ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : FieldBinding fieldBinding = ( FieldBinding ) this . binding ; if ( fieldBinding . isBlankFinal ( ) && currentScope . needBlankFinalFieldInitializationCheck ( fieldBinding ) ) { FlowInfo fieldInits = flowContext . getInitsForFinalBlankInitializationCheck ( fieldBinding . declaringClass . original ( ) , flowInfo ) ; if ( ! fieldInits . isDefinitelyAssigned ( fieldBinding ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( fieldBinding , this ) ; } } if ( ! fieldBinding . isStatic ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( fieldBinding . declaringClass ) ; } manageSyntheticAccessIfNecessary ( currentScope , flowInfo , true ) ; break ; case Binding . LOCAL : LocalVariableBinding localBinding ; if ( ! flowInfo . isDefinitelyAssigned ( localBinding = ( LocalVariableBinding ) this . binding ) ) { currentScope . problemReporter ( ) . uninitializedLocalVariable ( localBinding , this ) ; } if ( localBinding . useFlag != LocalVariableBinding . USED ) { if ( isReachable && ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { localBinding . useFlag = LocalVariableBinding . USED ; } else { if ( localBinding . useFlag <= LocalVariableBinding . UNUSED ) localBinding . useFlag -- ; } } } } if ( assignment . expression != null ) { flowInfo = assignment . expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : manageSyntheticAccessIfNecessary ( currentScope , flowInfo , false ) ; FieldBinding fieldBinding = ( FieldBinding ) this . binding ; if ( fieldBinding . isFinal ( ) ) { if ( ! isCompound && fieldBinding . isBlankFinal ( ) && currentScope . allowBlankFinalFieldAssignment ( fieldBinding ) ) { if ( flowInfo . isPotentiallyAssigned ( fieldBinding ) ) { currentScope . problemReporter ( ) . duplicateInitializationOfBlankFinalField ( fieldBinding , this ) ; } else { flowContext . recordSettingFinal ( fieldBinding , this , flowInfo ) ; } flowInfo . markAsDefinitelyAssigned ( fieldBinding ) ; } else { currentScope . problemReporter ( ) . cannotAssignToFinalField ( fieldBinding , this ) ; } } if ( ! fieldBinding . isStatic ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( fieldBinding . declaringClass ) ; } break ; case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; if ( ! flowInfo . isDefinitelyAssigned ( localBinding ) ) { this . bits |= ASTNode . FirstAssignmentToLocal ; } else { this . bits &= ~ ASTNode . FirstAssignmentToLocal ; } if ( localBinding . isFinal ( ) ) { if ( ( this . bits & ASTNode . DepthMASK ) == <NUM_LIT:0> ) { if ( ( isReachable && isCompound ) || ! localBinding . isBlankFinal ( ) ) { currentScope . problemReporter ( ) . cannotAssignToFinalLocal ( localBinding , this ) ; } else if ( flowInfo . isPotentiallyAssigned ( localBinding ) ) { currentScope . problemReporter ( ) . duplicateInitializationOfFinalLocal ( localBinding , this ) ; } else { flowContext . recordSettingFinal ( localBinding , this , flowInfo ) ; } } else { currentScope . problemReporter ( ) . cannotAssignToFinalOuterLocal ( localBinding , this ) ; } } else if ( ( localBinding . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) { currentScope . problemReporter ( ) . parameterAssignment ( localBinding , this ) ; } flowInfo . markAsDefinitelyAssigned ( localBinding ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return analyseCode ( currentScope , flowContext , flowInfo , true ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : if ( valueRequired || currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo , true ) ; } FieldBinding fieldBinding = ( FieldBinding ) this . binding ; if ( fieldBinding . isBlankFinal ( ) && currentScope . needBlankFinalFieldInitializationCheck ( fieldBinding ) ) { FlowInfo fieldInits = flowContext . getInitsForFinalBlankInitializationCheck ( fieldBinding . declaringClass . original ( ) , flowInfo ) ; if ( ! fieldInits . isDefinitelyAssigned ( fieldBinding ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( fieldBinding , this ) ; } } if ( ! fieldBinding . isStatic ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( fieldBinding . declaringClass ) ; } break ; case Binding . LOCAL : LocalVariableBinding localBinding ; if ( ! flowInfo . isDefinitelyAssigned ( localBinding = ( LocalVariableBinding ) this . binding ) ) { currentScope . problemReporter ( ) . uninitializedLocalVariable ( localBinding , this ) ; } if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { localBinding . useFlag = LocalVariableBinding . USED ; } else if ( localBinding . useFlag == LocalVariableBinding . UNUSED ) { localBinding . useFlag = LocalVariableBinding . FAKE_USED ; } } if ( valueRequired ) { manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; } return flowInfo ; } public TypeBinding checkFieldAccess ( BlockScope scope ) { FieldBinding fieldBinding = ( FieldBinding ) this . binding ; this . constant = fieldBinding . constant ( ) ; this . bits &= ~ ASTNode . RestrictiveFlagMASK ; this . bits |= Binding . FIELD ; MethodScope methodScope = scope . methodScope ( ) ; if ( fieldBinding . isStatic ( ) ) { ReferenceBinding declaringClass = fieldBinding . declaringClass ; if ( declaringClass . isEnum ( ) ) { SourceTypeBinding sourceType = scope . enclosingSourceType ( ) ; if ( this . constant == Constant . NotAConstant && ! methodScope . isStatic && ( sourceType == declaringClass || sourceType . superclass == declaringClass ) && methodScope . isInsideInitializerOrConstructor ( ) ) { scope . problemReporter ( ) . enumStaticFieldUsedDuringInitialization ( fieldBinding , this ) ; } } } else { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnqualifiedFieldAccess ) != ProblemSeverities . Ignore ) { scope . problemReporter ( ) . unqualifiedFieldAccess ( this , fieldBinding ) ; } if ( methodScope . isStatic ) { scope . problemReporter ( ) . staticFieldAccessToNonStaticVariable ( this , fieldBinding ) ; return fieldBinding . type ; } } if ( isFieldUseDeprecated ( fieldBinding , scope , this . bits ) ) scope . problemReporter ( ) . deprecatedField ( fieldBinding , this ) ; if ( ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> && methodScope . enclosingSourceType ( ) == fieldBinding . original ( ) . declaringClass && methodScope . lastVisibleFieldID >= <NUM_LIT:0> && fieldBinding . id >= methodScope . lastVisibleFieldID && ( ! fieldBinding . isStatic ( ) || methodScope . isStatic ) ) { scope . problemReporter ( ) . forwardReference ( this , <NUM_LIT:0> , fieldBinding ) ; this . bits |= ASTNode . IgnoreNoEffectAssignCheck ; } return fieldBinding . type ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { if ( runtimeTimeType == null || compileTimeType == null ) return ; if ( ( this . bits & Binding . FIELD ) != <NUM_LIT:0> && this . binding != null && this . binding . isValidBinding ( ) ) { FieldBinding field = ( FieldBinding ) this . binding ; FieldBinding originalBinding = field . original ( ) ; TypeBinding originalType = originalBinding . type ; if ( originalType . leafComponentType ( ) . isTypeVariable ( ) ) { TypeBinding targetType = ( ! compileTimeType . isBaseType ( ) && runtimeTimeType . isBaseType ( ) ) ? compileTimeType : runtimeTimeType ; this . genericCast = originalType . genericCast ( scope . boxing ( targetType ) ) ; if ( this . genericCast instanceof ReferenceBinding ) { ReferenceBinding referenceCast = ( ReferenceBinding ) this . genericCast ; if ( ! referenceCast . canBeSeenBy ( scope ) ) { scope . problemReporter ( ) . invalidType ( this , new ProblemReferenceBinding ( CharOperation . splitOn ( '<CHAR_LIT:.>' , referenceCast . shortReadableName ( ) ) , referenceCast , ProblemReasons . NotVisible ) ) ; } } } } super . computeConversion ( scope , runtimeTimeType , compileTimeType ) ; } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { if ( assignment . expression . isCompactableOperation ( ) ) { BinaryExpression operation = ( BinaryExpression ) assignment . expression ; int operator = ( operation . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ; SingleNameReference variableReference ; if ( ( operation . left instanceof SingleNameReference ) && ( ( variableReference = ( SingleNameReference ) operation . left ) . binding == this . binding ) ) { variableReference . generateCompoundAssignment ( currentScope , codeStream , this . syntheticAccessors == null ? null : this . syntheticAccessors [ SingleNameReference . WRITE ] , operation . right , operator , operation . implicitConversion , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } return ; } if ( ( operation . right instanceof SingleNameReference ) && ( ( operator == OperatorIds . PLUS ) || ( operator == OperatorIds . MULTIPLY ) ) && ( ( variableReference = ( SingleNameReference ) operation . right ) . binding == this . binding ) && ( operation . left . constant != Constant . NotAConstant ) && ( ( ( operation . left . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) != TypeIds . T_JavaLangString ) && ( ( ( operation . right . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) != TypeIds . T_JavaLangString ) ) { variableReference . generateCompoundAssignment ( currentScope , codeStream , this . syntheticAccessors == null ? null : this . syntheticAccessors [ SingleNameReference . WRITE ] , operation . left , operator , operation . implicitConversion , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } return ; } } switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : int pc = codeStream . position ; FieldBinding codegenBinding = ( ( FieldBinding ) this . binding ) . original ( ) ; if ( ! codegenBinding . isStatic ( ) ) { if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; Object [ ] emulationPath = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , targetType , currentScope ) ; } else { generateReceiver ( codeStream ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; assignment . expression . generateCode ( currentScope , codeStream , true ) ; fieldStore ( currentScope , codeStream , codegenBinding , this . syntheticAccessors == null ? null : this . syntheticAccessors [ SingleNameReference . WRITE ] , this . actualReceiverType , true , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } return ; case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; if ( localBinding . resolvedPosition != - <NUM_LIT:1> ) { assignment . expression . generateCode ( currentScope , codeStream , true ) ; } else { if ( assignment . expression . constant != Constant . NotAConstant ) { if ( valueRequired ) { codeStream . generateConstant ( assignment . expression . constant , assignment . implicitConversion ) ; } } else { assignment . expression . generateCode ( currentScope , codeStream , true ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } else { switch ( localBinding . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; break ; } } } return ; } if ( localBinding . type . isArrayType ( ) && ( ( assignment . expression instanceof CastExpression ) && ( ( ( CastExpression ) assignment . expression ) . innermostCastedExpression ( ) . resolvedType == TypeBinding . NULL ) ) ) { codeStream . checkcast ( localBinding . type ) ; } codeStream . store ( localBinding , valueRequired ) ; if ( ( this . bits & ASTNode . FirstAssignmentToLocal ) != <NUM_LIT:0> ) { localBinding . recordInitializationStartPC ( codeStream . position ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } else { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : FieldBinding codegenField = ( ( FieldBinding ) this . binding ) . original ( ) ; Constant fieldConstant = codegenField . constant ( ) ; if ( fieldConstant != Constant . NotAConstant ) { if ( valueRequired ) { codeStream . generateConstant ( fieldConstant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( codegenField . isStatic ( ) ) { if ( ! valueRequired && ( ( FieldBinding ) this . binding ) . original ( ) . declaringClass == this . actualReceiverType . erasure ( ) && ( ( this . implicitConversion & TypeIds . UNBOXING ) == <NUM_LIT:0> ) && this . genericCast == null ) { codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( ( this . syntheticAccessors == null ) || ( this . syntheticAccessors [ SingleNameReference . READ ] == null ) ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenField , this . actualReceiverType , true ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenField , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ SingleNameReference . READ ] , null ) ; } } else { if ( ! valueRequired && ( this . implicitConversion & TypeIds . UNBOXING ) == <NUM_LIT:0> && this . genericCast == null ) { codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; Object [ ] emulationPath = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , targetType , currentScope ) ; } else { generateReceiver ( codeStream ) ; } if ( ( this . syntheticAccessors == null ) || ( this . syntheticAccessors [ SingleNameReference . READ ] == null ) ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenField , this . actualReceiverType , true ) ; codeStream . fieldAccess ( Opcodes . OPC_getfield , codegenField , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ SingleNameReference . READ ] , null ) ; } } break ; case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; if ( localBinding . resolvedPosition == - <NUM_LIT:1> ) { if ( valueRequired ) { localBinding . useFlag = LocalVariableBinding . USED ; throw new AbortMethod ( CodeStream . RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE , null ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( ! valueRequired && ( this . implicitConversion & TypeIds . UNBOXING ) == <NUM_LIT:0> ) { codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { VariableBinding [ ] path = currentScope . getEmulationPath ( localBinding ) ; codeStream . generateOuterAccess ( path , this , localBinding , currentScope ) ; } else { codeStream . load ( localBinding ) ; } break ; default : codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } } if ( this . genericCast != null ) codeStream . checkcast ( this . genericCast ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { boolean isUnboxing = ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ; if ( isUnboxing ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( isUnboxing ? postConversionType ( currentScope ) . id : this . resolvedType . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; Reference . reportOnlyUselesslyReadLocal ( currentScope , localBinding , valueRequired ) ; break ; case Binding . FIELD : reportOnlyUselesslyReadPrivateField ( currentScope , ( FieldBinding ) this . binding , valueRequired ) ; } this . generateCompoundAssignment ( currentScope , codeStream , this . syntheticAccessors == null ? null : this . syntheticAccessors [ SingleNameReference . WRITE ] , expression , operator , assignmentImplicitConversion , valueRequired ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , MethodBinding writeAccessor , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : FieldBinding codegenField = ( ( FieldBinding ) this . binding ) . original ( ) ; if ( codegenField . isStatic ( ) ) { if ( ( this . syntheticAccessors == null ) || ( this . syntheticAccessors [ SingleNameReference . READ ] == null ) ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenField , this . actualReceiverType , true ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenField , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ SingleNameReference . READ ] , null ) ; } } else { if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; Object [ ] emulationPath = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , targetType , currentScope ) ; } else { codeStream . aload_0 ( ) ; } codeStream . dup ( ) ; if ( ( this . syntheticAccessors == null ) || ( this . syntheticAccessors [ SingleNameReference . READ ] == null ) ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenField , this . actualReceiverType , true ) ; codeStream . fieldAccess ( Opcodes . OPC_getfield , codegenField , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ SingleNameReference . READ ] , null ) ; } } break ; case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; Constant assignConstant ; switch ( localBinding . type . id ) { case T_JavaLangString : codeStream . generateStringConcatenationAppend ( currentScope , this , expression ) ; if ( valueRequired ) { codeStream . dup ( ) ; } codeStream . store ( localBinding , false ) ; return ; case T_int : assignConstant = expression . constant ; if ( localBinding . resolvedPosition == - <NUM_LIT:1> ) { if ( valueRequired ) { localBinding . useFlag = LocalVariableBinding . USED ; throw new AbortMethod ( CodeStream . RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE , null ) ; } else if ( assignConstant == Constant . NotAConstant ) { expression . generateCode ( currentScope , codeStream , false ) ; } return ; } if ( ( assignConstant != Constant . NotAConstant ) && ( assignConstant . typeID ( ) != TypeIds . T_float ) && ( assignConstant . typeID ( ) != TypeIds . T_double ) ) { switch ( operator ) { case PLUS : int increment = assignConstant . intValue ( ) ; if ( increment != ( short ) increment ) break ; codeStream . iinc ( localBinding . resolvedPosition , increment ) ; if ( valueRequired ) { codeStream . load ( localBinding ) ; } return ; case MINUS : increment = - assignConstant . intValue ( ) ; if ( increment != ( short ) increment ) break ; codeStream . iinc ( localBinding . resolvedPosition , increment ) ; if ( valueRequired ) { codeStream . load ( localBinding ) ; } return ; } } default : if ( localBinding . resolvedPosition == - <NUM_LIT:1> ) { assignConstant = expression . constant ; if ( valueRequired ) { localBinding . useFlag = LocalVariableBinding . USED ; throw new AbortMethod ( CodeStream . RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE , null ) ; } else if ( assignConstant == Constant . NotAConstant ) { expression . generateCode ( currentScope , codeStream , false ) ; } return ; } codeStream . load ( localBinding ) ; } } int operationTypeID ; switch ( operationTypeID = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_JavaLangString : case T_JavaLangObject : case T_undefined : codeStream . generateStringConcatenationAppend ( currentScope , null , expression ) ; break ; default : if ( this . genericCast != null ) codeStream . checkcast ( this . genericCast ) ; codeStream . generateImplicitConversion ( this . implicitConversion ) ; if ( expression == IntLiteral . One ) { codeStream . generateConstant ( expression . constant , this . implicitConversion ) ; } else { expression . generateCode ( currentScope , codeStream , true ) ; } codeStream . sendOperator ( operator , operationTypeID ) ; codeStream . generateImplicitConversion ( assignmentImplicitConversion ) ; } switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : FieldBinding codegenField = ( ( FieldBinding ) this . binding ) . original ( ) ; fieldStore ( currentScope , codeStream , codegenField , writeAccessor , this . actualReceiverType , true , valueRequired ) ; return ; case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; if ( valueRequired ) { switch ( localBinding . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } } codeStream . store ( localBinding , false ) ; } } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : FieldBinding fieldBinding = ( FieldBinding ) this . binding ; reportOnlyUselesslyReadPrivateField ( currentScope , fieldBinding , valueRequired ) ; FieldBinding codegenField = fieldBinding . original ( ) ; if ( codegenField . isStatic ( ) ) { if ( ( this . syntheticAccessors == null ) || ( this . syntheticAccessors [ SingleNameReference . READ ] == null ) ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenField , this . actualReceiverType , true ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , codegenField , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ SingleNameReference . READ ] , null ) ; } } else { if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; Object [ ] emulationPath = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , targetType , currentScope ) ; } else { codeStream . aload_0 ( ) ; } codeStream . dup ( ) ; if ( ( this . syntheticAccessors == null ) || ( this . syntheticAccessors [ SingleNameReference . READ ] == null ) ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenField , this . actualReceiverType , true ) ; codeStream . fieldAccess ( Opcodes . OPC_getfield , codegenField , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessors [ SingleNameReference . READ ] , null ) ; } } TypeBinding operandType ; if ( this . genericCast != null ) { codeStream . checkcast ( this . genericCast ) ; operandType = this . genericCast ; } else { operandType = codegenField . type ; } if ( valueRequired ) { if ( codegenField . isStatic ( ) ) { switch ( operandType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } } else { switch ( operandType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2_x1 ( ) ; break ; default : codeStream . dup_x1 ( ) ; break ; } } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateConstant ( postIncrement . expression . constant , this . implicitConversion ) ; codeStream . sendOperator ( postIncrement . operator , this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . generateImplicitConversion ( postIncrement . preAssignImplicitConversion ) ; fieldStore ( currentScope , codeStream , codegenField , this . syntheticAccessors == null ? null : this . syntheticAccessors [ SingleNameReference . WRITE ] , this . actualReceiverType , true , false ) ; return ; case Binding . LOCAL : LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; Reference . reportOnlyUselesslyReadLocal ( currentScope , localBinding , valueRequired ) ; if ( localBinding . resolvedPosition == - <NUM_LIT:1> ) { if ( valueRequired ) { localBinding . useFlag = LocalVariableBinding . USED ; throw new AbortMethod ( CodeStream . RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE , null ) ; } return ; } if ( localBinding . type == TypeBinding . INT ) { if ( valueRequired ) { codeStream . load ( localBinding ) ; } if ( postIncrement . operator == OperatorIds . PLUS ) { codeStream . iinc ( localBinding . resolvedPosition , <NUM_LIT:1> ) ; } else { codeStream . iinc ( localBinding . resolvedPosition , - <NUM_LIT:1> ) ; } } else { codeStream . load ( localBinding ) ; if ( valueRequired ) { switch ( localBinding . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateConstant ( postIncrement . expression . constant , this . implicitConversion ) ; codeStream . sendOperator ( postIncrement . operator , this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . generateImplicitConversion ( postIncrement . preAssignImplicitConversion ) ; codeStream . store ( localBinding , false ) ; } } } public void generateReceiver ( CodeStream codeStream ) { codeStream . aload_0 ( ) ; } public TypeBinding [ ] genericTypeArguments ( ) { return null ; } public LocalVariableBinding localVariableBinding ( ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : break ; case Binding . LOCAL : return ( LocalVariableBinding ) this . binding ; } return null ; } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( ( this . bits & ASTNode . DepthMASK ) == <NUM_LIT:0> ) || ( this . constant != Constant . NotAConstant ) ) { return ; } if ( ( this . bits & ASTNode . RestrictiveFlagMASK ) == Binding . LOCAL ) { LocalVariableBinding localVariableBinding = ( LocalVariableBinding ) this . binding ; if ( localVariableBinding != null ) { if ( ( localVariableBinding . tagBits & TagBits . NotInitialized ) != <NUM_LIT:0> ) { return ; } switch ( localVariableBinding . useFlag ) { case LocalVariableBinding . FAKE_USED : case LocalVariableBinding . USED : currentScope . emulateOuterAccess ( localVariableBinding ) ; } } } } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo , boolean isReadAccess ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; if ( this . constant != Constant . NotAConstant ) return ; if ( ( this . bits & Binding . FIELD ) != <NUM_LIT:0> ) { FieldBinding fieldBinding = ( FieldBinding ) this . binding ; FieldBinding codegenField = fieldBinding . original ( ) ; if ( ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) && ( codegenField . isPrivate ( ) || ( codegenField . isProtected ( ) && codegenField . declaringClass . getPackage ( ) != currentScope . enclosingSourceType ( ) . getPackage ( ) ) ) ) { if ( this . syntheticAccessors == null ) this . syntheticAccessors = new MethodBinding [ <NUM_LIT:2> ] ; this . syntheticAccessors [ isReadAccess ? SingleNameReference . READ : SingleNameReference . WRITE ] = ( ( SourceTypeBinding ) currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ) . addSyntheticMethod ( codegenField , isReadAccess , false ) ; currentScope . problemReporter ( ) . needToEmulateFieldAccess ( codegenField , this , isReadAccess ) ; return ; } } } public int nullStatus ( FlowInfo flowInfo ) { if ( this . constant != null && this . constant != Constant . NotAConstant ) { return FlowInfo . NON_NULL ; } switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : return FlowInfo . UNKNOWN ; case Binding . LOCAL : LocalVariableBinding local = ( LocalVariableBinding ) this . binding ; if ( local != null ) return flowInfo . nullStatus ( local ) ; } return FlowInfo . NON_NULL ; } public TypeBinding postConversionType ( Scope scope ) { TypeBinding convertedType = this . resolvedType ; if ( this . genericCast != null ) convertedType = this . genericCast ; int runtimeType = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case T_boolean : convertedType = TypeBinding . BOOLEAN ; break ; case T_byte : convertedType = TypeBinding . BYTE ; break ; case T_short : convertedType = TypeBinding . SHORT ; break ; case T_char : convertedType = TypeBinding . CHAR ; break ; case T_int : convertedType = TypeBinding . INT ; break ; case T_float : convertedType = TypeBinding . FLOAT ; break ; case T_long : convertedType = TypeBinding . LONG ; break ; case T_double : convertedType = TypeBinding . DOUBLE ; break ; default : } if ( ( this . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { convertedType = scope . environment ( ) . computeBoxingType ( convertedType ) ; } return convertedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return output . append ( this . token ) ; } public TypeBinding reportError ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( this . binding instanceof ProblemFieldBinding ) { scope . problemReporter ( ) . invalidField ( this , ( FieldBinding ) this . binding ) ; } else if ( this . binding instanceof ProblemReferenceBinding || this . binding instanceof MissingTypeBinding ) { scope . problemReporter ( ) . invalidType ( this , ( TypeBinding ) this . binding ) ; } else { scope . problemReporter ( ) . unresolvableReference ( this , this . binding ) ; } return null ; } public TypeBinding resolveType ( BlockScope scope ) { if ( this . actualReceiverType != null ) { this . binding = scope . getField ( this . actualReceiverType , this . token , this ) ; } else { this . actualReceiverType = scope . enclosingSourceType ( ) ; this . binding = scope . getBinding ( this . token , this . bits & ASTNode . RestrictiveFlagMASK , this , true ) ; } if ( this . binding . isValidBinding ( ) ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . VARIABLE : case Binding . VARIABLE | Binding . TYPE : if ( this . binding instanceof VariableBinding ) { VariableBinding variable = ( VariableBinding ) this . binding ; TypeBinding variableType ; if ( this . binding instanceof LocalVariableBinding ) { this . bits &= ~ ASTNode . RestrictiveFlagMASK ; this . bits |= Binding . LOCAL ; if ( ! variable . isFinal ( ) && ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . cannotReferToNonFinalOuterLocal ( ( LocalVariableBinding ) variable , this ) ; } variableType = variable . type ; this . constant = ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> ? variable . constant ( ) : Constant . NotAConstant ; } else { variableType = checkFieldAccess ( scope ) ; } if ( variableType != null ) { this . resolvedType = variableType = ( ( ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> ) ? variableType . capture ( scope , this . sourceEnd ) : variableType ) ; if ( ( variableType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( ( this . bits & Binding . LOCAL ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . invalidType ( this , variableType ) ; } return null ; } } return variableType ; } this . bits &= ~ ASTNode . RestrictiveFlagMASK ; this . bits |= Binding . TYPE ; case Binding . TYPE : this . constant = Constant . NotAConstant ; TypeBinding type = ( TypeBinding ) this . binding ; if ( isTypeUseDeprecated ( type , scope ) ) scope . problemReporter ( ) . deprecatedType ( type , this ) ; type = scope . environment ( ) . convertToRawType ( type , false ) ; return this . resolvedType = type ; } } return this . resolvedType = reportError ( scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public String unboundReferenceErrorName ( ) { return new String ( this . token ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; 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 . ParameterizedGenericMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ParameterizedTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . PolymorphicMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class CastExpression extends Expression { public Expression expression ; public TypeReference type ; public TypeBinding expectedType ; public CastExpression ( Expression expression , TypeReference type ) { this . expression = expression ; this . type = type ; type . bits |= ASTNode . IgnoreRawTypeCheck ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowInfo result = this . expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; if ( ( this . expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . expression . checkNPE ( currentScope , flowContext , flowInfo ) ; } return result ; } public static void checkNeedForAssignedCast ( BlockScope scope , TypeBinding expectedType , CastExpression rhs ) { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) == ProblemSeverities . Ignore ) return ; TypeBinding castedExpressionType = rhs . expression . resolvedType ; if ( castedExpressionType == null || rhs . resolvedType . isBaseType ( ) ) return ; if ( castedExpressionType . isCompatibleWith ( expectedType ) ) { scope . problemReporter ( ) . unnecessaryCast ( rhs ) ; } } public static void checkNeedForCastCast ( BlockScope scope , CastExpression enclosingCast ) { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) == ProblemSeverities . Ignore ) return ; CastExpression nestedCast = ( CastExpression ) enclosingCast . expression ; if ( ( nestedCast . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> ) return ; CastExpression alternateCast = new CastExpression ( null , enclosingCast . type ) ; alternateCast . resolvedType = enclosingCast . resolvedType ; if ( ! alternateCast . checkCastTypesCompatibility ( scope , enclosingCast . resolvedType , nestedCast . expression . resolvedType , null ) ) return ; scope . problemReporter ( ) . unnecessaryCast ( nestedCast ) ; } public static void checkNeedForEnclosingInstanceCast ( BlockScope scope , Expression enclosingInstance , TypeBinding enclosingInstanceType , TypeBinding memberType ) { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) == ProblemSeverities . Ignore ) return ; TypeBinding castedExpressionType = ( ( CastExpression ) enclosingInstance ) . expression . resolvedType ; if ( castedExpressionType == null ) return ; if ( castedExpressionType == enclosingInstanceType ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) enclosingInstance ) ; } else if ( castedExpressionType == TypeBinding . NULL ) { return ; } else { TypeBinding alternateEnclosingInstanceType = castedExpressionType ; if ( castedExpressionType . isBaseType ( ) || castedExpressionType . isArrayType ( ) ) return ; if ( memberType == scope . getMemberType ( memberType . sourceName ( ) , ( ReferenceBinding ) alternateEnclosingInstanceType ) ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) enclosingInstance ) ; } } } public static void checkNeedForArgumentCast ( BlockScope scope , int operator , int operatorSignature , Expression expression , int expressionTypeId ) { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) == ProblemSeverities . Ignore ) return ; if ( ( expression . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> && expression . resolvedType . isBaseType ( ) ) { return ; } else { TypeBinding alternateLeftType = ( ( CastExpression ) expression ) . expression . resolvedType ; if ( alternateLeftType == null ) return ; if ( alternateLeftType . id == expressionTypeId ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) expression ) ; return ; } } } public static void checkNeedForArgumentCasts ( BlockScope scope , Expression receiver , TypeBinding receiverType , MethodBinding binding , Expression [ ] arguments , TypeBinding [ ] argumentTypes , final InvocationSite invocationSite ) { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) == ProblemSeverities . Ignore ) return ; int length = argumentTypes . length ; TypeBinding [ ] rawArgumentTypes = argumentTypes ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = arguments [ i ] ; if ( argument instanceof CastExpression ) { if ( ( argument . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> && argument . resolvedType . isBaseType ( ) ) { continue ; } TypeBinding castedExpressionType = ( ( CastExpression ) argument ) . expression . resolvedType ; if ( castedExpressionType == null ) return ; if ( castedExpressionType == argumentTypes [ i ] ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) argument ) ; } else if ( castedExpressionType == TypeBinding . NULL ) { continue ; } else if ( ( argument . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { continue ; } else { if ( rawArgumentTypes == argumentTypes ) { System . arraycopy ( rawArgumentTypes , <NUM_LIT:0> , rawArgumentTypes = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; } rawArgumentTypes [ i ] = castedExpressionType ; } } } if ( rawArgumentTypes != argumentTypes ) { checkAlternateBinding ( scope , receiver , receiverType , binding , arguments , argumentTypes , rawArgumentTypes , invocationSite ) ; } } public static void checkNeedForArgumentCasts ( BlockScope scope , int operator , int operatorSignature , Expression left , int leftTypeId , boolean leftIsCast , Expression right , int rightTypeId , boolean rightIsCast ) { if ( scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) == ProblemSeverities . Ignore ) return ; int alternateLeftTypeId = leftTypeId ; if ( leftIsCast ) { if ( ( left . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> && left . resolvedType . isBaseType ( ) ) { leftIsCast = false ; } else { TypeBinding alternateLeftType = ( ( CastExpression ) left ) . expression . resolvedType ; if ( alternateLeftType == null ) return ; if ( ( alternateLeftTypeId = alternateLeftType . id ) == leftTypeId || scope . environment ( ) . computeBoxingType ( alternateLeftType ) . id == leftTypeId ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) left ) ; leftIsCast = false ; } else if ( alternateLeftTypeId == TypeIds . T_null ) { alternateLeftTypeId = leftTypeId ; leftIsCast = false ; } } } int alternateRightTypeId = rightTypeId ; if ( rightIsCast ) { if ( ( right . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> && right . resolvedType . isBaseType ( ) ) { rightIsCast = false ; } else { TypeBinding alternateRightType = ( ( CastExpression ) right ) . expression . resolvedType ; if ( alternateRightType == null ) return ; if ( ( alternateRightTypeId = alternateRightType . id ) == rightTypeId || scope . environment ( ) . computeBoxingType ( alternateRightType ) . id == rightTypeId ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) right ) ; rightIsCast = false ; } else if ( alternateRightTypeId == TypeIds . T_null ) { alternateRightTypeId = rightTypeId ; rightIsCast = false ; } } } if ( leftIsCast || rightIsCast ) { if ( alternateLeftTypeId > <NUM_LIT:15> || alternateRightTypeId > <NUM_LIT:15> ) { if ( alternateLeftTypeId == TypeIds . T_JavaLangString ) { alternateRightTypeId = TypeIds . T_JavaLangObject ; } else if ( alternateRightTypeId == TypeIds . T_JavaLangString ) { alternateLeftTypeId = TypeIds . T_JavaLangObject ; } else { return ; } } int alternateOperatorSignature = OperatorExpression . OperatorSignatures [ operator ] [ ( alternateLeftTypeId << <NUM_LIT:4> ) + alternateRightTypeId ] ; final int CompareMASK = ( <NUM_LIT> << <NUM_LIT:16> ) + ( <NUM_LIT> << <NUM_LIT:8> ) + <NUM_LIT> ; if ( ( operatorSignature & CompareMASK ) == ( alternateOperatorSignature & CompareMASK ) ) { if ( leftIsCast ) scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) left ) ; if ( rightIsCast ) scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) right ) ; } } } private static void checkAlternateBinding ( BlockScope scope , Expression receiver , TypeBinding receiverType , MethodBinding binding , Expression [ ] arguments , TypeBinding [ ] originalArgumentTypes , TypeBinding [ ] alternateArgumentTypes , final InvocationSite invocationSite ) { InvocationSite fakeInvocationSite = 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 <NUM_LIT:0> ; } public int sourceEnd ( ) { return <NUM_LIT:0> ; } public TypeBinding expectedType ( ) { return invocationSite . expectedType ( ) ; } } ; MethodBinding bindingIfNoCast ; if ( binding . isConstructor ( ) ) { bindingIfNoCast = scope . getConstructor ( ( ReferenceBinding ) receiverType , alternateArgumentTypes , fakeInvocationSite ) ; } else { bindingIfNoCast = receiver . isImplicitThis ( ) ? scope . getImplicitMethod ( binding . selector , alternateArgumentTypes , fakeInvocationSite ) : scope . getMethod ( receiverType , binding . selector , alternateArgumentTypes , fakeInvocationSite ) ; } if ( bindingIfNoCast == binding ) { int argumentLength = originalArgumentTypes . length ; if ( binding . isVarargs ( ) ) { int paramLength = binding . parameters . length ; if ( paramLength == argumentLength ) { int varargsIndex = paramLength - <NUM_LIT:1> ; ArrayBinding varargsType = ( ArrayBinding ) binding . parameters [ varargsIndex ] ; TypeBinding lastArgType = alternateArgumentTypes [ varargsIndex ] ; if ( varargsType . dimensions != lastArgType . dimensions ( ) ) { return ; } if ( lastArgType . isCompatibleWith ( varargsType . elementsType ( ) ) && lastArgType . isCompatibleWith ( varargsType ) ) { return ; } } } for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { if ( originalArgumentTypes [ i ] != alternateArgumentTypes [ i ] ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) arguments [ i ] ) ; } } } } public boolean checkUnsafeCast ( Scope scope , TypeBinding castType , TypeBinding expressionType , TypeBinding match , boolean isNarrowing ) { if ( match == castType ) { if ( ! isNarrowing && match == this . resolvedType . leafComponentType ( ) ) { tagAsUnnecessaryCast ( scope , castType ) ; } return true ; } if ( match != null ) { if ( isNarrowing ? match . isProvablyDistinct ( expressionType ) : castType . isProvablyDistinct ( match ) ) { return false ; } } switch ( castType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : if ( ! castType . isReifiable ( ) ) { if ( match == null ) { this . bits |= ASTNode . UnsafeCast ; return true ; } switch ( match . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : if ( isNarrowing ) { if ( expressionType . isRawType ( ) || ! expressionType . isEquivalentTo ( match ) ) { this . bits |= ASTNode . UnsafeCast ; return true ; } ParameterizedTypeBinding paramCastType = ( ParameterizedTypeBinding ) castType ; ParameterizedTypeBinding paramMatch = ( ParameterizedTypeBinding ) match ; TypeBinding [ ] castArguments = paramCastType . arguments ; int length = castArguments == null ? <NUM_LIT:0> : castArguments . length ; if ( paramMatch . arguments == null || length > paramMatch . arguments . length ) { this . bits |= ASTNode . UnsafeCast ; } else if ( ( paramCastType . tagBits & ( TagBits . HasDirectWildcard | TagBits . HasTypeVariable ) ) != <NUM_LIT:0> ) { nextAlternateArgument : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { switch ( castArguments [ i ] . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . TYPE_PARAMETER : break ; default : continue nextAlternateArgument ; } TypeBinding [ ] alternateArguments ; System . arraycopy ( paramCastType . arguments , <NUM_LIT:0> , alternateArguments = new TypeBinding [ length ] , <NUM_LIT:0> , length ) ; alternateArguments [ i ] = scope . getJavaLangObject ( ) ; LookupEnvironment environment = scope . environment ( ) ; ParameterizedTypeBinding alternateCastType = environment . createParameterizedType ( ( ReferenceBinding ) castType . erasure ( ) , alternateArguments , castType . enclosingType ( ) ) ; if ( alternateCastType . findSuperTypeOriginatingFrom ( expressionType ) == match ) { this . bits |= ASTNode . UnsafeCast ; break ; } } } return true ; } else { if ( ! match . isEquivalentTo ( castType ) ) { this . bits |= ASTNode . UnsafeCast ; return true ; } } break ; case Binding . RAW_TYPE : this . bits |= ASTNode . UnsafeCast ; return true ; default : if ( isNarrowing ) { this . bits |= ASTNode . UnsafeCast ; return true ; } break ; } } break ; case Binding . ARRAY_TYPE : TypeBinding leafType = castType . leafComponentType ( ) ; if ( isNarrowing && ( ! leafType . isReifiable ( ) || leafType . isTypeVariable ( ) ) ) { this . bits |= ASTNode . UnsafeCast ; return true ; } break ; case Binding . TYPE_PARAMETER : this . bits |= ASTNode . UnsafeCast ; return true ; } if ( ! isNarrowing && match == this . resolvedType . leafComponentType ( ) ) { tagAsUnnecessaryCast ( scope , castType ) ; } return true ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; boolean needRuntimeCheckcast = ( this . bits & ASTNode . GenerateCheckcast ) != <NUM_LIT:0> ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired || needRuntimeCheckcast ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; if ( needRuntimeCheckcast ) { codeStream . checkcast ( this . resolvedType ) ; } if ( ! valueRequired ) { codeStream . pop ( ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } this . expression . generateCode ( currentScope , codeStream , valueRequired || needRuntimeCheckcast ) ; if ( needRuntimeCheckcast && this . expression . postConversionType ( currentScope ) != this . resolvedType . erasure ( ) ) { codeStream . checkcast ( this . resolvedType ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else if ( needRuntimeCheckcast ) { codeStream . pop ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public Expression innermostCastedExpression ( ) { Expression current = this . expression ; while ( current instanceof CastExpression ) { current = ( ( CastExpression ) current ) . expression ; } return current ; } public LocalVariableBinding localVariableBinding ( ) { return this . expression . localVariableBinding ( ) ; } public int nullStatus ( FlowInfo flowInfo ) { return this . expression . nullStatus ( flowInfo ) ; } public Constant optimizedBooleanConstant ( ) { switch ( this . resolvedType . id ) { case T_boolean : case T_JavaLangBoolean : return this . expression . optimizedBooleanConstant ( ) ; } return Constant . NotAConstant ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( '<CHAR_LIT:(>' ) ; this . type . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; return this . expression . printExpression ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; this . implicitConversion = TypeIds . T_undefined ; boolean exprContainCast = false ; TypeBinding castType = this . resolvedType = this . type . resolveType ( scope ) ; if ( this . expression instanceof CastExpression ) { this . expression . bits |= ASTNode . DisableUnnecessaryCastCheck ; exprContainCast = true ; } TypeBinding expressionType = this . expression . resolveType ( scope ) ; if ( this . expression instanceof MessageSend ) { MessageSend messageSend = ( MessageSend ) this . expression ; MethodBinding methodBinding = messageSend . binding ; if ( methodBinding != null && methodBinding . isPolymorphic ( ) ) { messageSend . binding = scope . environment ( ) . updatePolymorphicMethodReturnType ( ( PolymorphicMethodBinding ) methodBinding , castType ) ; if ( expressionType != castType ) { expressionType = castType ; this . bits |= ASTNode . DisableUnnecessaryCastCheck ; } } } if ( castType != null ) { if ( expressionType != null ) { boolean isLegal = checkCastTypesCompatibility ( scope , castType , expressionType , this . expression ) ; if ( isLegal ) { this . expression . computeConversion ( scope , castType , expressionType ) ; if ( ( this . bits & ASTNode . UnsafeCast ) != <NUM_LIT:0> ) { if ( scope . compilerOptions ( ) . reportUnavoidableGenericTypeProblems || ! this . expression . forcedToBeRaw ( scope . referenceContext ( ) ) ) { scope . problemReporter ( ) . unsafeCast ( this , scope ) ; } } else { if ( castType . isRawType ( ) && scope . compilerOptions ( ) . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore ) { scope . problemReporter ( ) . rawTypeReference ( this . type , castType ) ; } if ( ( this . bits & ( ASTNode . UnnecessaryCast | ASTNode . DisableUnnecessaryCastCheck ) ) == ASTNode . UnnecessaryCast ) { if ( ! isIndirectlyUsed ( ) ) scope . problemReporter ( ) . unnecessaryCast ( this ) ; } } } else { if ( ( castType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . typeCastError ( this , castType , expressionType ) ; } this . bits |= ASTNode . DisableUnnecessaryCastCheck ; } } this . resolvedType = castType . capture ( scope , this . sourceEnd ) ; if ( exprContainCast ) { checkNeedForCastCast ( scope , this ) ; } } return this . resolvedType ; } public void setExpectedType ( TypeBinding expectedType ) { this . expectedType = expectedType ; } private boolean isIndirectlyUsed ( ) { if ( this . expression instanceof MessageSend ) { MethodBinding method = ( ( MessageSend ) this . expression ) . binding ; if ( method instanceof ParameterizedGenericMethodBinding && ( ( ParameterizedGenericMethodBinding ) method ) . inferredReturnType ) { if ( this . expectedType == null ) return true ; if ( this . resolvedType != this . expectedType ) return true ; } } if ( this . expectedType != null && this . resolvedType . isBaseType ( ) && ! this . resolvedType . isCompatibleWith ( this . expectedType ) ) { return true ; } return false ; } public void tagAsNeedCheckCast ( ) { this . bits |= ASTNode . GenerateCheckcast ; } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { this . bits |= ASTNode . UnnecessaryCast ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . type . traverse ( visitor , blockScope ) ; this . expression . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . flow . UnconditionalFlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MissingTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . PolymorphicMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . RawTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; 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 . problem . ProblemSeverities ; public class MessageSend extends Expression implements InvocationSite { public Expression receiver ; public char [ ] selector ; public Expression [ ] arguments ; public MethodBinding binding ; public MethodBinding syntheticAccessor ; public TypeBinding expectedType ; public long nameSourcePosition ; public TypeBinding actualReceiverType ; public TypeBinding valueCast ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { boolean nonStatic = ! this . binding . isStatic ( ) ; boolean wasInsideAssert = ( ( flowContext . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) != <NUM_LIT:0> ) ; flowInfo = this . receiver . analyseCode ( currentScope , flowContext , flowInfo , nonStatic ) . unconditionalInits ( ) ; boolean analyseResources = currentScope . compilerOptions ( ) . analyseResourceLeaks ; if ( analyseResources && CharOperation . equals ( TypeConstants . CLOSE , this . selector ) ) { FakedTrackingVariable trackingVariable = FakedTrackingVariable . getCloseTrackingVariable ( this . receiver ) ; if ( trackingVariable != null ) { if ( trackingVariable . methodScope == currentScope . methodScope ( ) ) { trackingVariable . markClose ( flowInfo , flowContext ) ; } else { trackingVariable . markClosedInNestedMethod ( ) ; } } } if ( nonStatic ) { this . receiver . checkNPE ( currentScope , flowContext , flowInfo ) ; if ( this . receiver . isThis ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( this . binding . declaringClass ) ; } } else if ( this . receiver . isThis ( ) ) { if ( ( this . receiver . bits & ASTNode . IsImplicitThis ) == <NUM_LIT:0> ) { currentScope . resetEnclosingMethodStaticFlag ( ) ; } } FlowInfo conditionFlowInfo ; if ( this . arguments != null ) { int length = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = this . arguments [ i ] ; if ( ( argument . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { argument . checkNPE ( currentScope , flowContext , flowInfo ) ; } if ( this . receiver . resolvedType != null && this . receiver . resolvedType . id == TypeIds . T_OrgEclipseCoreRuntimeAssert && argument . resolvedType != null && argument . resolvedType . id == TypeIds . T_boolean ) { Constant cst = argument . optimizedBooleanConstant ( ) ; boolean isOptimizedTrueAssertion = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isOptimizedFalseAssertion = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; flowContext . tagBits |= FlowContext . HIDE_NULL_COMPARISON_WARNING ; conditionFlowInfo = argument . analyseCode ( currentScope , flowContext , flowInfo . copy ( ) ) ; if ( ! wasInsideAssert ) { flowContext . tagBits &= ~ FlowContext . HIDE_NULL_COMPARISON_WARNING ; } UnconditionalFlowInfo assertWhenTrueInfo = conditionFlowInfo . initsWhenTrue ( ) . unconditionalInits ( ) ; FlowInfo assertInfo = conditionFlowInfo . initsWhenFalse ( ) ; if ( isOptimizedTrueAssertion ) { assertInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( ! isOptimizedFalseAssertion ) { flowInfo = flowInfo . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) . addInitializationsFrom ( assertWhenTrueInfo . discardInitializationInfo ( ) ) ; } } else { flowInfo = argument . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } if ( analyseResources ) { flowInfo = FakedTrackingVariable . markPassedToOutside ( currentScope , argument , flowInfo , false ) ; } } analyseArguments ( currentScope , flowContext , flowInfo , this . binding , this . arguments ) ; } ReferenceBinding [ ] thrownExceptions ; if ( ( thrownExceptions = this . binding . thrownExceptions ) != Binding . NO_EXCEPTIONS ) { if ( ( this . bits & ASTNode . Unchecked ) != <NUM_LIT:0> && this . genericTypeArguments == null ) { thrownExceptions = currentScope . environment ( ) . convertToRawTypes ( this . binding . thrownExceptions , true , true ) ; } flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo . copy ( ) , currentScope ) ; } manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public void checkNPE ( BlockScope scope , FlowContext flowContext , FlowInfo flowInfo ) { super . checkNPE ( scope , flowContext , flowInfo ) ; if ( ( nullStatus ( flowInfo ) & FlowInfo . POTENTIALLY_NULL ) != <NUM_LIT:0> ) scope . problemReporter ( ) . messageSendPotentialNullReference ( this . binding , this ) ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { if ( runtimeTimeType == null || compileTimeType == null ) return ; if ( this . binding != null && this . binding . isValidBinding ( ) ) { MethodBinding originalBinding = this . binding . original ( ) ; TypeBinding originalType = originalBinding . returnType ; if ( originalType . leafComponentType ( ) . isTypeVariable ( ) ) { TypeBinding targetType = ( ! compileTimeType . isBaseType ( ) && runtimeTimeType . isBaseType ( ) ) ? compileTimeType : runtimeTimeType ; this . valueCast = originalType . genericCast ( targetType ) ; } else if ( this . binding == scope . environment ( ) . arrayClone && runtimeTimeType . id != TypeIds . T_JavaLangObject && scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ) { this . valueCast = runtimeTimeType ; } if ( this . valueCast instanceof ReferenceBinding ) { ReferenceBinding referenceCast = ( ReferenceBinding ) this . valueCast ; if ( ! referenceCast . canBeSeenBy ( scope ) ) { scope . problemReporter ( ) . invalidType ( this , new ProblemReferenceBinding ( CharOperation . splitOn ( '<CHAR_LIT:.>' , referenceCast . shortReadableName ( ) ) , referenceCast , ProblemReasons . NotVisible ) ) ; } } } super . computeConversion ( scope , runtimeTimeType , compileTimeType ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; MethodBinding codegenBinding = this . binding instanceof PolymorphicMethodBinding ? this . binding : this . binding . original ( ) ; boolean isStatic = codegenBinding . isStatic ( ) ; if ( isStatic ) { this . receiver . generateCode ( currentScope , codeStream , false ) ; } else if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> && this . receiver . isImplicitThis ( ) ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; Object [ ] path = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( path , this , targetType , currentScope ) ; } else { this . receiver . generateCode ( currentScope , codeStream , true ) ; if ( ( this . bits & NeedReceiverGenericCast ) != <NUM_LIT:0> ) { codeStream . checkcast ( this . actualReceiverType ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; generateArguments ( this . binding , this . arguments , currentScope , codeStream ) ; pc = codeStream . position ; if ( this . syntheticAccessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) ) ; if ( isStatic ) { codeStream . invoke ( Opcodes . OPC_invokestatic , codegenBinding , constantPoolDeclaringClass ) ; } else if ( ( this . receiver . isSuper ( ) ) || codegenBinding . isPrivate ( ) ) { codeStream . invoke ( Opcodes . OPC_invokespecial , codegenBinding , constantPoolDeclaringClass ) ; } else if ( constantPoolDeclaringClass . isInterface ( ) ) { codeStream . invoke ( Opcodes . OPC_invokeinterface , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokevirtual , codegenBinding , constantPoolDeclaringClass ) ; } } else { codeStream . invoke ( Opcodes . OPC_invokestatic , this . syntheticAccessor , null ) ; } if ( this . valueCast != null ) codeStream . checkcast ( this . valueCast ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { boolean isUnboxing = ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ; if ( isUnboxing ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( isUnboxing ? postConversionType ( currentScope ) . id : codegenBinding . returnType . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; case T_void : break ; default : codeStream . pop ( ) ; } } codeStream . recordPositionsFrom ( pc , ( int ) ( this . nameSourcePosition > > > <NUM_LIT:32> ) ) ; } public TypeBinding [ ] genericTypeArguments ( ) { return this . genericTypeArguments ; } public boolean isSuperAccess ( ) { return this . receiver . isSuper ( ) ; } public boolean isTypeAccess ( ) { return this . receiver != null && this . receiver . isTypeReference ( ) ; } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; MethodBinding codegenBinding = this . binding . original ( ) ; if ( this . binding . isPrivate ( ) ) { if ( currentScope . enclosingSourceType ( ) != codegenBinding . declaringClass ) { this . syntheticAccessor = ( ( SourceTypeBinding ) codegenBinding . declaringClass ) . addSyntheticMethod ( codegenBinding , false ) ; currentScope . problemReporter ( ) . needToEmulateMethodAccess ( codegenBinding , this ) ; return ; } } else if ( this . receiver instanceof QualifiedSuperReference ) { SourceTypeBinding destinationType = ( SourceTypeBinding ) ( ( ( QualifiedSuperReference ) this . receiver ) . currentCompatibleType ) ; this . syntheticAccessor = destinationType . addSyntheticMethod ( codegenBinding , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateMethodAccess ( codegenBinding , this ) ; return ; } else if ( this . binding . isProtected ( ) ) { SourceTypeBinding enclosingSourceType ; if ( ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) && codegenBinding . declaringClass . getPackage ( ) != ( enclosingSourceType = currentScope . enclosingSourceType ( ) ) . getPackage ( ) ) { SourceTypeBinding currentCompatibleType = ( SourceTypeBinding ) enclosingSourceType . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; this . syntheticAccessor = currentCompatibleType . addSyntheticMethod ( codegenBinding , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateMethodAccess ( codegenBinding , this ) ; return ; } } } public int nullStatus ( FlowInfo flowInfo ) { if ( this . binding . isValidBinding ( ) ) { long tagBits = this . binding . tagBits ; if ( ( tagBits & TagBits . AnnotationNonNull ) != <NUM_LIT:0> ) return FlowInfo . NON_NULL ; if ( ( tagBits & TagBits . AnnotationNullable ) != <NUM_LIT:0> ) return FlowInfo . POTENTIALLY_NULL | FlowInfo . POTENTIALLY_NON_NULL ; } return FlowInfo . UNKNOWN ; } public TypeBinding postConversionType ( Scope scope ) { TypeBinding convertedType = this . resolvedType ; if ( this . valueCast != null ) convertedType = this . valueCast ; int runtimeType = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case T_boolean : convertedType = TypeBinding . BOOLEAN ; break ; case T_byte : convertedType = TypeBinding . BYTE ; break ; case T_short : convertedType = TypeBinding . SHORT ; break ; case T_char : convertedType = TypeBinding . CHAR ; break ; case T_int : convertedType = TypeBinding . INT ; break ; case T_float : convertedType = TypeBinding . FLOAT ; break ; case T_long : convertedType = TypeBinding . LONG ; break ; case T_double : convertedType = TypeBinding . DOUBLE ; break ; default : } if ( ( this . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { convertedType = scope . environment ( ) . computeBoxingType ( convertedType ) ; } return convertedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { if ( ! this . receiver . isImplicitThis ( ) ) this . receiver . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:.>' ) ; if ( this . typeArguments != null ) { output . append ( '<CHAR_LIT>' ) ; int max = this . typeArguments . length - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < max ; j ++ ) { this . typeArguments [ j ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } this . typeArguments [ max ] . print ( <NUM_LIT:0> , output ) ; output . append ( '<CHAR_LIT:>>' ) ; } output . append ( this . selector ) . append ( '<CHAR_LIT:(>' ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> ; i < this . arguments . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . arguments [ i ] . printExpression ( <NUM_LIT:0> , output ) ; } } return output . append ( '<CHAR_LIT:)>' ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; boolean receiverCast = false , argsContainCast = false ; if ( this . receiver instanceof CastExpression ) { this . receiver . bits |= ASTNode . DisableUnnecessaryCastCheck ; receiverCast = true ; } this . actualReceiverType = this . receiver . resolveType ( scope ) ; boolean receiverIsType = this . receiver instanceof NameReference && ( ( ( NameReference ) this . receiver ) . bits & Binding . TYPE ) != <NUM_LIT:0> ; if ( receiverCast && this . actualReceiverType != null ) { if ( ( ( CastExpression ) this . receiver ) . expression . resolvedType == this . actualReceiverType ) { scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) this . receiver ) ; } } if ( this . typeArguments != null ) { int length = this . typeArguments . length ; boolean argHasError = scope . compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ; this . genericTypeArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference typeReference = this . typeArguments [ i ] ; if ( ( this . genericTypeArguments [ i ] = typeReference . resolveType ( scope , true ) ) == null ) { argHasError = true ; } if ( argHasError && typeReference instanceof Wildcard ) { scope . problemReporter ( ) . illegalUsageOfWildcard ( typeReference ) ; } } if ( argHasError ) { if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { this . arguments [ i ] . resolveType ( scope ) ; } } return null ; } } TypeBinding [ ] argumentTypes = Binding . NO_PARAMETERS ; if ( this . arguments != null ) { boolean argHasError = false ; int length = this . arguments . length ; argumentTypes = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = this . arguments [ i ] ; if ( argument instanceof CastExpression ) { argument . bits |= ASTNode . DisableUnnecessaryCastCheck ; argsContainCast = true ; } if ( ( argumentTypes [ i ] = argument . resolveType ( scope ) ) == null ) { argHasError = true ; } } if ( argHasError ) { if ( this . actualReceiverType instanceof ReferenceBinding ) { TypeBinding [ ] pseudoArgs = new TypeBinding [ length ] ; for ( int i = length ; -- i >= <NUM_LIT:0> ; ) pseudoArgs [ i ] = argumentTypes [ i ] == null ? TypeBinding . NULL : argumentTypes [ i ] ; this . binding = this . receiver . isImplicitThis ( ) ? scope . getImplicitMethod ( this . selector , pseudoArgs , this ) : scope . findMethod ( ( ReferenceBinding ) this . actualReceiverType , this . selector , pseudoArgs , this ) ; if ( this . binding != null && ! this . binding . isValidBinding ( ) ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) this . binding ) . closestMatch ; if ( closestMatch != null ) { if ( closestMatch . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) { closestMatch = scope . environment ( ) . createParameterizedGenericMethod ( closestMatch . original ( ) , ( RawTypeBinding ) null ) ; } this . binding = closestMatch ; MethodBinding closestMatchOriginal = closestMatch . original ( ) ; if ( closestMatchOriginal . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInMethod ( closestMatchOriginal ) ) { closestMatchOriginal . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } } } return null ; } } if ( this . actualReceiverType == null ) { return null ; } if ( this . actualReceiverType . isBaseType ( ) ) { scope . problemReporter ( ) . errorNoMethodFor ( this , this . actualReceiverType , argumentTypes ) ; return null ; } this . binding = this . receiver . isImplicitThis ( ) ? scope . getImplicitMethod ( this . selector , argumentTypes , this ) : scope . getMethod ( this . actualReceiverType , this . selector , argumentTypes , this ) ; if ( ! this . binding . isValidBinding ( ) ) { if ( this . binding . declaringClass == null ) { if ( this . actualReceiverType instanceof ReferenceBinding ) { this . binding . declaringClass = ( ReferenceBinding ) this . actualReceiverType ; } else { scope . problemReporter ( ) . errorNoMethodFor ( this , this . actualReceiverType , argumentTypes ) ; return null ; } } ReferenceBinding declaringClass = this . binding . declaringClass ; boolean avoidSecondary = declaringClass != null && declaringClass . isAnonymousType ( ) && declaringClass . superclass ( ) instanceof MissingTypeBinding ; if ( ! avoidSecondary ) scope . problemReporter ( ) . invalidMethod ( this , this . binding ) ; MethodBinding closestMatch = ( ( ProblemMethodBinding ) this . binding ) . closestMatch ; switch ( this . binding . problemId ( ) ) { case ProblemReasons . Ambiguous : break ; case ProblemReasons . NotVisible : case ProblemReasons . NonStaticReferenceInConstructorInvocation : case ProblemReasons . NonStaticReferenceInStaticContext : case ProblemReasons . ReceiverTypeNotVisible : case ProblemReasons . ParameterBoundMismatch : if ( closestMatch != null ) this . resolvedType = closestMatch . returnType ; break ; } if ( closestMatch != null ) { this . binding = closestMatch ; MethodBinding closestMatchOriginal = closestMatch . original ( ) ; if ( closestMatchOriginal . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInMethod ( closestMatchOriginal ) ) { closestMatchOriginal . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } return ( this . resolvedType != null && ( this . resolvedType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ) ? this . resolvedType : null ; } final CompilerOptions compilerOptions = scope . compilerOptions ( ) ; if ( compilerOptions . complianceLevel <= ClassFileConstants . JDK1_6 && this . binding . isPolymorphic ( ) ) { scope . problemReporter ( ) . polymorphicMethodNotBelow17 ( this ) ; return null ; } if ( ( ( this . bits & ASTNode . InsideExpressionStatement ) != <NUM_LIT:0> ) && this . binding . isPolymorphic ( ) ) { this . binding = scope . environment ( ) . updatePolymorphicMethodReturnType ( ( PolymorphicMethodBinding ) this . binding , TypeBinding . VOID ) ; } if ( ( this . binding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . missingTypeInMethod ( this , this . binding ) ; } if ( ! this . binding . isStatic ( ) ) { if ( receiverIsType ) { scope . problemReporter ( ) . mustUseAStaticMethod ( this , this . binding ) ; if ( this . actualReceiverType . isRawType ( ) && ( this . receiver . bits & ASTNode . IgnoreRawTypeCheck ) == <NUM_LIT:0> && compilerOptions . getSeverity ( CompilerOptions . RawTypeReference ) != ProblemSeverities . Ignore ) { scope . problemReporter ( ) . rawTypeReference ( this . receiver , this . actualReceiverType ) ; } } else { TypeBinding oldReceiverType = this . actualReceiverType ; this . actualReceiverType = this . actualReceiverType . getErasureCompatibleType ( this . binding . declaringClass ) ; this . receiver . computeConversion ( scope , this . actualReceiverType , this . actualReceiverType ) ; if ( this . actualReceiverType != oldReceiverType && this . receiver . postConversionType ( scope ) != this . actualReceiverType ) { this . bits |= NeedReceiverGenericCast ; } } } else { if ( ! ( this . receiver . isImplicitThis ( ) || this . receiver . isSuper ( ) || receiverIsType ) ) { scope . problemReporter ( ) . nonStaticAccessToStaticMethod ( this , this . binding ) ; } if ( ! this . receiver . isImplicitThis ( ) && this . binding . declaringClass != this . actualReceiverType ) { scope . problemReporter ( ) . indirectAccessToStaticMethod ( this , this . binding ) ; } } if ( checkInvocationArguments ( scope , this . receiver , this . actualReceiverType , this . binding , this . arguments , argumentTypes , argsContainCast , this ) ) { this . bits |= ASTNode . Unchecked ; } if ( this . binding . isAbstract ( ) ) { if ( this . receiver . isSuper ( ) ) { scope . problemReporter ( ) . cannotDireclyInvokeAbstractMethod ( this , this . binding ) ; } } if ( isMethodUseDeprecated ( this . binding , scope , true ) ) scope . problemReporter ( ) . deprecatedMethod ( this . binding , this ) ; if ( this . binding == scope . environment ( ) . arrayClone && compilerOptions . sourceLevel >= ClassFileConstants . JDK1_5 ) { this . resolvedType = this . actualReceiverType ; } else { TypeBinding returnType ; if ( ( this . bits & ASTNode . Unchecked ) != <NUM_LIT:0> && this . genericTypeArguments == null ) { returnType = this . binding . returnType ; if ( returnType != null ) { returnType = scope . environment ( ) . convertToRawType ( returnType . erasure ( ) , true ) ; } } else { returnType = this . binding . returnType ; if ( returnType != null ) { returnType = returnType . capture ( scope , this . sourceEnd ) ; } } this . resolvedType = returnType ; } if ( this . receiver . isSuper ( ) && compilerOptions . getSeverity ( CompilerOptions . OverridingMethodWithoutSuperInvocation ) != ProblemSeverities . Ignore ) { final ReferenceContext referenceContext = scope . methodScope ( ) . referenceContext ; if ( referenceContext instanceof AbstractMethodDeclaration ) { final AbstractMethodDeclaration abstractMethodDeclaration = ( AbstractMethodDeclaration ) referenceContext ; MethodBinding enclosingMethodBinding = abstractMethodDeclaration . binding ; if ( enclosingMethodBinding . isOverriding ( ) && CharOperation . equals ( this . binding . selector , enclosingMethodBinding . selector ) && this . binding . areParametersEqual ( enclosingMethodBinding ) ) { abstractMethodDeclaration . bits |= ASTNode . OverridingMethodWithSupercall ; } } } if ( this . typeArguments != null && this . binding . original ( ) . typeVariables == Binding . NO_TYPE_VARIABLES ) { scope . problemReporter ( ) . unnecessaryTypeArgumentsForMethodInvocation ( this . binding , this . genericTypeArguments , this . typeArguments ) ; } return ( this . resolvedType . tagBits & TagBits . HasMissingType ) == <NUM_LIT:0> ? this . resolvedType : null ; } public void setActualReceiverType ( ReferenceBinding receiverType ) { if ( receiverType == null ) return ; this . actualReceiverType = receiverType ; } public void setDepth ( int depth ) { this . bits &= ~ ASTNode . DepthMASK ; if ( depth > <NUM_LIT:0> ) { this . bits |= ( depth & <NUM_LIT> ) << ASTNode . DepthSHIFT ; } } public void setExpectedType ( TypeBinding expectedType ) { this . expectedType = expectedType ; } public void setFieldIndex ( int depth ) { } public TypeBinding expectedType ( ) { return this . expectedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . receiver . traverse ( visitor , blockScope ) ; if ( this . typeArguments != null ) { for ( int i = <NUM_LIT:0> , typeArgumentsLength = this . typeArguments . length ; i < typeArgumentsLength ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , blockScope ) ; } } if ( this . arguments != null ) { int argumentsLength = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , blockScope ) ; } } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . flow . ExceptionHandlingFlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . MemberTypeBinding ; 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 . TypeVariableBinding ; import org . eclipse . jdt . internal . compiler . parser . Parser ; import org . eclipse . jdt . internal . compiler . problem . AbortMethod ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class MethodDeclaration extends AbstractMethodDeclaration { public TypeReference returnType ; public TypeParameter [ ] typeParameters ; public MethodDeclaration ( CompilationResult compilationResult ) { super ( compilationResult ) ; } public void analyseCode ( ClassScope classScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . ignoreFurtherInvestigation ) return ; try { if ( this . binding == null ) return ; if ( ! this . binding . isUsed ( ) && ! this . binding . isAbstract ( ) ) { if ( this . binding . isPrivate ( ) || ( ( ( this . binding . modifiers & ( ExtraCompilerModifiers . AccOverriding | ExtraCompilerModifiers . AccImplementing ) ) == <NUM_LIT:0> ) && this . binding . isOrEnclosedByPrivateType ( ) ) ) { if ( ! classScope . referenceCompilationUnit ( ) . compilationResult . hasSyntaxError ) { this . scope . problemReporter ( ) . unusedPrivateMethod ( this ) ; } } } if ( this . binding . declaringClass . isEnum ( ) && ( this . selector == TypeConstants . VALUES || this . selector == TypeConstants . VALUEOF ) ) return ; if ( this . binding . isAbstract ( ) || this . binding . isNative ( ) ) return ; ExceptionHandlingFlowContext methodContext = new ExceptionHandlingFlowContext ( flowContext , this , this . binding . thrownExceptions , null , this . scope , FlowInfo . DEAD_END ) ; analyseArguments ( flowInfo ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , count = this . arguments . length ; i < count ; i ++ ) { if ( this . arguments [ i ] . binding != null && ( this . arguments [ i ] . binding . type instanceof TypeVariableBinding ) ) { Binding declaringElement = ( ( TypeVariableBinding ) this . arguments [ i ] . binding . type ) . declaringElement ; if ( this . binding != null && this . binding . declaringClass == declaringElement ) this . bits &= ~ ASTNode . CanBeStatic ; } } } if ( this . binding . declaringClass instanceof MemberTypeBinding && ! this . binding . declaringClass . isStatic ( ) ) { this . bits &= ~ ASTNode . CanBeStatic ; } if ( this . statements != null ) { int complaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ? Statement . NOT_COMPLAINED : Statement . COMPLAINED_FAKE_REACHABLE ; for ( int i = <NUM_LIT:0> , count = this . statements . length ; i < count ; i ++ ) { Statement stat = this . statements [ i ] ; if ( ( complaintLevel = stat . complainIfUnreachable ( flowInfo , this . scope , complaintLevel , true ) ) < Statement . COMPLAINED_UNREACHABLE ) { flowInfo = stat . analyseCode ( this . scope , methodContext , flowInfo ) ; } } } else { this . bits &= ~ ASTNode . CanBeStatic ; } TypeBinding returnTypeBinding = this . binding . returnType ; if ( ( returnTypeBinding == TypeBinding . VOID ) || isAbstract ( ) ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { this . bits |= ASTNode . NeedFreeReturn ; } } else { if ( flowInfo != FlowInfo . DEAD_END ) { this . scope . problemReporter ( ) . shouldReturn ( returnTypeBinding , this ) ; } } methodContext . complainIfUnusedExceptionHandlers ( this ) ; this . scope . checkUnusedParameters ( this . binding ) ; if ( ! this . binding . isStatic ( ) && ( this . bits & ASTNode . CanBeStatic ) != <NUM_LIT:0> ) { if ( ! this . binding . isOverriding ( ) && ! this . binding . isImplementing ( ) ) { if ( this . binding . isPrivate ( ) || this . binding . isFinal ( ) || this . binding . declaringClass . isFinal ( ) ) { this . scope . problemReporter ( ) . methodCanBeDeclaredStatic ( this ) ; } else { this . scope . problemReporter ( ) . methodCanBePotentiallyDeclaredStatic ( this ) ; } } } this . scope . checkUnclosedCloseables ( flowInfo , null , null , null ) ; } catch ( AbortMethod e ) { this . ignoreFurtherInvestigation = true ; } } public boolean isMethod ( ) { return true ; } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { parser . parse ( this , unit ) ; } public StringBuffer printReturnType ( int indent , StringBuffer output ) { if ( this . returnType == null ) return output ; return this . returnType . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:U+0020>' ) ; } public void resolveStatements ( ) { if ( this . returnType != null && this . binding != null ) { this . returnType . resolvedType = this . binding . returnType ; } if ( CharOperation . equals ( this . scope . enclosingSourceType ( ) . sourceName , this . selector ) ) { this . scope . problemReporter ( ) . methodWithConstructorName ( this ) ; } boolean returnsUndeclTypeVar = false ; if ( this . returnType != null && this . returnType . resolvedType instanceof TypeVariableBinding ) { returnsUndeclTypeVar = true ; } if ( this . typeParameters != null ) { for ( int i = <NUM_LIT:0> , length = this . typeParameters . length ; i < length ; i ++ ) { this . typeParameters [ i ] . resolve ( this . scope ) ; if ( returnsUndeclTypeVar && this . typeParameters [ i ] . binding == this . returnType . resolvedType ) { returnsUndeclTypeVar = false ; } } } final CompilerOptions compilerOptions = this . scope . compilerOptions ( ) ; checkOverride : { if ( this . binding == null ) break checkOverride ; long complianceLevel = compilerOptions . complianceLevel ; if ( complianceLevel < ClassFileConstants . JDK1_5 ) break checkOverride ; int bindingModifiers = this . binding . modifiers ; boolean hasOverrideAnnotation = ( this . binding . tagBits & TagBits . AnnotationOverride ) != <NUM_LIT:0> ; boolean hasUnresolvedArguments = ( this . binding . tagBits & TagBits . HasUnresolvedArguments ) != <NUM_LIT:0> ; if ( hasOverrideAnnotation && ! hasUnresolvedArguments ) { if ( ( bindingModifiers & ( ClassFileConstants . AccStatic | ExtraCompilerModifiers . AccOverriding ) ) == ExtraCompilerModifiers . AccOverriding ) break checkOverride ; if ( complianceLevel >= ClassFileConstants . JDK1_6 && ( ( bindingModifiers & ( ClassFileConstants . AccStatic | ExtraCompilerModifiers . AccImplementing ) ) == ExtraCompilerModifiers . AccImplementing ) ) break checkOverride ; this . scope . problemReporter ( ) . methodMustOverride ( this , complianceLevel ) ; } else { if ( ! this . binding . declaringClass . isInterface ( ) ) { if ( ( bindingModifiers & ( ClassFileConstants . AccStatic | ExtraCompilerModifiers . AccOverriding ) ) == ExtraCompilerModifiers . AccOverriding ) { this . scope . problemReporter ( ) . missingOverrideAnnotation ( this ) ; } else { if ( complianceLevel >= ClassFileConstants . JDK1_6 && compilerOptions . reportMissingOverrideAnnotationForInterfaceMethodImplementation && this . binding . isImplementing ( ) ) { this . scope . problemReporter ( ) . missingOverrideAnnotationForInterfaceMethodImplementation ( this ) ; } } } else { if ( complianceLevel >= ClassFileConstants . JDK1_6 && compilerOptions . reportMissingOverrideAnnotationForInterfaceMethodImplementation && ( ( ( bindingModifiers & ( ClassFileConstants . AccStatic | ExtraCompilerModifiers . AccOverriding ) ) == ExtraCompilerModifiers . AccOverriding ) || this . binding . isImplementing ( ) ) ) { this . scope . problemReporter ( ) . missingOverrideAnnotationForInterfaceMethodImplementation ( this ) ; } } } } switch ( TypeDeclaration . kind ( this . scope . referenceType ( ) . modifiers ) ) { case TypeDeclaration . ENUM_DECL : if ( this . selector == TypeConstants . VALUES ) break ; if ( this . selector == TypeConstants . VALUEOF ) break ; case TypeDeclaration . CLASS_DECL : if ( ( this . modifiers & ExtraCompilerModifiers . AccSemicolonBody ) != <NUM_LIT:0> ) { if ( ( this . modifiers & ClassFileConstants . AccNative ) == <NUM_LIT:0> ) if ( ( this . modifiers & ClassFileConstants . AccAbstract ) == <NUM_LIT:0> ) this . scope . problemReporter ( ) . methodNeedBody ( this ) ; } else { if ( ( ( this . modifiers & ClassFileConstants . AccNative ) != <NUM_LIT:0> ) || ( ( this . modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ) ) this . scope . problemReporter ( ) . methodNeedingNoBody ( this ) ; else if ( this . binding != null && ! this . binding . isStatic ( ) && ! ( this . binding . declaringClass instanceof LocalTypeBinding ) && ! returnsUndeclTypeVar ) { this . bits |= ASTNode . CanBeStatic ; } } } super . resolveStatements ( ) ; if ( compilerOptions . getSeverity ( CompilerOptions . OverridingMethodWithoutSuperInvocation ) != ProblemSeverities . Ignore ) { if ( this . binding != null ) { int bindingModifiers = this . binding . modifiers ; if ( ( bindingModifiers & ( ExtraCompilerModifiers . AccOverriding | ExtraCompilerModifiers . AccImplementing ) ) == ExtraCompilerModifiers . AccOverriding && ( this . bits & ASTNode . OverridingMethodWithSupercall ) == <NUM_LIT:0> ) { this . scope . problemReporter ( ) . overridesMethodWithoutSuperInvocation ( this . binding ) ; } } } } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { if ( visitor . visit ( this , classScope ) ) { if ( this . javadoc != null ) { this . javadoc . traverse ( visitor , this . scope ) ; } if ( this . annotations != null ) { int annotationsLength = this . annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) this . annotations [ i ] . traverse ( visitor , this . scope ) ; } if ( this . typeParameters != null ) { int typeParametersLength = this . typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < typeParametersLength ; i ++ ) { this . typeParameters [ i ] . traverse ( visitor , this . scope ) ; } } if ( this . returnType != null ) this . returnType . traverse ( visitor , this . scope ) ; if ( this . arguments != null ) { int argumentLength = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , this . scope ) ; } if ( this . thrownExceptions != null ) { int thrownExceptionsLength = this . thrownExceptions . length ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionsLength ; i ++ ) this . thrownExceptions [ i ] . traverse ( visitor , this . scope ) ; } if ( this . statements != null ) { int statementsLength = this . statements . length ; for ( int i = <NUM_LIT:0> ; i < statementsLength ; i ++ ) this . statements [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , classScope ) ; } public TypeParameter [ ] typeParameters ( ) { return this . typeParameters ; } void validateNullAnnotations ( ) { super . validateNullAnnotations ( ) ; if ( this . binding != null ) this . scope . validateNullAnnotation ( this . binding . tagBits , this . returnType , this . annotations ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocFieldReference extends FieldReference { public int tagSourceStart , tagSourceEnd ; public int tagValue ; public MethodBinding methodBinding ; public JavadocFieldReference ( char [ ] source , long pos ) { super ( source , pos ) ; this . bits |= InsideJavadoc ; } protected TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( this . receiver == null ) { this . actualReceiverType = scope . enclosingReceiverType ( ) ; } else if ( scope . kind == Scope . CLASS_SCOPE ) { this . actualReceiverType = this . receiver . resolveType ( ( ClassScope ) scope ) ; } else { this . actualReceiverType = this . receiver . resolveType ( ( BlockScope ) scope ) ; } if ( this . actualReceiverType == null ) { return null ; } Binding fieldBinding = ( this . receiver != null && this . receiver . isThis ( ) ) ? scope . classScope ( ) . getBinding ( this . token , this . bits & RestrictiveFlagMASK , this , true ) : scope . getField ( this . actualReceiverType , this . token , this ) ; if ( ! fieldBinding . isValidBinding ( ) ) { switch ( fieldBinding . problemId ( ) ) { case ProblemReasons . NonStaticReferenceInConstructorInvocation : case ProblemReasons . NonStaticReferenceInStaticContext : case ProblemReasons . InheritedNameHidesEnclosingName : FieldBinding closestMatch = ( ( ProblemFieldBinding ) fieldBinding ) . closestMatch ; if ( closestMatch != null ) { fieldBinding = closestMatch ; } } } if ( ! fieldBinding . isValidBinding ( ) || ! ( fieldBinding instanceof FieldBinding ) ) { if ( this . receiver . resolvedType instanceof ProblemReferenceBinding ) { return null ; } if ( this . actualReceiverType instanceof ReferenceBinding ) { ReferenceBinding refBinding = ( ReferenceBinding ) this . actualReceiverType ; char [ ] selector = this . token ; MethodBinding possibleMethod = null ; if ( CharOperation . equals ( this . actualReceiverType . sourceName ( ) , selector ) ) { possibleMethod = scope . getConstructor ( refBinding , Binding . NO_TYPES , this ) ; } else { possibleMethod = this . receiver . isThis ( ) ? scope . getImplicitMethod ( selector , Binding . NO_TYPES , this ) : scope . getMethod ( refBinding , selector , Binding . NO_TYPES , this ) ; } if ( possibleMethod . isValidBinding ( ) ) { this . methodBinding = possibleMethod ; } else { ProblemMethodBinding problemMethodBinding = ( ProblemMethodBinding ) possibleMethod ; if ( problemMethodBinding . closestMatch == null ) { if ( fieldBinding . isValidBinding ( ) ) { fieldBinding = new ProblemFieldBinding ( refBinding , fieldBinding . readableName ( ) , ProblemReasons . NotFound ) ; } scope . problemReporter ( ) . javadocInvalidField ( this , fieldBinding , this . actualReceiverType , scope . getDeclarationModifiers ( ) ) ; } else { this . methodBinding = problemMethodBinding . closestMatch ; } } } return null ; } this . binding = ( FieldBinding ) fieldBinding ; if ( isFieldUseDeprecated ( this . binding , scope , this . bits ) ) { scope . problemReporter ( ) . javadocDeprecatedField ( this . binding , this , scope . getDeclarationModifiers ( ) ) ; } return this . resolvedType = this . binding . type ; } public boolean isSuperAccess ( ) { return ( this . bits & ASTNode . SuperAccess ) != <NUM_LIT:0> ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { if ( this . receiver != null ) { this . receiver . printExpression ( <NUM_LIT:0> , output ) ; } output . append ( '<CHAR_LIT>' ) . append ( this . token ) ; return output ; } public TypeBinding resolveType ( BlockScope scope ) { return internalResolveType ( scope ) ; } public TypeBinding resolveType ( ClassScope scope ) { return internalResolveType ( scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . receiver != null ) { this . receiver . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . receiver != null ) { this . receiver . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocArgumentExpression extends Expression { public char [ ] token ; public Argument argument ; public JavadocArgumentExpression ( char [ ] name , int startPos , int endPos , TypeReference typeRef ) { this . token = name ; this . sourceStart = startPos ; this . sourceEnd = endPos ; long pos = ( ( ( long ) startPos ) << <NUM_LIT:32> ) + endPos ; this . argument = new Argument ( name , pos , typeRef , ClassFileConstants . AccDefault ) ; this . bits |= InsideJavadoc ; } private TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( this . resolvedType != null ) return this . resolvedType . isValidBinding ( ) ? this . resolvedType : null ; if ( this . argument != null ) { TypeReference typeRef = this . argument . type ; if ( typeRef != null ) { this . resolvedType = typeRef . getTypeBinding ( scope ) ; typeRef . resolvedType = this . resolvedType ; if ( this . resolvedType == null ) { return null ; } if ( typeRef instanceof SingleTypeReference && this . resolvedType . leafComponentType ( ) . enclosingType ( ) != null && scope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_4 ) { scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( this . sourceStart , this . sourceEnd , scope . getDeclarationModifiers ( ) ) ; } else if ( typeRef instanceof QualifiedTypeReference ) { TypeBinding enclosingType = this . resolvedType . leafComponentType ( ) . enclosingType ( ) ; if ( enclosingType != null ) { int compoundLength = <NUM_LIT:2> ; while ( ( enclosingType = enclosingType . enclosingType ( ) ) != null ) compoundLength ++ ; int typeNameLength = typeRef . getTypeName ( ) . length ; if ( typeNameLength != compoundLength && typeNameLength != ( compoundLength + this . resolvedType . getPackage ( ) . compoundName . length ) ) { scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( typeRef . sourceStart , typeRef . sourceEnd , scope . getDeclarationModifiers ( ) ) ; } } } if ( ! this . resolvedType . isValidBinding ( ) ) { scope . problemReporter ( ) . javadocInvalidType ( typeRef , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) { scope . problemReporter ( ) . javadocDeprecatedType ( this . resolvedType , typeRef , scope . getDeclarationModifiers ( ) ) ; } return this . resolvedType = scope . environment ( ) . convertToRawType ( this . resolvedType , true ) ; } } return null ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { if ( this . argument == null ) { if ( this . token != null ) { output . append ( this . token ) ; } } else { this . argument . print ( indent , output ) ; } return output ; } public void resolve ( BlockScope scope ) { if ( this . argument != null ) { this . argument . resolve ( scope ) ; } } public TypeBinding resolveType ( BlockScope scope ) { return internalResolveType ( scope ) ; } public TypeBinding resolveType ( ClassScope scope ) { return internalResolveType ( scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . argument != null ) { this . argument . traverse ( visitor , blockScope ) ; } } visitor . endVisit ( this , blockScope ) ; } public void traverse ( ASTVisitor visitor , ClassScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . argument != null ) { this . argument . traverse ( visitor , blockScope ) ; } } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . MissingTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemFieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; 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 . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . VariableBinding ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class QualifiedNameReference extends NameReference { public char [ ] [ ] tokens ; public long [ ] sourcePositions ; public FieldBinding [ ] otherBindings ; int [ ] otherDepths ; public int indexOfFirstFieldBinding ; public SyntheticMethodBinding syntheticWriteAccessor ; public SyntheticMethodBinding [ ] syntheticReadAccessors ; public TypeBinding genericCast ; public TypeBinding [ ] otherGenericCasts ; public QualifiedNameReference ( char [ ] [ ] tokens , long [ ] positions , int sourceStart , int sourceEnd ) { this . tokens = tokens ; this . sourcePositions = positions ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { int otherBindingsCount = this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ; boolean needValue = otherBindingsCount == <NUM_LIT:0> || ! this . otherBindings [ <NUM_LIT:0> ] . isStatic ( ) ; boolean complyTo14 = currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ; FieldBinding lastFieldBinding = null ; switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : lastFieldBinding = ( FieldBinding ) this . binding ; if ( needValue || complyTo14 ) { manageSyntheticAccessIfNecessary ( currentScope , lastFieldBinding , <NUM_LIT:0> , flowInfo ) ; } if ( lastFieldBinding . isBlankFinal ( ) && this . otherBindings != null && currentScope . needBlankFinalFieldInitializationCheck ( lastFieldBinding ) ) { FlowInfo fieldInits = flowContext . getInitsForFinalBlankInitializationCheck ( lastFieldBinding . declaringClass . original ( ) , flowInfo ) ; if ( ! fieldInits . isDefinitelyAssigned ( lastFieldBinding ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( lastFieldBinding , this ) ; } } if ( ! lastFieldBinding . isStatic ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( lastFieldBinding . declaringClass ) ; } break ; case Binding . LOCAL : LocalVariableBinding localBinding ; if ( ! flowInfo . isDefinitelyAssigned ( localBinding = ( LocalVariableBinding ) this . binding ) ) { currentScope . problemReporter ( ) . uninitializedLocalVariable ( localBinding , this ) ; } if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { localBinding . useFlag = LocalVariableBinding . USED ; } else if ( localBinding . useFlag == LocalVariableBinding . UNUSED ) { localBinding . useFlag = LocalVariableBinding . FAKE_USED ; } if ( needValue ) { checkNPE ( currentScope , flowContext , flowInfo , true ) ; } } if ( needValue ) { manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; } if ( this . otherBindings != null ) { for ( int i = <NUM_LIT:0> ; i < otherBindingsCount - <NUM_LIT:1> ; i ++ ) { lastFieldBinding = this . otherBindings [ i ] ; needValue = ! this . otherBindings [ i + <NUM_LIT:1> ] . isStatic ( ) ; if ( needValue || complyTo14 ) { manageSyntheticAccessIfNecessary ( currentScope , lastFieldBinding , i + <NUM_LIT:1> , flowInfo ) ; } } lastFieldBinding = this . otherBindings [ otherBindingsCount - <NUM_LIT:1> ] ; } if ( isCompound ) { if ( otherBindingsCount == <NUM_LIT:0> && lastFieldBinding . isBlankFinal ( ) && currentScope . needBlankFinalFieldInitializationCheck ( lastFieldBinding ) ) { FlowInfo fieldInits = flowContext . getInitsForFinalBlankInitializationCheck ( lastFieldBinding . declaringClass , flowInfo ) ; if ( ! fieldInits . isDefinitelyAssigned ( lastFieldBinding ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( lastFieldBinding , this ) ; } } manageSyntheticAccessIfNecessary ( currentScope , lastFieldBinding , otherBindingsCount , flowInfo ) ; } if ( assignment . expression != null ) { flowInfo = assignment . expression . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } if ( lastFieldBinding . isFinal ( ) ) { if ( otherBindingsCount == <NUM_LIT:0> && this . indexOfFirstFieldBinding == <NUM_LIT:1> && lastFieldBinding . isBlankFinal ( ) && ! isCompound && currentScope . allowBlankFinalFieldAssignment ( lastFieldBinding ) ) { if ( flowInfo . isPotentiallyAssigned ( lastFieldBinding ) ) { currentScope . problemReporter ( ) . duplicateInitializationOfBlankFinalField ( lastFieldBinding , this ) ; } else { flowContext . recordSettingFinal ( lastFieldBinding , this , flowInfo ) ; } flowInfo . markAsDefinitelyAssigned ( lastFieldBinding ) ; } else { currentScope . problemReporter ( ) . cannotAssignToFinalField ( lastFieldBinding , this ) ; if ( otherBindingsCount == <NUM_LIT:0> && currentScope . allowBlankFinalFieldAssignment ( lastFieldBinding ) ) { flowInfo . markAsDefinitelyAssigned ( lastFieldBinding ) ; } } } manageSyntheticAccessIfNecessary ( currentScope , lastFieldBinding , - <NUM_LIT:1> , flowInfo ) ; return flowInfo ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return analyseCode ( currentScope , flowContext , flowInfo , true ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { int otherBindingsCount = this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ; boolean needValue = otherBindingsCount == <NUM_LIT:0> ? valueRequired : ! this . otherBindings [ <NUM_LIT:0> ] . isStatic ( ) ; boolean complyTo14 = currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ; switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : if ( needValue || complyTo14 ) { manageSyntheticAccessIfNecessary ( currentScope , ( FieldBinding ) this . binding , <NUM_LIT:0> , flowInfo ) ; } FieldBinding fieldBinding = ( FieldBinding ) this . binding ; if ( this . indexOfFirstFieldBinding == <NUM_LIT:1> ) { if ( fieldBinding . isBlankFinal ( ) && currentScope . needBlankFinalFieldInitializationCheck ( fieldBinding ) ) { FlowInfo fieldInits = flowContext . getInitsForFinalBlankInitializationCheck ( fieldBinding . declaringClass . original ( ) , flowInfo ) ; if ( ! fieldInits . isDefinitelyAssigned ( fieldBinding ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( fieldBinding , this ) ; } } } if ( ! fieldBinding . isStatic ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( fieldBinding . declaringClass ) ; } break ; case Binding . LOCAL : LocalVariableBinding localBinding ; if ( ! flowInfo . isDefinitelyAssigned ( localBinding = ( LocalVariableBinding ) this . binding ) ) { currentScope . problemReporter ( ) . uninitializedLocalVariable ( localBinding , this ) ; } if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { localBinding . useFlag = LocalVariableBinding . USED ; } else if ( localBinding . useFlag == LocalVariableBinding . UNUSED ) { localBinding . useFlag = LocalVariableBinding . FAKE_USED ; } if ( needValue ) { checkNPE ( currentScope , flowContext , flowInfo , true ) ; } } if ( needValue ) { manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; } if ( this . otherBindings != null ) { for ( int i = <NUM_LIT:0> ; i < otherBindingsCount ; i ++ ) { needValue = i < otherBindingsCount - <NUM_LIT:1> ? ! this . otherBindings [ i + <NUM_LIT:1> ] . isStatic ( ) : valueRequired ; if ( needValue || complyTo14 ) { manageSyntheticAccessIfNecessary ( currentScope , this . otherBindings [ i ] , i + <NUM_LIT:1> , flowInfo ) ; } } } return flowInfo ; } public void checkNPE ( BlockScope scope , FlowContext flowContext , FlowInfo flowInfo , boolean checkString ) { if ( ( this . bits & ASTNode . RestrictiveFlagMASK ) == Binding . LOCAL ) { LocalVariableBinding local = ( LocalVariableBinding ) this . binding ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> && ( checkString || local . type . id != TypeIds . T_JavaLangString ) ) { if ( ( this . bits & ASTNode . IsNonNull ) == <NUM_LIT:0> ) { flowContext . recordUsingNullReference ( scope , local , this , FlowContext . MAY_NULL , flowInfo ) ; } flowInfo . markAsComparedEqualToNonNull ( local ) ; if ( flowContext . initsOnFinally != null ) { flowContext . initsOnFinally . markAsComparedEqualToNonNull ( local ) ; } } } } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { if ( runtimeTimeType == null || compileTimeType == null ) return ; FieldBinding field = null ; int length = this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ; if ( length == <NUM_LIT:0> ) { if ( ( this . bits & Binding . FIELD ) != <NUM_LIT:0> && this . binding != null && this . binding . isValidBinding ( ) ) { field = ( FieldBinding ) this . binding ; } } else { field = this . otherBindings [ length - <NUM_LIT:1> ] ; } if ( field != null ) { FieldBinding originalBinding = field . original ( ) ; TypeBinding originalType = originalBinding . type ; if ( originalType . leafComponentType ( ) . isTypeVariable ( ) ) { TypeBinding targetType = ( ! compileTimeType . isBaseType ( ) && runtimeTimeType . isBaseType ( ) ) ? compileTimeType : runtimeTimeType ; TypeBinding typeCast = originalType . genericCast ( targetType ) ; setGenericCast ( length , typeCast ) ; if ( typeCast instanceof ReferenceBinding ) { ReferenceBinding referenceCast = ( ReferenceBinding ) typeCast ; if ( ! referenceCast . canBeSeenBy ( scope ) ) { scope . problemReporter ( ) . invalidType ( this , new ProblemReferenceBinding ( CharOperation . splitOn ( '<CHAR_LIT:.>' , referenceCast . shortReadableName ( ) ) , referenceCast , ProblemReasons . NotVisible ) ) ; } } } } super . computeConversion ( scope , runtimeTimeType , compileTimeType ) ; } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { int pc = codeStream . position ; FieldBinding lastFieldBinding = generateReadSequence ( currentScope , codeStream ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; assignment . expression . generateCode ( currentScope , codeStream , true ) ; fieldStore ( currentScope , codeStream , lastFieldBinding , this . syntheticWriteAccessor , getFinalReceiverType ( ) , false , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( assignment . implicitConversion ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } } else { FieldBinding lastFieldBinding = generateReadSequence ( currentScope , codeStream ) ; if ( lastFieldBinding != null ) { boolean isStatic = lastFieldBinding . isStatic ( ) ; Constant fieldConstant = lastFieldBinding . constant ( ) ; if ( fieldConstant != Constant . NotAConstant ) { if ( ! isStatic ) { codeStream . invokeObjectGetClass ( ) ; codeStream . pop ( ) ; } if ( valueRequired ) { codeStream . generateConstant ( fieldConstant , this . implicitConversion ) ; } } else { boolean isFirst = lastFieldBinding == this . binding && ( this . indexOfFirstFieldBinding == <NUM_LIT:1> || lastFieldBinding . declaringClass == currentScope . enclosingReceiverType ( ) ) && this . otherBindings == null ; TypeBinding requiredGenericCast = getGenericCast ( this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ) ; if ( valueRequired || ( ! isFirst && currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) || ( ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) || requiredGenericCast != null ) { int lastFieldPc = codeStream . position ; if ( lastFieldBinding . declaringClass == null ) { codeStream . arraylength ( ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { codeStream . pop ( ) ; } } else { SyntheticMethodBinding accessor = this . syntheticReadAccessors == null ? null : this . syntheticReadAccessors [ this . syntheticReadAccessors . length - <NUM_LIT:1> ] ; if ( accessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , lastFieldBinding , getFinalReceiverType ( ) , isFirst ) ; if ( isStatic ) { codeStream . fieldAccess ( Opcodes . OPC_getstatic , lastFieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . fieldAccess ( Opcodes . OPC_getfield , lastFieldBinding , constantPoolDeclaringClass ) ; } } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } if ( requiredGenericCast != null ) codeStream . checkcast ( requiredGenericCast ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { boolean isUnboxing = ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ; if ( isUnboxing ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( isUnboxing ? postConversionType ( currentScope ) . id : lastFieldBinding . type . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; break ; } } } int fieldPosition = ( int ) ( this . sourcePositions [ this . sourcePositions . length - <NUM_LIT:1> ] > > > <NUM_LIT:32> ) ; codeStream . recordPositionsFrom ( lastFieldPc , fieldPosition ) ; } else { if ( ! isStatic ) { codeStream . invokeObjectGetClass ( ) ; codeStream . pop ( ) ; } } } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { FieldBinding lastFieldBinding = generateReadSequence ( currentScope , codeStream ) ; reportOnlyUselesslyReadPrivateField ( currentScope , lastFieldBinding , valueRequired ) ; boolean isFirst = lastFieldBinding == this . binding && ( this . indexOfFirstFieldBinding == <NUM_LIT:1> || lastFieldBinding . declaringClass == currentScope . enclosingReceiverType ( ) ) && this . otherBindings == null ; TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , lastFieldBinding , getFinalReceiverType ( ) , isFirst ) ; SyntheticMethodBinding accessor = this . syntheticReadAccessors == null ? null : this . syntheticReadAccessors [ this . syntheticReadAccessors . length - <NUM_LIT:1> ] ; if ( lastFieldBinding . isStatic ( ) ) { if ( accessor == null ) { codeStream . fieldAccess ( Opcodes . OPC_getstatic , lastFieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } } else { codeStream . dup ( ) ; if ( accessor == null ) { codeStream . fieldAccess ( Opcodes . OPC_getfield , lastFieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } } int operationTypeID ; switch ( operationTypeID = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_JavaLangString : case T_JavaLangObject : case T_undefined : codeStream . generateStringConcatenationAppend ( currentScope , null , expression ) ; break ; default : TypeBinding requiredGenericCast = getGenericCast ( this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ) ; if ( requiredGenericCast != null ) codeStream . checkcast ( requiredGenericCast ) ; codeStream . generateImplicitConversion ( this . implicitConversion ) ; if ( expression == IntLiteral . One ) { codeStream . generateConstant ( expression . constant , this . implicitConversion ) ; } else { expression . generateCode ( currentScope , codeStream , true ) ; } codeStream . sendOperator ( operator , operationTypeID ) ; codeStream . generateImplicitConversion ( assignmentImplicitConversion ) ; } fieldStore ( currentScope , codeStream , lastFieldBinding , this . syntheticWriteAccessor , getFinalReceiverType ( ) , false , valueRequired ) ; } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { FieldBinding lastFieldBinding = generateReadSequence ( currentScope , codeStream ) ; reportOnlyUselesslyReadPrivateField ( currentScope , lastFieldBinding , valueRequired ) ; boolean isFirst = lastFieldBinding == this . binding && ( this . indexOfFirstFieldBinding == <NUM_LIT:1> || lastFieldBinding . declaringClass == currentScope . enclosingReceiverType ( ) ) && this . otherBindings == null ; TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , lastFieldBinding , getFinalReceiverType ( ) , isFirst ) ; SyntheticMethodBinding accessor = this . syntheticReadAccessors == null ? null : this . syntheticReadAccessors [ this . syntheticReadAccessors . length - <NUM_LIT:1> ] ; if ( lastFieldBinding . isStatic ( ) ) { if ( accessor == null ) { codeStream . fieldAccess ( Opcodes . OPC_getstatic , lastFieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , constantPoolDeclaringClass ) ; } } else { codeStream . dup ( ) ; if ( accessor == null ) { codeStream . fieldAccess ( Opcodes . OPC_getfield , lastFieldBinding , null ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } } TypeBinding requiredGenericCast = getGenericCast ( this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ) ; TypeBinding operandType ; if ( requiredGenericCast != null ) { codeStream . checkcast ( requiredGenericCast ) ; operandType = requiredGenericCast ; } else { operandType = lastFieldBinding . type ; } if ( valueRequired ) { if ( lastFieldBinding . isStatic ( ) ) { switch ( operandType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } } else { switch ( operandType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2_x1 ( ) ; break ; default : codeStream . dup_x1 ( ) ; break ; } } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateConstant ( postIncrement . expression . constant , this . implicitConversion ) ; codeStream . sendOperator ( postIncrement . operator , this . implicitConversion & TypeIds . COMPILE_TYPE_MASK ) ; codeStream . generateImplicitConversion ( postIncrement . preAssignImplicitConversion ) ; fieldStore ( currentScope , codeStream , lastFieldBinding , this . syntheticWriteAccessor , getFinalReceiverType ( ) , false , false ) ; } public FieldBinding generateReadSequence ( BlockScope currentScope , CodeStream codeStream ) { int otherBindingsCount = this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ; boolean needValue = otherBindingsCount == <NUM_LIT:0> || ! this . otherBindings [ <NUM_LIT:0> ] . isStatic ( ) ; FieldBinding lastFieldBinding ; TypeBinding lastGenericCast ; TypeBinding lastReceiverType ; boolean complyTo14 = currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ; switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : lastFieldBinding = ( ( FieldBinding ) this . binding ) . original ( ) ; lastGenericCast = this . genericCast ; lastReceiverType = this . actualReceiverType ; if ( lastFieldBinding . constant ( ) != Constant . NotAConstant ) { break ; } if ( ( needValue && ! lastFieldBinding . isStatic ( ) ) || lastGenericCast != null ) { int pc = codeStream . position ; if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ) ; Object [ ] emulationPath = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , targetType , currentScope ) ; } else { generateReceiver ( codeStream ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } break ; case Binding . LOCAL : lastFieldBinding = null ; lastGenericCast = null ; LocalVariableBinding localBinding = ( LocalVariableBinding ) this . binding ; lastReceiverType = localBinding . type ; if ( ! needValue ) break ; Constant localConstant = localBinding . constant ( ) ; if ( localConstant != Constant . NotAConstant ) { codeStream . generateConstant ( localConstant , <NUM_LIT:0> ) ; } else { if ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) { VariableBinding [ ] path = currentScope . getEmulationPath ( localBinding ) ; codeStream . generateOuterAccess ( path , this , localBinding , currentScope ) ; } else { codeStream . load ( localBinding ) ; } } break ; default : return null ; } int positionsLength = this . sourcePositions . length ; FieldBinding initialFieldBinding = lastFieldBinding ; if ( this . otherBindings != null ) { for ( int i = <NUM_LIT:0> ; i < otherBindingsCount ; i ++ ) { int pc = codeStream . position ; FieldBinding nextField = this . otherBindings [ i ] . original ( ) ; TypeBinding nextGenericCast = this . otherGenericCasts == null ? null : this . otherGenericCasts [ i ] ; if ( lastFieldBinding != null ) { needValue = ! nextField . isStatic ( ) ; Constant fieldConstant = lastFieldBinding . constant ( ) ; if ( fieldConstant != Constant . NotAConstant ) { if ( i > <NUM_LIT:0> && ! lastFieldBinding . isStatic ( ) ) { codeStream . invokeObjectGetClass ( ) ; codeStream . pop ( ) ; } if ( needValue ) { codeStream . generateConstant ( fieldConstant , <NUM_LIT:0> ) ; } } else { if ( needValue || ( i > <NUM_LIT:0> && complyTo14 ) || lastGenericCast != null ) { MethodBinding accessor = this . syntheticReadAccessors == null ? null : this . syntheticReadAccessors [ i ] ; if ( accessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , lastFieldBinding , lastReceiverType , i == <NUM_LIT:0> && this . indexOfFirstFieldBinding == <NUM_LIT:1> ) ; if ( lastFieldBinding . isStatic ( ) ) { codeStream . fieldAccess ( Opcodes . OPC_getstatic , lastFieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . fieldAccess ( Opcodes . OPC_getfield , lastFieldBinding , constantPoolDeclaringClass ) ; } } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } if ( lastGenericCast != null ) { codeStream . checkcast ( lastGenericCast ) ; lastReceiverType = lastGenericCast ; } else { lastReceiverType = lastFieldBinding . type ; } if ( ! needValue ) codeStream . pop ( ) ; } else { if ( lastFieldBinding == initialFieldBinding ) { if ( lastFieldBinding . isStatic ( ) ) { if ( initialFieldBinding . declaringClass != this . actualReceiverType . erasure ( ) ) { MethodBinding accessor = this . syntheticReadAccessors == null ? null : this . syntheticReadAccessors [ i ] ; if ( accessor == null ) { TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , lastFieldBinding , lastReceiverType , i == <NUM_LIT:0> && this . indexOfFirstFieldBinding == <NUM_LIT:1> ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , lastFieldBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokestatic , accessor , null ) ; } codeStream . pop ( ) ; } } } else if ( ! lastFieldBinding . isStatic ( ) ) { codeStream . invokeObjectGetClass ( ) ; codeStream . pop ( ) ; } lastReceiverType = lastFieldBinding . type ; } if ( ( positionsLength - otherBindingsCount + i - <NUM_LIT:1> ) >= <NUM_LIT:0> ) { int fieldPosition = ( int ) ( this . sourcePositions [ positionsLength - otherBindingsCount + i - <NUM_LIT:1> ] > > > <NUM_LIT:32> ) ; codeStream . recordPositionsFrom ( pc , fieldPosition ) ; } } } lastFieldBinding = nextField ; lastGenericCast = nextGenericCast ; } } return lastFieldBinding ; } public void generateReceiver ( CodeStream codeStream ) { codeStream . aload_0 ( ) ; } public TypeBinding [ ] genericTypeArguments ( ) { return null ; } protected FieldBinding getCodegenBinding ( int index ) { if ( index == <NUM_LIT:0> ) { return ( ( FieldBinding ) this . binding ) . original ( ) ; } else { return this . otherBindings [ index - <NUM_LIT:1> ] . original ( ) ; } } protected TypeBinding getFinalReceiverType ( ) { int otherBindingsCount = this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ; switch ( otherBindingsCount ) { case <NUM_LIT:0> : return this . actualReceiverType ; case <NUM_LIT:1> : return this . genericCast != null ? this . genericCast : ( ( VariableBinding ) this . binding ) . type ; default : TypeBinding previousGenericCast = this . otherGenericCasts == null ? null : this . otherGenericCasts [ otherBindingsCount - <NUM_LIT:2> ] ; return previousGenericCast != null ? previousGenericCast : this . otherBindings [ otherBindingsCount - <NUM_LIT:2> ] . type ; } } protected TypeBinding getGenericCast ( int index ) { if ( index == <NUM_LIT:0> ) { return this . genericCast ; } else { if ( this . otherGenericCasts == null ) return null ; return this . otherGenericCasts [ index - <NUM_LIT:1> ] ; } } public TypeBinding getOtherFieldBindings ( BlockScope scope ) { int length = this . tokens . length ; FieldBinding field = ( ( this . bits & Binding . FIELD ) != <NUM_LIT:0> ) ? ( FieldBinding ) this . binding : null ; TypeBinding type = ( ( VariableBinding ) this . binding ) . type ; int index = this . indexOfFirstFieldBinding ; if ( index == length ) { this . constant = ( ( FieldBinding ) this . binding ) . constant ( ) ; return ( type != null && ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> ) ? type . capture ( scope , this . sourceEnd ) : type ; } int otherBindingsLength = length - index ; this . otherBindings = new FieldBinding [ otherBindingsLength ] ; this . otherDepths = new int [ otherBindingsLength ] ; this . constant = ( ( VariableBinding ) this . binding ) . constant ( ) ; int firstDepth = ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ; while ( index < length ) { char [ ] token = this . tokens [ index ] ; if ( type == null ) return null ; this . bits &= ~ ASTNode . DepthMASK ; FieldBinding previousField = field ; field = scope . getField ( type . capture ( scope , ( int ) this . sourcePositions [ index ] ) , token , this ) ; int place = index - this . indexOfFirstFieldBinding ; this . otherBindings [ place ] = field ; this . otherDepths [ place ] = ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT ; if ( field . isValidBinding ( ) ) { if ( previousField != null ) { TypeBinding fieldReceiverType = type ; TypeBinding oldReceiverType = fieldReceiverType ; fieldReceiverType = fieldReceiverType . getErasureCompatibleType ( field . declaringClass ) ; FieldBinding originalBinding = previousField . original ( ) ; if ( fieldReceiverType != oldReceiverType || originalBinding . type . leafComponentType ( ) . isTypeVariable ( ) ) { setGenericCast ( index - <NUM_LIT:1> , originalBinding . type . genericCast ( fieldReceiverType ) ) ; } } if ( isFieldUseDeprecated ( field , scope , index + <NUM_LIT:1> == length ? this . bits : <NUM_LIT:0> ) ) { scope . problemReporter ( ) . deprecatedField ( field , this ) ; } if ( this . constant != Constant . NotAConstant ) { this . constant = field . constant ( ) ; } if ( field . isStatic ( ) ) { if ( ( field . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> ) { ReferenceBinding declaringClass = field . original ( ) . declaringClass ; MethodScope methodScope = scope . methodScope ( ) ; SourceTypeBinding sourceType = methodScope . enclosingSourceType ( ) ; if ( ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> && sourceType == declaringClass && methodScope . lastVisibleFieldID >= <NUM_LIT:0> && field . id >= methodScope . lastVisibleFieldID && ( ! field . isStatic ( ) || methodScope . isStatic ) ) { scope . problemReporter ( ) . forwardReference ( this , index , field ) ; } if ( ( sourceType == declaringClass || sourceType . superclass == declaringClass ) && field . constant ( ) == Constant . NotAConstant && ! methodScope . isStatic && methodScope . isInsideInitializerOrConstructor ( ) ) { scope . problemReporter ( ) . enumStaticFieldUsedDuringInitialization ( field , this ) ; } } scope . problemReporter ( ) . nonStaticAccessToStaticField ( this , field , index ) ; if ( field . declaringClass != type ) { scope . problemReporter ( ) . indirectAccessToStaticField ( this , field ) ; } } type = field . type ; index ++ ; } else { this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidField ( this , field , index , type ) ; setDepth ( firstDepth ) ; return null ; } } setDepth ( firstDepth ) ; type = ( this . otherBindings [ otherBindingsLength - <NUM_LIT:1> ] ) . type ; return ( type != null && ( this . bits & ASTNode . IsStrictlyAssigned ) == <NUM_LIT:0> ) ? type . capture ( scope , this . sourceEnd ) : type ; } public boolean isFieldAccess ( ) { if ( this . otherBindings != null ) { return true ; } return ( this . bits & ASTNode . RestrictiveFlagMASK ) == Binding . FIELD ; } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( ( this . bits & ASTNode . DepthMASK ) == <NUM_LIT:0> ) || ( this . constant != Constant . NotAConstant ) ) { return ; } if ( ( this . bits & ASTNode . RestrictiveFlagMASK ) == Binding . LOCAL ) { LocalVariableBinding localVariableBinding = ( LocalVariableBinding ) this . binding ; if ( localVariableBinding != null ) { if ( ( localVariableBinding . tagBits & TagBits . NotInitialized ) != <NUM_LIT:0> ) { return ; } switch ( localVariableBinding . useFlag ) { case LocalVariableBinding . FAKE_USED : case LocalVariableBinding . USED : currentScope . emulateOuterAccess ( localVariableBinding ) ; } } } } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FieldBinding fieldBinding , int index , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; if ( fieldBinding . constant ( ) != Constant . NotAConstant ) return ; if ( fieldBinding . isPrivate ( ) ) { FieldBinding codegenField = getCodegenBinding ( index < <NUM_LIT:0> ? ( this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ) : index ) ; ReferenceBinding declaringClass = codegenField . declaringClass ; if ( declaringClass != currentScope . enclosingSourceType ( ) ) { setSyntheticAccessor ( fieldBinding , index , ( ( SourceTypeBinding ) declaringClass ) . addSyntheticMethod ( codegenField , index >= <NUM_LIT:0> , false ) ) ; currentScope . problemReporter ( ) . needToEmulateFieldAccess ( codegenField , this , index >= <NUM_LIT:0> ) ; return ; } } else if ( fieldBinding . isProtected ( ) ) { int depth = ( index == <NUM_LIT:0> || ( index < <NUM_LIT:0> && this . otherDepths == null ) ) ? ( this . bits & ASTNode . DepthMASK ) > > ASTNode . DepthSHIFT : this . otherDepths [ index < <NUM_LIT:0> ? this . otherDepths . length - <NUM_LIT:1> : index - <NUM_LIT:1> ] ; if ( depth > <NUM_LIT:0> && ( fieldBinding . declaringClass . getPackage ( ) != currentScope . enclosingSourceType ( ) . getPackage ( ) ) ) { FieldBinding codegenField = getCodegenBinding ( index < <NUM_LIT:0> ? ( this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ) : index ) ; setSyntheticAccessor ( fieldBinding , index , ( ( SourceTypeBinding ) currentScope . enclosingSourceType ( ) . enclosingTypeAt ( depth ) ) . addSyntheticMethod ( codegenField , index >= <NUM_LIT:0> , false ) ) ; currentScope . problemReporter ( ) . needToEmulateFieldAccess ( codegenField , this , index >= <NUM_LIT:0> ) ; return ; } } } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . UNKNOWN ; } public Constant optimizedBooleanConstant ( ) { switch ( this . resolvedType . id ) { case T_boolean : case T_JavaLangBoolean : if ( this . constant != Constant . NotAConstant ) return this . constant ; switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . FIELD : if ( this . otherBindings == null ) return ( ( FieldBinding ) this . binding ) . constant ( ) ; case Binding . LOCAL : return this . otherBindings [ this . otherBindings . length - <NUM_LIT:1> ] . constant ( ) ; } } return Constant . NotAConstant ; } public TypeBinding postConversionType ( Scope scope ) { TypeBinding convertedType = this . resolvedType ; TypeBinding requiredGenericCast = getGenericCast ( this . otherBindings == null ? <NUM_LIT:0> : this . otherBindings . length ) ; if ( requiredGenericCast != null ) convertedType = requiredGenericCast ; int runtimeType = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case T_boolean : convertedType = TypeBinding . BOOLEAN ; break ; case T_byte : convertedType = TypeBinding . BYTE ; break ; case T_short : convertedType = TypeBinding . SHORT ; break ; case T_char : convertedType = TypeBinding . CHAR ; break ; case T_int : convertedType = TypeBinding . INT ; break ; case T_float : convertedType = TypeBinding . FLOAT ; break ; case T_long : convertedType = TypeBinding . LONG ; break ; case T_double : convertedType = TypeBinding . DOUBLE ; break ; default : } if ( ( this . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { convertedType = scope . environment ( ) . computeBoxingType ( convertedType ) ; } return convertedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { for ( int i = <NUM_LIT:0> ; i < this . tokens . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( '<CHAR_LIT:.>' ) ; output . append ( this . tokens [ i ] ) ; } return output ; } public TypeBinding reportError ( BlockScope scope ) { if ( this . binding instanceof ProblemFieldBinding ) { scope . problemReporter ( ) . invalidField ( this , ( FieldBinding ) this . binding ) ; } else if ( this . binding instanceof ProblemReferenceBinding || this . binding instanceof MissingTypeBinding ) { scope . problemReporter ( ) . invalidType ( this , ( TypeBinding ) this . binding ) ; } else { scope . problemReporter ( ) . unresolvableReference ( this , this . binding ) ; } return null ; } public TypeBinding resolveType ( BlockScope scope ) { this . actualReceiverType = scope . enclosingReceiverType ( ) ; this . constant = Constant . NotAConstant ; if ( ( this . binding = scope . getBinding ( this . tokens , this . bits & ASTNode . RestrictiveFlagMASK , this , true ) ) . isValidBinding ( ) ) { switch ( this . bits & ASTNode . RestrictiveFlagMASK ) { case Binding . VARIABLE : case Binding . TYPE | Binding . VARIABLE : if ( this . binding instanceof LocalVariableBinding ) { this . bits &= ~ ASTNode . RestrictiveFlagMASK ; this . bits |= Binding . LOCAL ; LocalVariableBinding local = ( LocalVariableBinding ) this . binding ; if ( ! local . isFinal ( ) && ( ( this . bits & ASTNode . DepthMASK ) != <NUM_LIT:0> ) ) { scope . problemReporter ( ) . cannotReferToNonFinalOuterLocal ( ( LocalVariableBinding ) this . binding , this ) ; } if ( local . type != null && ( local . type . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { return null ; } this . resolvedType = getOtherFieldBindings ( scope ) ; if ( this . resolvedType != null && ( this . resolvedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { FieldBinding lastField = this . otherBindings [ this . otherBindings . length - <NUM_LIT:1> ] ; scope . problemReporter ( ) . invalidField ( this , new ProblemFieldBinding ( lastField . declaringClass , lastField . name , ProblemReasons . NotFound ) , this . tokens . length , this . resolvedType . leafComponentType ( ) ) ; return null ; } return this . resolvedType ; } if ( this . binding instanceof FieldBinding ) { this . bits &= ~ ASTNode . RestrictiveFlagMASK ; this . bits |= Binding . FIELD ; FieldBinding fieldBinding = ( FieldBinding ) this . binding ; MethodScope methodScope = scope . methodScope ( ) ; ReferenceBinding declaringClass = fieldBinding . original ( ) . declaringClass ; SourceTypeBinding sourceType = methodScope . enclosingSourceType ( ) ; if ( ( this . indexOfFirstFieldBinding == <NUM_LIT:1> || ( fieldBinding . modifiers & ClassFileConstants . AccEnum ) != <NUM_LIT:0> || ( ! fieldBinding . isFinal ( ) && declaringClass . isEnum ( ) ) ) && sourceType == declaringClass && methodScope . lastVisibleFieldID >= <NUM_LIT:0> && fieldBinding . id >= methodScope . lastVisibleFieldID && ( ! fieldBinding . isStatic ( ) || methodScope . isStatic ) ) { if ( methodScope . insideTypeAnnotation && fieldBinding . id == methodScope . lastVisibleFieldID ) { } else { scope . problemReporter ( ) . forwardReference ( this , this . indexOfFirstFieldBinding - <NUM_LIT:1> , fieldBinding ) ; } } if ( isFieldUseDeprecated ( fieldBinding , scope , this . indexOfFirstFieldBinding == this . tokens . length ? this . bits : <NUM_LIT:0> ) ) { scope . problemReporter ( ) . deprecatedField ( fieldBinding , this ) ; } if ( fieldBinding . isStatic ( ) ) { if ( declaringClass . isEnum ( ) ) { if ( ( sourceType == declaringClass || sourceType . superclass == declaringClass ) && fieldBinding . constant ( ) == Constant . NotAConstant && ! methodScope . isStatic && methodScope . isInsideInitializerOrConstructor ( ) ) { scope . problemReporter ( ) . enumStaticFieldUsedDuringInitialization ( fieldBinding , this ) ; } } if ( this . indexOfFirstFieldBinding > <NUM_LIT:1> && fieldBinding . declaringClass != this . actualReceiverType && fieldBinding . declaringClass . canBeSeenBy ( scope ) ) { scope . problemReporter ( ) . indirectAccessToStaticField ( this , fieldBinding ) ; } } else { if ( this . indexOfFirstFieldBinding == <NUM_LIT:1> && scope . compilerOptions ( ) . getSeverity ( CompilerOptions . UnqualifiedFieldAccess ) != ProblemSeverities . Ignore ) { scope . problemReporter ( ) . unqualifiedFieldAccess ( this , fieldBinding ) ; } if ( this . indexOfFirstFieldBinding > <NUM_LIT:1> || scope . methodScope ( ) . isStatic ) { scope . problemReporter ( ) . staticFieldAccessToNonStaticVariable ( this , fieldBinding ) ; return null ; } } this . resolvedType = getOtherFieldBindings ( scope ) ; if ( this . resolvedType != null && ( this . resolvedType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { FieldBinding lastField = this . indexOfFirstFieldBinding == this . tokens . length ? ( FieldBinding ) this . binding : this . otherBindings [ this . otherBindings . length - <NUM_LIT:1> ] ; scope . problemReporter ( ) . invalidField ( this , new ProblemFieldBinding ( lastField . declaringClass , lastField . name , ProblemReasons . NotFound ) , this . tokens . length , this . resolvedType . leafComponentType ( ) ) ; return null ; } return this . resolvedType ; } this . bits &= ~ ASTNode . RestrictiveFlagMASK ; this . bits |= Binding . TYPE ; case Binding . TYPE : TypeBinding type = ( TypeBinding ) this . binding ; type = scope . environment ( ) . convertToRawType ( type , false ) ; return this . resolvedType = type ; } } return this . resolvedType = reportError ( scope ) ; } public void setFieldIndex ( int index ) { this . indexOfFirstFieldBinding = index ; } protected void setGenericCast ( int index , TypeBinding someGenericCast ) { if ( someGenericCast == null ) return ; if ( index == <NUM_LIT:0> ) { this . genericCast = someGenericCast ; } else { if ( this . otherGenericCasts == null ) { this . otherGenericCasts = new TypeBinding [ this . otherBindings . length ] ; } this . otherGenericCasts [ index - <NUM_LIT:1> ] = someGenericCast ; } } protected void setSyntheticAccessor ( FieldBinding fieldBinding , int index , SyntheticMethodBinding syntheticAccessor ) { if ( index < <NUM_LIT:0> ) { this . syntheticWriteAccessor = syntheticAccessor ; } else { if ( this . syntheticReadAccessors == null ) { this . syntheticReadAccessors = new SyntheticMethodBinding [ this . otherBindings == null ? <NUM_LIT:1> : this . otherBindings . length + <NUM_LIT:1> ] ; } this . syntheticReadAccessors [ index ] = syntheticAccessor ; } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public String unboundReferenceErrorName ( ) { return new String ( this . tokens [ <NUM_LIT:0> ] ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocSingleNameReference extends SingleNameReference { public int tagSourceStart , tagSourceEnd ; public JavadocSingleNameReference ( char [ ] source , long pos , int tagStart , int tagEnd ) { super ( source , pos ) ; this . tagSourceStart = tagStart ; this . tagSourceEnd = tagEnd ; this . bits |= InsideJavadoc ; } public void resolve ( BlockScope scope ) { resolve ( scope , true , scope . compilerOptions ( ) . reportUnusedParameterIncludeDocCommentReference ) ; } public void resolve ( BlockScope scope , boolean warn , boolean considerParamRefAsUsage ) { LocalVariableBinding variableBinding = scope . findVariable ( this . token ) ; if ( variableBinding != null && variableBinding . isValidBinding ( ) && ( ( variableBinding . tagBits & TagBits . IsArgument ) != <NUM_LIT:0> ) ) { this . binding = variableBinding ; if ( considerParamRefAsUsage ) { variableBinding . useFlag = LocalVariableBinding . USED ; } return ; } if ( warn ) { try { MethodScope methScope = ( MethodScope ) scope ; scope . problemReporter ( ) . javadocUndeclaredParamTagName ( this . token , this . sourceStart , this . sourceEnd , methScope . referenceMethod ( ) . modifiers ) ; } catch ( Exception e ) { scope . problemReporter ( ) . javadocUndeclaredParamTagName ( this . token , this . sourceStart , this . sourceEnd , - <NUM_LIT:1> ) ; } } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ParameterizedQualifiedTypeReference extends ArrayQualifiedTypeReference { public TypeReference [ ] [ ] typeArguments ; public ParameterizedQualifiedTypeReference ( char [ ] [ ] tokens , TypeReference [ ] [ ] typeArguments , int dim , long [ ] positions ) { super ( tokens , dim , positions ) ; this . typeArguments = typeArguments ; } public void checkBounds ( Scope scope ) { if ( this . resolvedType == null ) return ; checkBounds ( ( ReferenceBinding ) this . resolvedType . leafComponentType ( ) , scope , this . typeArguments . length - <NUM_LIT:1> ) ; } public void checkBounds ( ReferenceBinding type , Scope scope , int index ) { if ( index > <NUM_LIT:0> && type . enclosingType ( ) != null ) { checkBounds ( type . enclosingType ( ) , scope , index - <NUM_LIT:1> ) ; } if ( type . isParameterizedTypeWithActualArguments ( ) ) { ParameterizedTypeBinding parameterizedType = ( ParameterizedTypeBinding ) type ; ReferenceBinding currentType = parameterizedType . genericType ( ) ; TypeVariableBinding [ ] typeVariables = currentType . typeVariables ( ) ; if ( typeVariables != null ) { parameterizedType . boundCheck ( scope , this . typeArguments [ index ] ) ; } } } public TypeReference copyDims ( int dim ) { return new ParameterizedQualifiedTypeReference ( this . tokens , this . typeArguments , dim , this . sourcePositions ) ; } public char [ ] [ ] getParameterizedTypeName ( ) { int length = this . tokens . length ; char [ ] [ ] qParamName = new char [ length ] [ ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference [ ] arguments = this . typeArguments [ i ] ; if ( arguments == null ) { qParamName [ i ] = this . tokens [ i ] ; } else { StringBuffer buffer = new StringBuffer ( <NUM_LIT:5> ) ; buffer . append ( this . tokens [ i ] ) ; buffer . append ( '<CHAR_LIT>' ) ; for ( int j = <NUM_LIT:0> , argLength = arguments . length ; j < argLength ; j ++ ) { if ( j > <NUM_LIT:0> ) buffer . append ( '<CHAR_LIT:U+002C>' ) ; buffer . append ( CharOperation . concatWith ( arguments [ j ] . getParameterizedTypeName ( ) , '<CHAR_LIT:.>' ) ) ; } buffer . append ( '<CHAR_LIT:>>' ) ; int nameLength = buffer . length ( ) ; qParamName [ i ] = new char [ nameLength ] ; buffer . getChars ( <NUM_LIT:0> , nameLength , qParamName [ i ] , <NUM_LIT:0> ) ; } } int dim = this . dimensions ; if ( dim > <NUM_LIT:0> ) { char [ ] dimChars = new char [ dim * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < dim ; i ++ ) { int index = i * <NUM_LIT:2> ; dimChars [ index ] = '<CHAR_LIT:[>' ; dimChars [ index + <NUM_LIT:1> ] = '<CHAR_LIT:]>' ; } qParamName [ length - <NUM_LIT:1> ] = CharOperation . concat ( qParamName [ length - <NUM_LIT:1> ] , dimChars ) ; } return qParamName ; } protected TypeBinding getTypeBinding ( Scope scope ) { return null ; } private TypeBinding internalResolveType ( Scope scope , boolean checkBounds ) { this . constant = Constant . NotAConstant ; if ( ( this . bits & ASTNode . DidResolve ) != <NUM_LIT:0> ) { if ( this . resolvedType != null ) { if ( this . resolvedType . isValidBinding ( ) ) { return this . resolvedType ; } else { switch ( this . resolvedType . problemId ( ) ) { case ProblemReasons . NotFound : case ProblemReasons . NotVisible : case ProblemReasons . InheritedNameHidesEnclosingName : TypeBinding type = this . resolvedType . closestMatch ( ) ; return type ; default : return null ; } } } } this . bits |= ASTNode . DidResolve ; TypeBinding type = internalResolveLeafType ( scope , checkBounds ) ; createArrayType ( scope ) ; return type == null ? type : this . resolvedType ; } private TypeBinding internalResolveLeafType ( Scope scope , boolean checkBounds ) { boolean isClassScope = scope . kind == Scope . CLASS_SCOPE ; Binding binding = scope . getPackage ( this . tokens ) ; if ( binding != null && ! binding . isValidBinding ( ) ) { this . resolvedType = ( ReferenceBinding ) binding ; reportInvalidType ( scope ) ; for ( int i = <NUM_LIT:0> , max = this . tokens . length ; i < max ; i ++ ) { TypeReference [ ] args = this . typeArguments [ i ] ; if ( args != null ) { int argLength = args . length ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeReference typeArgument = args [ j ] ; if ( isClassScope ) { typeArgument . resolveType ( ( ClassScope ) scope ) ; } else { typeArgument . resolveType ( ( BlockScope ) scope , checkBounds ) ; } } } } return null ; } PackageBinding packageBinding = binding == null ? null : ( PackageBinding ) binding ; boolean typeIsConsistent = true ; ReferenceBinding qualifyingType = null ; for ( int i = packageBinding == null ? <NUM_LIT:0> : packageBinding . compoundName . length , max = this . tokens . length ; i < max ; i ++ ) { findNextTypeBinding ( i , scope , packageBinding ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { reportInvalidType ( scope ) ; for ( int j = i ; j < max ; j ++ ) { TypeReference [ ] args = this . typeArguments [ j ] ; if ( args != null ) { int argLength = args . length ; for ( int k = <NUM_LIT:0> ; k < argLength ; k ++ ) { TypeReference typeArgument = args [ k ] ; if ( isClassScope ) { typeArgument . resolveType ( ( ClassScope ) scope ) ; } else { typeArgument . resolveType ( ( BlockScope ) scope ) ; } } } } return null ; } ReferenceBinding currentType = ( ReferenceBinding ) this . resolvedType ; if ( qualifyingType == null ) { qualifyingType = currentType . enclosingType ( ) ; if ( qualifyingType != null ) { qualifyingType = currentType . isStatic ( ) ? ( ReferenceBinding ) scope . environment ( ) . convertToRawType ( qualifyingType , false ) : scope . environment ( ) . convertToParameterizedType ( qualifyingType ) ; } } else { if ( typeIsConsistent && currentType . isStatic ( ) && ( qualifyingType . isParameterizedTypeWithActualArguments ( ) || qualifyingType . isGenericType ( ) ) ) { scope . problemReporter ( ) . staticMemberOfParameterizedType ( this , scope . environment ( ) . createParameterizedType ( ( ReferenceBinding ) currentType . erasure ( ) , null , qualifyingType ) , i ) ; typeIsConsistent = false ; } ReferenceBinding enclosingType = currentType . enclosingType ( ) ; if ( enclosingType != null && enclosingType . erasure ( ) != qualifyingType . erasure ( ) ) { qualifyingType = enclosingType ; } } TypeReference [ ] args = this . typeArguments [ i ] ; if ( args != null ) { TypeReference keep = null ; if ( isClassScope ) { keep = ( ( ClassScope ) scope ) . superTypeReference ; ( ( ClassScope ) scope ) . superTypeReference = null ; } int argLength = args . length ; boolean isDiamond = argLength == <NUM_LIT:0> && ( i == ( max - <NUM_LIT:1> ) ) && ( ( this . bits & ASTNode . IsDiamond ) != <NUM_LIT:0> ) ; TypeBinding [ ] argTypes = new TypeBinding [ argLength ] ; boolean argHasError = false ; ReferenceBinding currentOriginal = ( ReferenceBinding ) currentType . original ( ) ; for ( int j = <NUM_LIT:0> ; j < argLength ; j ++ ) { TypeReference arg = args [ j ] ; TypeBinding argType = isClassScope ? arg . resolveTypeArgument ( ( ClassScope ) scope , currentOriginal , j ) : arg . resolveTypeArgument ( ( BlockScope ) scope , currentOriginal , j ) ; if ( argType == null ) { argHasError = true ; } else { argTypes [ j ] = argType ; } } if ( argHasError ) { return null ; } if ( isClassScope ) { ( ( ClassScope ) scope ) . superTypeReference = keep ; if ( ( ( ClassScope ) scope ) . detectHierarchyCycle ( currentOriginal , this ) ) return null ; } TypeVariableBinding [ ] typeVariables = currentOriginal . typeVariables ( ) ; if ( typeVariables == Binding . NO_TYPE_VARIABLES ) { if ( scope . compilerOptions ( ) . originalSourceLevel >= ClassFileConstants . JDK1_5 ) { scope . problemReporter ( ) . nonGenericTypeCannotBeParameterized ( i , this , currentType , argTypes ) ; return null ; } this . resolvedType = ( qualifyingType != null && qualifyingType . isParameterizedType ( ) ) ? scope . environment ( ) . createParameterizedType ( currentOriginal , null , qualifyingType ) : currentType ; return this . resolvedType ; } else if ( argLength != typeVariables . length ) { if ( ! isDiamond ) { scope . problemReporter ( ) . incorrectArityForParameterizedType ( this , currentType , argTypes , i ) ; return null ; } } if ( typeIsConsistent && ! currentType . isStatic ( ) ) { ReferenceBinding actualEnclosing = currentType . enclosingType ( ) ; if ( actualEnclosing != null && actualEnclosing . isRawType ( ) ) { scope . problemReporter ( ) . rawMemberTypeCannotBeParameterized ( this , scope . environment ( ) . createRawType ( currentOriginal , actualEnclosing ) , argTypes ) ; typeIsConsistent = false ; } } ParameterizedTypeBinding parameterizedType = scope . environment ( ) . createParameterizedType ( currentOriginal , argTypes , qualifyingType ) ; if ( ! isDiamond ) { if ( checkBounds ) parameterizedType . boundCheck ( scope , args ) ; else scope . deferBoundCheck ( this ) ; } qualifyingType = parameterizedType ; } else { ReferenceBinding currentOriginal = ( ReferenceBinding ) currentType . original ( ) ; if ( isClassScope ) if ( ( ( ClassScope ) scope ) . detectHierarchyCycle ( currentOriginal , this ) ) return null ; if ( currentOriginal . isGenericType ( ) ) { if ( typeIsConsistent && qualifyingType != null && qualifyingType . isParameterizedType ( ) ) { scope . problemReporter ( ) . parameterizedMemberTypeMissingArguments ( this , scope . environment ( ) . createParameterizedType ( currentOriginal , null , qualifyingType ) , i ) ; typeIsConsistent = false ; } qualifyingType = scope . environment ( ) . createRawType ( currentOriginal , qualifyingType ) ; } else { qualifyingType = ( qualifyingType != null && qualifyingType . isParameterizedType ( ) ) ? scope . environment ( ) . createParameterizedType ( currentOriginal , null , qualifyingType ) : currentType ; } } if ( isTypeUseDeprecated ( qualifyingType , scope ) ) reportDeprecatedType ( qualifyingType , scope , i ) ; this . resolvedType = qualifyingType ; } return this . resolvedType ; } private void createArrayType ( Scope scope ) { if ( this . dimensions > <NUM_LIT:0> ) { if ( this . dimensions > <NUM_LIT:255> ) scope . problemReporter ( ) . tooManyDimensions ( this ) ; this . resolvedType = scope . createArrayType ( this . resolvedType , this . dimensions ) ; } } public StringBuffer printExpression ( int indent , StringBuffer output ) { int length = this . tokens . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { output . append ( this . tokens [ i ] ) ; TypeReference [ ] typeArgument = this . typeArguments [ i ] ; if ( typeArgument != null ) { output . append ( '<CHAR_LIT>' ) ; int typeArgumentLength = typeArgument . length ; if ( typeArgumentLength > <NUM_LIT:0> ) { int max = typeArgumentLength - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < max ; j ++ ) { typeArgument [ j ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } typeArgument [ max ] . print ( <NUM_LIT:0> , output ) ; } output . append ( '<CHAR_LIT:>>' ) ; } output . append ( '<CHAR_LIT:.>' ) ; } output . append ( this . tokens [ length - <NUM_LIT:1> ] ) ; TypeReference [ ] typeArgument = this . typeArguments [ length - <NUM_LIT:1> ] ; if ( typeArgument != null ) { output . append ( '<CHAR_LIT>' ) ; int typeArgumentLength = typeArgument . length ; if ( typeArgumentLength > <NUM_LIT:0> ) { int max = typeArgumentLength - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < max ; j ++ ) { typeArgument [ j ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } typeArgument [ max ] . print ( <NUM_LIT:0> , output ) ; } output . append ( '<CHAR_LIT:>>' ) ; } if ( ( this . bits & IsVarArgs ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . dimensions - <NUM_LIT:1> ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } output . append ( "<STR_LIT:...>" ) ; } else { for ( int i = <NUM_LIT:0> ; i < this . dimensions ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } } return output ; } public TypeBinding resolveType ( BlockScope scope , boolean checkBounds ) { return internalResolveType ( scope , checkBounds ) ; } public TypeBinding resolveType ( ClassScope scope ) { return internalResolveType ( scope , false ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { for ( int i = <NUM_LIT:0> , max = this . typeArguments . length ; i < max ; i ++ ) { if ( this . typeArguments [ i ] != null ) { for ( int j = <NUM_LIT:0> , max2 = this . typeArguments [ i ] . length ; j < max2 ; j ++ ) { this . typeArguments [ i ] [ j ] . traverse ( visitor , scope ) ; } } } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { for ( int i = <NUM_LIT:0> , max = this . typeArguments . length ; i < max ; i ++ ) { if ( this . typeArguments [ i ] != null ) { for ( int j = <NUM_LIT:0> , max2 = this . typeArguments [ i ] . length ; j < max2 ; j ++ ) { this . typeArguments [ i ] [ j ] . traverse ( visitor , scope ) ; } } } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class JavadocArrayQualifiedTypeReference extends ArrayQualifiedTypeReference { public int tagSourceStart , tagSourceEnd ; public JavadocArrayQualifiedTypeReference ( JavadocQualifiedTypeReference typeRef , int dim ) { super ( typeRef . tokens , dim , typeRef . sourcePositions ) ; } protected void reportInvalidType ( Scope scope ) { scope . problemReporter ( ) . javadocInvalidType ( this , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { scope . problemReporter ( ) . javadocDeprecatedType ( type , this , scope . getDeclarationModifiers ( ) ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . util . Util ; public abstract class OperatorExpression extends Expression implements OperatorIds { public static int [ ] [ ] OperatorSignatures = new int [ NumberOfTables ] [ ] ; static { classInitialize ( ) ; } public OperatorExpression ( ) { super ( ) ; } public static final void classInitialize ( ) { OperatorSignatures [ AND ] = get_AND ( ) ; OperatorSignatures [ AND_AND ] = get_AND_AND ( ) ; OperatorSignatures [ DIVIDE ] = get_DIVIDE ( ) ; OperatorSignatures [ EQUAL_EQUAL ] = get_EQUAL_EQUAL ( ) ; OperatorSignatures [ GREATER ] = get_GREATER ( ) ; OperatorSignatures [ GREATER_EQUAL ] = get_GREATER_EQUAL ( ) ; OperatorSignatures [ LEFT_SHIFT ] = get_LEFT_SHIFT ( ) ; OperatorSignatures [ LESS ] = get_LESS ( ) ; OperatorSignatures [ LESS_EQUAL ] = get_LESS_EQUAL ( ) ; OperatorSignatures [ MINUS ] = get_MINUS ( ) ; OperatorSignatures [ MULTIPLY ] = get_MULTIPLY ( ) ; OperatorSignatures [ OR ] = get_OR ( ) ; OperatorSignatures [ OR_OR ] = get_OR_OR ( ) ; OperatorSignatures [ PLUS ] = get_PLUS ( ) ; OperatorSignatures [ REMAINDER ] = get_REMAINDER ( ) ; OperatorSignatures [ RIGHT_SHIFT ] = get_RIGHT_SHIFT ( ) ; OperatorSignatures [ UNSIGNED_RIGHT_SHIFT ] = get_UNSIGNED_RIGHT_SHIFT ( ) ; OperatorSignatures [ XOR ] = get_XOR ( ) ; } public static final String generateTableTestCase ( ) { int [ ] operators = new int [ ] { AND , AND_AND , DIVIDE , GREATER , GREATER_EQUAL , LEFT_SHIFT , LESS , LESS_EQUAL , MINUS , MULTIPLY , OR , OR_OR , PLUS , REMAINDER , RIGHT_SHIFT , UNSIGNED_RIGHT_SHIFT , XOR } ; class Decode { public final String constant ( int code ) { switch ( code ) { case T_boolean : return "<STR_LIT:true>" ; case T_byte : return "<STR_LIT>" ; case T_char : return "<STR_LIT>" ; case T_double : return "<STR_LIT>" ; case T_float : return "<STR_LIT>" ; case T_int : return "<STR_LIT:1>" ; case T_long : return "<STR_LIT>" ; case T_JavaLangString : return "<STR_LIT>" ; case T_null : return "<STR_LIT:null>" ; case T_short : return "<STR_LIT>" ; case T_JavaLangObject : return "<STR_LIT:null>" ; } return Util . EMPTY_STRING ; } public final String type ( int code ) { switch ( code ) { case T_boolean : return "<STR_LIT>" ; case T_byte : return "<STR_LIT:b>" ; case T_char : return "<STR_LIT:c>" ; case T_double : return "<STR_LIT:d>" ; case T_float : return "<STR_LIT:f>" ; case T_int : return "<STR_LIT:i>" ; case T_long : return "<STR_LIT>" ; case T_JavaLangString : return "<STR_LIT>" ; case T_null : return "<STR_LIT:null>" ; case T_short : return "<STR_LIT:s>" ; case T_JavaLangObject : return "<STR_LIT>" ; } return "<STR_LIT>" ; } public final String operator ( int operator ) { switch ( operator ) { case EQUAL_EQUAL : return "<STR_LIT>" ; case LESS_EQUAL : return "<STR_LIT>" ; case GREATER_EQUAL : return "<STR_LIT>" ; case LEFT_SHIFT : return "<STR_LIT>" ; case RIGHT_SHIFT : return "<STR_LIT>" ; case UNSIGNED_RIGHT_SHIFT : return "<STR_LIT>" ; case OR_OR : return "<STR_LIT>" ; case AND_AND : return "<STR_LIT>" ; case PLUS : return "<STR_LIT:+>" ; case MINUS : return "<STR_LIT:->" ; case NOT : return "<STR_LIT:!>" ; case REMAINDER : return "<STR_LIT:%>" ; case XOR : return "<STR_LIT>" ; case AND : return "<STR_LIT:&>" ; case MULTIPLY : return "<STR_LIT:*>" ; case OR : return "<STR_LIT:|>" ; case TWIDDLE : return "<STR_LIT>" ; case DIVIDE : return "<STR_LIT:/>" ; case GREATER : return "<STR_LIT:>>" ; case LESS : return "<STR_LIT:<>" ; } return "<STR_LIT>" ; } } Decode decode = new Decode ( ) ; String s ; s = "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_JavaLangString ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_int ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_boolean ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_char ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_float ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_double ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_byte ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_short ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_long ) + "<STR_LIT>" + "<STR_LIT>" + decode . constant ( T_JavaLangObject ) + "<STR_LIT>" + "<STR_LIT:n>" ; int error = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < operators . length ; i ++ ) { int operator = operators [ i ] ; for ( int left = <NUM_LIT:0> ; left < <NUM_LIT:16> ; left ++ ) for ( int right = <NUM_LIT:0> ; right < <NUM_LIT:16> ; right ++ ) { int result = ( OperatorSignatures [ operator ] [ ( left << <NUM_LIT:4> ) + right ] ) & <NUM_LIT> ; if ( result != T_undefined ) { s += "<STR_LIT>" + decode . type ( result ) + "<STR_LIT:0>" + "<STR_LIT:U+0020=U+0020>" + decode . type ( left ) ; s += "<STR_LIT:U+0020>" + decode . operator ( operator ) + "<STR_LIT:U+0020>" + decode . type ( right ) + "<STR_LIT>" ; String begin = result == T_JavaLangString ? "<STR_LIT>" : "<STR_LIT>" ; String test = result == T_JavaLangString ? "<STR_LIT>" : "<STR_LIT>" ; s += begin + decode . type ( result ) + "<STR_LIT:0>" + test + decode . constant ( left ) + "<STR_LIT:U+0020>" + decode . operator ( operator ) + "<STR_LIT:U+0020>" + decode . constant ( right ) + "<STR_LIT>" ; s += "<STR_LIT>" + ( ++ error ) + "<STR_LIT>" ; } } } return s += "<STR_LIT>" ; } public static final int [ ] get_AND ( ) { int [ ] table = new int [ <NUM_LIT:16> * <NUM_LIT:16> ] ; table [ ( T_byte << <NUM_LIT:4> ) + T_byte ] = ( Byte2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_long ] = ( Byte2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_byte << <NUM_LIT:4> ) + T_short ] = ( Byte2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_char ] = ( Byte2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_int ] = ( Byte2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_long << <NUM_LIT:4> ) + T_byte ] = ( Long2Long << <NUM_LIT:12> ) + ( Byte2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_long ] = ( Long2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_short ] = ( Long2Long << <NUM_LIT:12> ) + ( Short2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_char ] = ( Long2Long << <NUM_LIT:12> ) + ( Char2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_int ] = ( Long2Long << <NUM_LIT:12> ) + ( Int2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_short << <NUM_LIT:4> ) + T_byte ] = ( Short2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_long ] = ( Short2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_short << <NUM_LIT:4> ) + T_short ] = ( Short2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_char ] = ( Short2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_int ] = ( Short2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_boolean << <NUM_LIT:4> ) + T_boolean ] = ( Boolean2Boolean << <NUM_LIT:12> ) + ( Boolean2Boolean << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_byte ] = ( Char2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_long ] = ( Char2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_char << <NUM_LIT:4> ) + T_short ] = ( Char2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_char ] = ( Char2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_int ] = ( Char2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_byte ] = ( Int2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_long ] = ( Int2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_int << <NUM_LIT:4> ) + T_short ] = ( Int2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_char ] = ( Int2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_int ] = ( Int2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; return table ; } public static final int [ ] get_AND_AND ( ) { int [ ] table = new int [ <NUM_LIT:16> * <NUM_LIT:16> ] ; table [ ( T_boolean << <NUM_LIT:4> ) + T_boolean ] = ( Boolean2Boolean << <NUM_LIT:12> ) + ( Boolean2Boolean << <NUM_LIT:4> ) + T_boolean ; return table ; } public static final int [ ] get_DIVIDE ( ) { return get_MINUS ( ) ; } public static final int [ ] get_EQUAL_EQUAL ( ) { int [ ] table = new int [ <NUM_LIT:16> * <NUM_LIT:16> ] ; table [ ( T_byte << <NUM_LIT:4> ) + T_byte ] = ( Byte2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_long ] = ( Byte2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_short ] = ( Byte2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_double ] = ( Byte2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_float ] = ( Byte2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_char ] = ( Byte2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_int ] = ( Byte2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_byte ] = ( Long2Long << <NUM_LIT:12> ) + ( Byte2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_long ] = ( Long2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_short ] = ( Long2Long << <NUM_LIT:12> ) + ( Short2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_double ] = ( Long2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_float ] = ( Long2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_char ] = ( Long2Long << <NUM_LIT:12> ) + ( Char2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_int ] = ( Long2Long << <NUM_LIT:12> ) + ( Int2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_byte ] = ( Short2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_long ] = ( Short2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_short ] = ( Short2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_double ] = ( Short2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_float ] = ( Short2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_char ] = ( Short2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_int ] = ( Short2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangString ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_JavaLangString << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_JavaLangString << <NUM_LIT:4> ) + T_boolean ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangObject ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_JavaLangString << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_JavaLangObject << <NUM_LIT:4> ) + T_boolean ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_null ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_JavaLangString << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_null << <NUM_LIT:4> ) + T_boolean ; table [ ( T_JavaLangObject << <NUM_LIT:4> ) + T_JavaLangString ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_JavaLangObject << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_JavaLangString << <NUM_LIT:4> ) + T_boolean ; table [ ( T_JavaLangObject << <NUM_LIT:4> ) + T_JavaLangObject ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_JavaLangObject << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_JavaLangObject << <NUM_LIT:4> ) + T_boolean ; table [ ( T_JavaLangObject << <NUM_LIT:4> ) + T_null ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_JavaLangObject << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_null << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_byte ] = ( Double2Double << <NUM_LIT:12> ) + ( Byte2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_long ] = ( Double2Double << <NUM_LIT:12> ) + ( Long2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_short ] = ( Double2Double << <NUM_LIT:12> ) + ( Short2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_double ] = ( Double2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_float ] = ( Double2Double << <NUM_LIT:12> ) + ( Float2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_char ] = ( Double2Double << <NUM_LIT:12> ) + ( Char2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_int ] = ( Double2Double << <NUM_LIT:12> ) + ( Int2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_byte ] = ( Float2Float << <NUM_LIT:12> ) + ( Byte2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_long ] = ( Float2Float << <NUM_LIT:12> ) + ( Long2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_short ] = ( Float2Float << <NUM_LIT:12> ) + ( Short2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_double ] = ( Float2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_float ] = ( Float2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_char ] = ( Float2Float << <NUM_LIT:12> ) + ( Char2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_int ] = ( Float2Float << <NUM_LIT:12> ) + ( Int2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_boolean << <NUM_LIT:4> ) + T_boolean ] = ( Boolean2Boolean << <NUM_LIT:12> ) + ( Boolean2Boolean << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_byte ] = ( Char2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_long ] = ( Char2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_short ] = ( Char2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_double ] = ( Char2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_float ] = ( Char2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_char ] = ( Char2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_int ] = ( Char2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_byte ] = ( Int2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_long ] = ( Int2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_short ] = ( Int2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_double ] = ( Int2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_float ] = ( Int2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_char ] = ( Int2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_int ] = ( Int2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_null << <NUM_LIT:4> ) + T_JavaLangString ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_null << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_JavaLangString << <NUM_LIT:4> ) + T_boolean ; table [ ( T_null << <NUM_LIT:4> ) + T_JavaLangObject ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_null << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_JavaLangObject << <NUM_LIT:4> ) + T_boolean ; table [ ( T_null << <NUM_LIT:4> ) + T_null ] = ( T_JavaLangObject << <NUM_LIT:16> ) + ( T_null << <NUM_LIT:12> ) + ( T_JavaLangObject << <NUM_LIT:8> ) + ( T_null << <NUM_LIT:4> ) + T_boolean ; return table ; } public static final int [ ] get_GREATER ( ) { return get_LESS ( ) ; } public static final int [ ] get_GREATER_EQUAL ( ) { return get_LESS ( ) ; } public static final int [ ] get_LEFT_SHIFT ( ) { int [ ] table = new int [ <NUM_LIT:16> * <NUM_LIT:16> ] ; table [ ( T_byte << <NUM_LIT:4> ) + T_byte ] = ( Byte2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_long ] = ( Byte2Int << <NUM_LIT:12> ) + ( Long2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_short ] = ( Byte2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_char ] = ( Byte2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_int ] = ( Byte2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_long << <NUM_LIT:4> ) + T_byte ] = ( Long2Long << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_long ] = ( Long2Long << <NUM_LIT:12> ) + ( Long2Int << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_short ] = ( Long2Long << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_char ] = ( Long2Long << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_int ] = ( Long2Long << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_long ; table [ ( T_short << <NUM_LIT:4> ) + T_byte ] = ( Short2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_long ] = ( Short2Int << <NUM_LIT:12> ) + ( Long2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_short ] = ( Short2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_char ] = ( Short2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_int ] = ( Short2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_byte ] = ( Char2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_long ] = ( Char2Int << <NUM_LIT:12> ) + ( Long2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_short ] = ( Char2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_char ] = ( Char2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_int ] = ( Char2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_byte ] = ( Int2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_long ] = ( Int2Int << <NUM_LIT:12> ) + ( Long2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_short ] = ( Int2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_char ] = ( Int2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_int ] = ( Int2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; return table ; } public static final int [ ] get_LESS ( ) { int [ ] table = new int [ <NUM_LIT:16> * <NUM_LIT:16> ] ; table [ ( T_byte << <NUM_LIT:4> ) + T_byte ] = ( Byte2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_long ] = ( Byte2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_short ] = ( Byte2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_double ] = ( Byte2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_float ] = ( Byte2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_char ] = ( Byte2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_byte << <NUM_LIT:4> ) + T_int ] = ( Byte2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_byte ] = ( Long2Long << <NUM_LIT:12> ) + ( Byte2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_long ] = ( Long2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_short ] = ( Long2Long << <NUM_LIT:12> ) + ( Short2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_double ] = ( Long2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_float ] = ( Long2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_char ] = ( Long2Long << <NUM_LIT:12> ) + ( Char2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_long << <NUM_LIT:4> ) + T_int ] = ( Long2Long << <NUM_LIT:12> ) + ( Int2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_byte ] = ( Short2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_long ] = ( Short2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_short ] = ( Short2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_double ] = ( Short2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_float ] = ( Short2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_char ] = ( Short2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_short << <NUM_LIT:4> ) + T_int ] = ( Short2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_byte ] = ( Double2Double << <NUM_LIT:12> ) + ( Byte2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_long ] = ( Double2Double << <NUM_LIT:12> ) + ( Long2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_short ] = ( Double2Double << <NUM_LIT:12> ) + ( Short2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_double ] = ( Double2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_float ] = ( Double2Double << <NUM_LIT:12> ) + ( Float2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_char ] = ( Double2Double << <NUM_LIT:12> ) + ( Char2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_double << <NUM_LIT:4> ) + T_int ] = ( Double2Double << <NUM_LIT:12> ) + ( Int2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_byte ] = ( Float2Float << <NUM_LIT:12> ) + ( Byte2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_long ] = ( Float2Float << <NUM_LIT:12> ) + ( Long2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_short ] = ( Float2Float << <NUM_LIT:12> ) + ( Short2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_double ] = ( Float2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_float ] = ( Float2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_char ] = ( Float2Float << <NUM_LIT:12> ) + ( Char2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_float << <NUM_LIT:4> ) + T_int ] = ( Float2Float << <NUM_LIT:12> ) + ( Int2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_byte ] = ( Char2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_long ] = ( Char2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_short ] = ( Char2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_double ] = ( Char2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_float ] = ( Char2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_char ] = ( Char2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_char << <NUM_LIT:4> ) + T_int ] = ( Char2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_byte ] = ( Int2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_long ] = ( Int2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_short ] = ( Int2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_double ] = ( Int2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_float ] = ( Int2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_char ] = ( Int2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_boolean ; table [ ( T_int << <NUM_LIT:4> ) + T_int ] = ( Int2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_boolean ; return table ; } public static final int [ ] get_LESS_EQUAL ( ) { return get_LESS ( ) ; } public static final int [ ] get_MINUS ( ) { int [ ] table = ( int [ ] ) get_PLUS ( ) . clone ( ) ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_byte ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_long ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_short ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_void ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangObject ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_double ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_float ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_boolean ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_char ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_int ] = T_undefined ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_null ] = T_undefined ; table [ ( T_byte << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_long << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_short << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_void << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_JavaLangObject << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_double << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_float << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_boolean << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_char << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_int << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_null << <NUM_LIT:4> ) + T_JavaLangString ] = T_undefined ; table [ ( T_null << <NUM_LIT:4> ) + T_null ] = T_undefined ; return table ; } public static final int [ ] get_MULTIPLY ( ) { return get_MINUS ( ) ; } public static final int [ ] get_OR ( ) { return get_AND ( ) ; } public static final int [ ] get_OR_OR ( ) { return get_AND_AND ( ) ; } public static final int [ ] get_PLUS ( ) { int [ ] table = new int [ <NUM_LIT:16> * <NUM_LIT:16> ] ; table [ ( T_byte << <NUM_LIT:4> ) + T_byte ] = ( Byte2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_long ] = ( Byte2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_byte << <NUM_LIT:4> ) + T_short ] = ( Byte2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_JavaLangString ] = ( Byte2Byte << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_byte << <NUM_LIT:4> ) + T_double ] = ( Byte2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_byte << <NUM_LIT:4> ) + T_float ] = ( Byte2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_byte << <NUM_LIT:4> ) + T_char ] = ( Byte2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_byte << <NUM_LIT:4> ) + T_int ] = ( Byte2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_long << <NUM_LIT:4> ) + T_byte ] = ( Long2Long << <NUM_LIT:12> ) + ( Byte2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_long ] = ( Long2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_short ] = ( Long2Long << <NUM_LIT:12> ) + ( Short2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_JavaLangString ] = ( Long2Long << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_long << <NUM_LIT:4> ) + T_double ] = ( Long2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_long << <NUM_LIT:4> ) + T_float ] = ( Long2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_long << <NUM_LIT:4> ) + T_char ] = ( Long2Long << <NUM_LIT:12> ) + ( Char2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_long << <NUM_LIT:4> ) + T_int ] = ( Long2Long << <NUM_LIT:12> ) + ( Int2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_short << <NUM_LIT:4> ) + T_byte ] = ( Short2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_long ] = ( Short2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_short << <NUM_LIT:4> ) + T_short ] = ( Short2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_JavaLangString ] = ( Short2Short << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_short << <NUM_LIT:4> ) + T_double ] = ( Short2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_short << <NUM_LIT:4> ) + T_float ] = ( Short2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_short << <NUM_LIT:4> ) + T_char ] = ( Short2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_short << <NUM_LIT:4> ) + T_int ] = ( Short2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_byte ] = ( String2String << <NUM_LIT:12> ) + ( Byte2Byte << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_long ] = ( String2String << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_short ] = ( String2String << <NUM_LIT:12> ) + ( Short2Short << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangString ] = ( String2String << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangObject ] = ( String2String << <NUM_LIT:12> ) + ( Object2Object << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_double ] = ( String2String << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_float ] = ( String2String << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_boolean ] = ( String2String << <NUM_LIT:12> ) + ( Boolean2Boolean << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_char ] = ( String2String << <NUM_LIT:12> ) + ( Char2Char << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_int ] = ( String2String << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangString << <NUM_LIT:4> ) + T_null ] = ( String2String << <NUM_LIT:12> ) + ( T_null << <NUM_LIT:8> ) + ( T_null << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_JavaLangObject << <NUM_LIT:4> ) + T_JavaLangString ] = ( Object2Object << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_double << <NUM_LIT:4> ) + T_byte ] = ( Double2Double << <NUM_LIT:12> ) + ( Byte2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_double << <NUM_LIT:4> ) + T_long ] = ( Double2Double << <NUM_LIT:12> ) + ( Long2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_double << <NUM_LIT:4> ) + T_short ] = ( Double2Double << <NUM_LIT:12> ) + ( Short2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_double << <NUM_LIT:4> ) + T_JavaLangString ] = ( Double2Double << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_double << <NUM_LIT:4> ) + T_double ] = ( Double2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_double << <NUM_LIT:4> ) + T_float ] = ( Double2Double << <NUM_LIT:12> ) + ( Float2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_double << <NUM_LIT:4> ) + T_char ] = ( Double2Double << <NUM_LIT:12> ) + ( Char2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_double << <NUM_LIT:4> ) + T_int ] = ( Double2Double << <NUM_LIT:12> ) + ( Int2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_float << <NUM_LIT:4> ) + T_byte ] = ( Float2Float << <NUM_LIT:12> ) + ( Byte2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_float << <NUM_LIT:4> ) + T_long ] = ( Float2Float << <NUM_LIT:12> ) + ( Long2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_float << <NUM_LIT:4> ) + T_short ] = ( Float2Float << <NUM_LIT:12> ) + ( Short2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_float << <NUM_LIT:4> ) + T_JavaLangString ] = ( Float2Float << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_float << <NUM_LIT:4> ) + T_double ] = ( Float2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_float << <NUM_LIT:4> ) + T_float ] = ( Float2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_float << <NUM_LIT:4> ) + T_char ] = ( Float2Float << <NUM_LIT:12> ) + ( Char2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_float << <NUM_LIT:4> ) + T_int ] = ( Float2Float << <NUM_LIT:12> ) + ( Int2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_boolean << <NUM_LIT:4> ) + T_JavaLangString ] = ( Boolean2Boolean << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_char << <NUM_LIT:4> ) + T_byte ] = ( Char2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_long ] = ( Char2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_char << <NUM_LIT:4> ) + T_short ] = ( Char2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_JavaLangString ] = ( Char2Char << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_char << <NUM_LIT:4> ) + T_double ] = ( Char2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_char << <NUM_LIT:4> ) + T_float ] = ( Char2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_char << <NUM_LIT:4> ) + T_char ] = ( Char2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_char << <NUM_LIT:4> ) + T_int ] = ( Char2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_byte ] = ( Int2Int << <NUM_LIT:12> ) + ( Byte2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_long ] = ( Int2Long << <NUM_LIT:12> ) + ( Long2Long << <NUM_LIT:4> ) + T_long ; table [ ( T_int << <NUM_LIT:4> ) + T_short ] = ( Int2Int << <NUM_LIT:12> ) + ( Short2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_JavaLangString ] = ( Int2Int << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; table [ ( T_int << <NUM_LIT:4> ) + T_double ] = ( Int2Double << <NUM_LIT:12> ) + ( Double2Double << <NUM_LIT:4> ) + T_double ; table [ ( T_int << <NUM_LIT:4> ) + T_float ] = ( Int2Float << <NUM_LIT:12> ) + ( Float2Float << <NUM_LIT:4> ) + T_float ; table [ ( T_int << <NUM_LIT:4> ) + T_char ] = ( Int2Int << <NUM_LIT:12> ) + ( Char2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_int << <NUM_LIT:4> ) + T_int ] = ( Int2Int << <NUM_LIT:12> ) + ( Int2Int << <NUM_LIT:4> ) + T_int ; table [ ( T_null << <NUM_LIT:4> ) + T_JavaLangString ] = ( T_null << <NUM_LIT:16> ) + ( T_null << <NUM_LIT:12> ) + ( String2String << <NUM_LIT:4> ) + T_JavaLangString ; return table ; } public static final int [ ] get_REMAINDER ( ) { return get_MINUS ( ) ; } public static final int [ ] get_RIGHT_SHIFT ( ) { return get_LEFT_SHIFT ( ) ; } public static final int [ ] get_UNSIGNED_RIGHT_SHIFT ( ) { return get_LEFT_SHIFT ( ) ; } public static final int [ ] get_XOR ( ) { return get_AND ( ) ; } public String operatorToString ( ) { switch ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) { case EQUAL_EQUAL : return "<STR_LIT>" ; case LESS_EQUAL : return "<STR_LIT>" ; case GREATER_EQUAL : return "<STR_LIT>" ; case NOT_EQUAL : return "<STR_LIT>" ; case LEFT_SHIFT : return "<STR_LIT>" ; case RIGHT_SHIFT : return "<STR_LIT>" ; case UNSIGNED_RIGHT_SHIFT : return "<STR_LIT>" ; case OR_OR : return "<STR_LIT>" ; case AND_AND : return "<STR_LIT>" ; case PLUS : return "<STR_LIT:+>" ; case MINUS : return "<STR_LIT:->" ; case NOT : return "<STR_LIT:!>" ; case REMAINDER : return "<STR_LIT:%>" ; case XOR : return "<STR_LIT>" ; case AND : return "<STR_LIT:&>" ; case MULTIPLY : return "<STR_LIT:*>" ; case OR : return "<STR_LIT:|>" ; case TWIDDLE : return "<STR_LIT>" ; case DIVIDE : return "<STR_LIT:/>" ; case GREATER : return "<STR_LIT:>>" ; case LESS : return "<STR_LIT:<>" ; case QUESTIONCOLON : return "<STR_LIT>" ; case EQUAL : return "<STR_LIT:=>" ; } return "<STR_LIT>" ; } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . NON_NULL ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( '<CHAR_LIT:(>' ) ; return printExpressionNoParenthesis ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:)>' ) ; } public abstract StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) ; } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; public class QualifiedTypeReference extends TypeReference { public char [ ] [ ] tokens ; public long [ ] sourcePositions ; public QualifiedTypeReference ( char [ ] [ ] sources , long [ ] poss ) { this . tokens = sources ; this . sourcePositions = poss ; this . sourceStart = ( int ) ( this . sourcePositions [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; this . sourceEnd = ( int ) ( this . sourcePositions [ this . sourcePositions . length - <NUM_LIT:1> ] & <NUM_LIT> ) ; } public TypeReference copyDims ( int dim ) { return new ArrayQualifiedTypeReference ( this . tokens , dim , this . sourcePositions ) ; } protected TypeBinding findNextTypeBinding ( int tokenIndex , Scope scope , PackageBinding packageBinding ) { LookupEnvironment env = scope . environment ( ) ; try { env . missingClassFileLocation = this ; if ( this . resolvedType == null ) { this . resolvedType = scope . getType ( this . tokens [ tokenIndex ] , packageBinding ) ; } else { this . resolvedType = scope . getMemberType ( this . tokens [ tokenIndex ] , ( ReferenceBinding ) this . resolvedType ) ; if ( ! this . resolvedType . isValidBinding ( ) ) { this . resolvedType = new ProblemReferenceBinding ( CharOperation . subarray ( this . tokens , <NUM_LIT:0> , tokenIndex + <NUM_LIT:1> ) , ( ReferenceBinding ) this . resolvedType . closestMatch ( ) , this . resolvedType . problemId ( ) ) ; } } return this . resolvedType ; } catch ( AbortCompilation e ) { e . updateContext ( this , scope . referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public char [ ] getLastToken ( ) { return this . tokens [ this . tokens . length - <NUM_LIT:1> ] ; } protected TypeBinding getTypeBinding ( Scope scope ) { if ( this . resolvedType != null ) { return this . resolvedType ; } Binding binding = scope . getPackage ( this . tokens ) ; if ( binding != null && ! binding . isValidBinding ( ) ) { if ( binding instanceof ProblemReferenceBinding && binding . problemId ( ) == ProblemReasons . NotFound ) { ProblemReferenceBinding problemBinding = ( ProblemReferenceBinding ) binding ; Binding pkg = scope . getTypeOrPackage ( this . tokens ) ; return new ProblemReferenceBinding ( problemBinding . compoundName , pkg instanceof PackageBinding ? null : scope . environment ( ) . createMissingType ( null , this . tokens ) , ProblemReasons . NotFound ) ; } return ( ReferenceBinding ) binding ; } PackageBinding packageBinding = binding == null ? null : ( PackageBinding ) binding ; boolean isClassScope = scope . kind == Scope . CLASS_SCOPE ; ReferenceBinding qualifiedType = null ; for ( int i = packageBinding == null ? <NUM_LIT:0> : packageBinding . compoundName . length , max = this . tokens . length , last = max - <NUM_LIT:1> ; i < max ; i ++ ) { findNextTypeBinding ( i , scope , packageBinding ) ; if ( ! this . resolvedType . isValidBinding ( ) ) return this . resolvedType ; if ( i == <NUM_LIT:0> && this . resolvedType . isTypeVariable ( ) && ( ( TypeVariableBinding ) this . resolvedType ) . firstBound == null ) { scope . problemReporter ( ) . illegalAccessFromTypeVariable ( ( TypeVariableBinding ) this . resolvedType , this ) ; return null ; } if ( i <= last && isTypeUseDeprecated ( this . resolvedType , scope ) ) { reportDeprecatedType ( this . resolvedType , scope , i ) ; } if ( isClassScope ) if ( ( ( ClassScope ) scope ) . detectHierarchyCycle ( this . resolvedType , this ) ) return null ; ReferenceBinding currentType = ( ReferenceBinding ) this . resolvedType ; if ( qualifiedType != null ) { ReferenceBinding enclosingType = currentType . enclosingType ( ) ; if ( enclosingType != null && enclosingType . erasure ( ) != qualifiedType . erasure ( ) ) { qualifiedType = enclosingType ; } boolean rawQualified ; if ( currentType . isGenericType ( ) ) { qualifiedType = scope . environment ( ) . createRawType ( currentType , qualifiedType ) ; } else if ( ( rawQualified = qualifiedType . isRawType ( ) ) && ! currentType . isStatic ( ) ) { qualifiedType = scope . environment ( ) . createRawType ( ( ReferenceBinding ) currentType . erasure ( ) , qualifiedType ) ; } else if ( ( rawQualified || qualifiedType . isParameterizedType ( ) ) && qualifiedType . erasure ( ) == currentType . enclosingType ( ) . erasure ( ) ) { qualifiedType = scope . environment ( ) . createParameterizedType ( ( ReferenceBinding ) currentType . erasure ( ) , null , qualifiedType ) ; } else { qualifiedType = currentType ; } } else { qualifiedType = currentType . isGenericType ( ) ? ( ReferenceBinding ) scope . environment ( ) . convertToRawType ( currentType , false ) : currentType ; } } this . resolvedType = qualifiedType ; return this . resolvedType ; } public char [ ] [ ] getTypeName ( ) { return this . tokens ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { for ( int i = <NUM_LIT:0> ; i < this . tokens . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( '<CHAR_LIT:.>' ) ; output . append ( this . tokens [ i ] ) ; } return output ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public class CharLiteral extends NumberLiteral { char value ; public CharLiteral ( char [ ] token , int s , int e ) { super ( token , s , e ) ; computeValue ( ) ; } public void computeConstant ( ) { this . constant = CharConstant . fromValue ( this . value ) ; } private void computeValue ( ) { if ( ( this . value = this . source [ <NUM_LIT:1> ] ) != '<STR_LIT:\\>' ) return ; char digit ; switch ( digit = this . source [ <NUM_LIT:2> ] ) { case '<CHAR_LIT:b>' : this . value = '<STR_LIT>' ; break ; case '<CHAR_LIT>' : this . value = '<STR_LIT:\t>' ; break ; case '<CHAR_LIT>' : this . value = '<STR_LIT:\n>' ; break ; case '<CHAR_LIT>' : this . value = '<STR_LIT>' ; break ; case '<CHAR_LIT>' : this . value = '<STR_LIT>' ; break ; case '<STR_LIT:\">' : this . value = '<STR_LIT:\">' ; break ; case '<STR_LIT>' : this . value = '<STR_LIT>' ; break ; case '<STR_LIT:\\>' : this . value = '<STR_LIT:\\>' ; break ; default : int number = ScannerHelper . getNumericValue ( digit ) ; if ( ( digit = this . source [ <NUM_LIT:3> ] ) != '<STR_LIT>' ) number = ( number * <NUM_LIT:8> ) + ScannerHelper . getNumericValue ( digit ) ; else { this . constant = CharConstant . fromValue ( this . value = ( char ) number ) ; break ; } if ( ( digit = this . source [ <NUM_LIT:4> ] ) != '<STR_LIT>' ) number = ( number * <NUM_LIT:8> ) + ScannerHelper . getNumericValue ( digit ) ; this . value = ( char ) number ; break ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . CHAR ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { visitor . visit ( this , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; 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 . impl . IntConstant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class CaseStatement extends Statement { public Expression constantExpression ; public BranchLabel targetLabel ; public CaseStatement ( Expression constantExpression , int sourceEnd , int sourceStart ) { this . constantExpression = constantExpression ; this . sourceEnd = sourceEnd ; this . sourceStart = sourceStart ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . constantExpression != null ) { if ( this . constantExpression . constant == Constant . NotAConstant && ! this . constantExpression . resolvedType . isEnum ( ) ) { currentScope . problemReporter ( ) . caseExpressionMustBeConstant ( this . constantExpression ) ; } this . constantExpression . analyseCode ( currentScope , flowContext , flowInfo ) ; } return flowInfo ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) ; if ( this . constantExpression == null ) { output . append ( "<STR_LIT>" ) ; } else { output . append ( "<STR_LIT>" ) ; this . constantExpression . printExpression ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; } return output ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; this . targetLabel . place ( ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding switchExpressionType , SwitchStatement switchStatement ) { scope . enclosingCase = this ; if ( this . constantExpression == null ) { if ( switchStatement . defaultCase != null ) scope . problemReporter ( ) . duplicateDefaultCase ( this ) ; switchStatement . defaultCase = this ; return Constant . NotAConstant ; } switchStatement . cases [ switchStatement . caseCount ++ ] = this ; if ( switchExpressionType != null && switchExpressionType . isEnum ( ) && ( this . constantExpression instanceof SingleNameReference ) ) { ( ( SingleNameReference ) this . constantExpression ) . setActualReceiverType ( ( ReferenceBinding ) switchExpressionType ) ; } TypeBinding caseType = this . constantExpression . resolveType ( scope ) ; if ( caseType == null || switchExpressionType == null ) return Constant . NotAConstant ; if ( this . constantExpression . isConstantValueOfTypeAssignableToType ( caseType , switchExpressionType ) || caseType . isCompatibleWith ( switchExpressionType ) ) { if ( caseType . isEnum ( ) ) { if ( ( ( this . constantExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . enumConstantsCannotBeSurroundedByParenthesis ( this . constantExpression ) ; } if ( this . constantExpression instanceof NameReference && ( this . constantExpression . bits & ASTNode . RestrictiveFlagMASK ) == Binding . FIELD ) { NameReference reference = ( NameReference ) this . constantExpression ; FieldBinding field = reference . fieldBinding ( ) ; if ( ( field . modifiers & ClassFileConstants . AccEnum ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . enumSwitchCannotTargetField ( reference , field ) ; } else if ( reference instanceof QualifiedNameReference ) { scope . problemReporter ( ) . cannotUseQualifiedEnumConstantInCaseLabel ( reference , field ) ; } return IntConstant . fromValue ( field . original ( ) . id + <NUM_LIT:1> ) ; } } else { return this . constantExpression . constant ; } } else if ( isBoxingCompatible ( caseType , switchExpressionType , this . constantExpression , scope ) ) { return this . constantExpression . constant ; } scope . problemReporter ( ) . typeMismatchError ( caseType , switchExpressionType , this . constantExpression , switchStatement . expression ) ; return Constant . NotAConstant ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . constantExpression != null ) this . constantExpression . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class JavadocArraySingleTypeReference extends ArrayTypeReference { public JavadocArraySingleTypeReference ( char [ ] name , int dim , long pos ) { super ( name , dim , pos ) ; this . bits |= InsideJavadoc ; } protected void reportInvalidType ( Scope scope ) { scope . problemReporter ( ) . javadocInvalidType ( this , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { scope . problemReporter ( ) . javadocDeprecatedType ( type , this , scope . getDeclarationModifiers ( ) ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; public class ArrayQualifiedTypeReference extends QualifiedTypeReference { int dimensions ; public ArrayQualifiedTypeReference ( char [ ] [ ] sources , int dim , long [ ] poss ) { super ( sources , poss ) ; this . dimensions = dim ; } public int dimensions ( ) { return this . dimensions ; } public char [ ] [ ] getParameterizedTypeName ( ) { int dim = this . dimensions ; char [ ] dimChars = new char [ dim * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < dim ; i ++ ) { int index = i * <NUM_LIT:2> ; dimChars [ index ] = '<CHAR_LIT:[>' ; dimChars [ index + <NUM_LIT:1> ] = '<CHAR_LIT:]>' ; } int length = this . tokens . length ; char [ ] [ ] qParamName = new char [ length ] [ ] ; System . arraycopy ( this . tokens , <NUM_LIT:0> , qParamName , <NUM_LIT:0> , length - <NUM_LIT:1> ) ; qParamName [ length - <NUM_LIT:1> ] = CharOperation . concat ( this . tokens [ length - <NUM_LIT:1> ] , dimChars ) ; return qParamName ; } protected TypeBinding getTypeBinding ( Scope scope ) { if ( this . resolvedType != null ) return this . resolvedType ; if ( this . dimensions > <NUM_LIT:255> ) { scope . problemReporter ( ) . tooManyDimensions ( this ) ; } LookupEnvironment env = scope . environment ( ) ; try { env . missingClassFileLocation = this ; TypeBinding leafComponentType = super . getTypeBinding ( scope ) ; if ( leafComponentType != null ) { return this . resolvedType = scope . createArrayType ( leafComponentType , this . dimensions ) ; } return null ; } catch ( AbortCompilation e ) { e . updateContext ( this , scope . referenceCompilationUnit ( ) . compilationResult ) ; throw e ; } finally { env . missingClassFileLocation = null ; } } public StringBuffer printExpression ( int indent , StringBuffer output ) { super . printExpression ( indent , output ) ; if ( ( this . bits & IsVarArgs ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . dimensions - <NUM_LIT:1> ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } output . append ( "<STR_LIT:...>" ) ; } else { for ( int i = <NUM_LIT:0> ; i < this . dimensions ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } } return output ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class SingleMemberAnnotation extends Annotation { public Expression memberValue ; private MemberValuePair [ ] singlePairs ; public SingleMemberAnnotation ( TypeReference type , int sourceStart ) { this . type = type ; this . sourceStart = sourceStart ; this . sourceEnd = type . sourceEnd ; } public ElementValuePair [ ] computeElementValuePairs ( ) { return new ElementValuePair [ ] { memberValuePairs ( ) [ <NUM_LIT:0> ] . compilerElementPair } ; } public MemberValuePair [ ] memberValuePairs ( ) { if ( this . singlePairs == null ) { this . singlePairs = new MemberValuePair [ ] { new MemberValuePair ( VALUE , this . memberValue . sourceStart , this . memberValue . sourceEnd , this . memberValue ) } ; } return this . singlePairs ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { super . printExpression ( indent , output ) ; output . append ( '<CHAR_LIT:(>' ) ; this . memberValue . printExpression ( indent , output ) ; return output . append ( '<CHAR_LIT:)>' ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . memberValue != null ) { this . memberValue . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ArrayInitializer extends Expression { public Expression [ ] expressions ; public ArrayBinding binding ; public ArrayInitializer ( ) { super ( ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . expressions != null ) { boolean analyseResources = currentScope . compilerOptions ( ) . analyseResourceLeaks ; for ( int i = <NUM_LIT:0> , max = this . expressions . length ; i < max ; i ++ ) { flowInfo = this . expressions [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; if ( analyseResources && FakedTrackingVariable . isAnyCloseable ( this . expressions [ i ] . resolvedType ) ) { flowInfo = FakedTrackingVariable . markPassedToOutside ( currentScope , this . expressions [ i ] , flowInfo , false ) ; } } } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; int expressionLength = ( this . expressions == null ) ? <NUM_LIT:0> : this . expressions . length ; codeStream . generateInlinedValue ( expressionLength ) ; codeStream . newArray ( this . binding ) ; if ( this . expressions != null ) { int elementsTypeID = this . binding . dimensions > <NUM_LIT:1> ? - <NUM_LIT:1> : this . binding . leafComponentType . id ; for ( int i = <NUM_LIT:0> ; i < expressionLength ; i ++ ) { Expression expr ; if ( ( expr = this . expressions [ i ] ) . constant != Constant . NotAConstant ) { switch ( elementsTypeID ) { case T_int : case T_short : case T_byte : case T_char : case T_long : if ( expr . constant . longValue ( ) != <NUM_LIT:0> ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } break ; case T_float : case T_double : double constantValue = expr . constant . doubleValue ( ) ; if ( constantValue == - <NUM_LIT:0.0> || constantValue != <NUM_LIT:0> ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } break ; case T_boolean : if ( expr . constant . booleanValue ( ) != false ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } break ; default : if ( ! ( expr instanceof NullLiteral ) ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } } else if ( ! ( expr instanceof NullLiteral ) ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { codeStream . pop ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( '<CHAR_LIT>' ) ; if ( this . expressions != null ) { int j = <NUM_LIT:20> ; for ( int i = <NUM_LIT:0> ; i < this . expressions . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . expressions [ i ] . printExpression ( <NUM_LIT:0> , output ) ; j -- ; if ( j == <NUM_LIT:0> ) { output . append ( '<STR_LIT:\n>' ) ; printIndent ( indent + <NUM_LIT:1> , output ) ; j = <NUM_LIT:20> ; } } } return output . append ( '<CHAR_LIT:}>' ) ; } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { this . constant = Constant . NotAConstant ; if ( expectedType instanceof ArrayBinding ) { if ( ( this . bits & IsAnnotationDefaultValue ) == <NUM_LIT:0> ) { TypeBinding leafComponentType = expectedType . leafComponentType ( ) ; if ( ! leafComponentType . isReifiable ( ) ) { scope . problemReporter ( ) . illegalGenericArray ( leafComponentType , this ) ; } } this . resolvedType = this . binding = ( ArrayBinding ) expectedType ; if ( this . expressions == null ) return this . binding ; TypeBinding elementType = this . binding . elementsType ( ) ; for ( int i = <NUM_LIT:0> , length = this . expressions . length ; i < length ; i ++ ) { Expression expression = this . expressions [ i ] ; expression . setExpectedType ( elementType ) ; TypeBinding expressionType = expression instanceof ArrayInitializer ? expression . resolveTypeExpecting ( scope , elementType ) : expression . resolveType ( scope ) ; if ( expressionType == null ) continue ; if ( elementType != expressionType ) scope . compilationUnitScope ( ) . recordTypeConversion ( elementType , expressionType ) ; if ( expression . isConstantValueOfTypeAssignableToType ( expressionType , elementType ) || expressionType . isCompatibleWith ( elementType ) ) { expression . computeConversion ( scope , elementType , expressionType ) ; } else if ( isBoxingCompatible ( expressionType , elementType , expression , scope ) ) { expression . computeConversion ( scope , elementType , expressionType ) ; } else { scope . problemReporter ( ) . typeMismatchError ( expressionType , elementType , expression , null ) ; } } return this . binding ; } TypeBinding leafElementType = null ; int dim = <NUM_LIT:1> ; if ( this . expressions == null ) { leafElementType = scope . getJavaLangObject ( ) ; } else { Expression expression = this . expressions [ <NUM_LIT:0> ] ; while ( expression != null && expression instanceof ArrayInitializer ) { dim ++ ; Expression [ ] subExprs = ( ( ArrayInitializer ) expression ) . expressions ; if ( subExprs == null ) { leafElementType = scope . getJavaLangObject ( ) ; expression = null ; break ; } expression = ( ( ArrayInitializer ) expression ) . expressions [ <NUM_LIT:0> ] ; } if ( expression != null ) { leafElementType = expression . resolveType ( scope ) ; } for ( int i = <NUM_LIT:1> , length = this . expressions . length ; i < length ; i ++ ) { expression = this . expressions [ i ] ; if ( expression != null ) { expression . resolveType ( scope ) ; } } } if ( leafElementType != null ) { this . resolvedType = scope . createArrayType ( leafElementType , dim ) ; if ( expectedType != null ) scope . problemReporter ( ) . typeMismatchError ( this . resolvedType , expectedType , this , null ) ; } return null ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . expressions != null ) { int expressionsLength = this . expressions . length ; for ( int i = <NUM_LIT:0> ; i < expressionsLength ; i ++ ) this . expressions [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ArrayAllocationExpression extends Expression { public TypeReference type ; public Expression [ ] dimensions ; public ArrayInitializer initializer ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { for ( int i = <NUM_LIT:0> , max = this . dimensions . length ; i < max ; i ++ ) { Expression dim ; if ( ( dim = this . dimensions [ i ] ) != null ) { flowInfo = dim . analyseCode ( currentScope , flowContext , flowInfo ) ; if ( ( dim . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { dim . checkNPE ( currentScope , flowContext , flowInfo ) ; } } } if ( this . initializer != null ) { return this . initializer . analyseCode ( currentScope , flowContext , flowInfo ) ; } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . initializer != null ) { this . initializer . generateCode ( currentScope , codeStream , valueRequired ) ; return ; } int explicitDimCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = this . dimensions . length ; i < max ; i ++ ) { Expression dimExpression ; if ( ( dimExpression = this . dimensions [ i ] ) == null ) break ; dimExpression . generateCode ( currentScope , codeStream , true ) ; explicitDimCount ++ ; } if ( explicitDimCount == <NUM_LIT:1> ) { codeStream . newArray ( ( ArrayBinding ) this . resolvedType ) ; } else { codeStream . multianewarray ( this . resolvedType , explicitDimCount ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { codeStream . pop ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( "<STR_LIT>" ) ; this . type . print ( <NUM_LIT:0> , output ) ; for ( int i = <NUM_LIT:0> ; i < this . dimensions . length ; i ++ ) { if ( this . dimensions [ i ] == null ) output . append ( "<STR_LIT:[]>" ) ; else { output . append ( '<CHAR_LIT:[>' ) ; this . dimensions [ i ] . printExpression ( <NUM_LIT:0> , output ) ; output . append ( '<CHAR_LIT:]>' ) ; } } if ( this . initializer != null ) this . initializer . printExpression ( <NUM_LIT:0> , output ) ; return output ; } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding referenceType = this . type . resolveType ( scope , true ) ; this . constant = Constant . NotAConstant ; if ( referenceType == TypeBinding . VOID ) { scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; referenceType = null ; } int explicitDimIndex = - <NUM_LIT:1> ; loop : for ( int i = this . dimensions . length ; -- i >= <NUM_LIT:0> ; ) { if ( this . dimensions [ i ] != null ) { if ( explicitDimIndex < <NUM_LIT:0> ) explicitDimIndex = i ; } else if ( explicitDimIndex > <NUM_LIT:0> ) { scope . problemReporter ( ) . incorrectLocationForNonEmptyDimension ( this , explicitDimIndex ) ; break loop ; } } if ( this . initializer == null ) { if ( explicitDimIndex < <NUM_LIT:0> ) { scope . problemReporter ( ) . mustDefineDimensionsOrInitializer ( this ) ; } if ( referenceType != null && ! referenceType . isReifiable ( ) ) { scope . problemReporter ( ) . illegalGenericArray ( referenceType , this ) ; } } else if ( explicitDimIndex >= <NUM_LIT:0> ) { scope . problemReporter ( ) . cannotDefineDimensionsAndInitializer ( this ) ; } for ( int i = <NUM_LIT:0> ; i <= explicitDimIndex ; i ++ ) { Expression dimExpression ; if ( ( dimExpression = this . dimensions [ i ] ) != null ) { TypeBinding dimensionType = dimExpression . resolveTypeExpecting ( scope , TypeBinding . INT ) ; if ( dimensionType != null ) { this . dimensions [ i ] . computeConversion ( scope , TypeBinding . INT , dimensionType ) ; } } } if ( referenceType != null ) { if ( this . dimensions . length > <NUM_LIT:255> ) { scope . problemReporter ( ) . tooManyDimensions ( this ) ; } this . resolvedType = scope . createArrayType ( referenceType , this . dimensions . length ) ; if ( this . initializer != null ) { if ( ( this . initializer . resolveTypeExpecting ( scope , this . resolvedType ) ) != null ) this . initializer . binding = ( ArrayBinding ) this . resolvedType ; } if ( ( referenceType . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { return null ; } } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { int dimensionsLength = this . dimensions . length ; this . type . traverse ( visitor , scope ) ; for ( int i = <NUM_LIT:0> ; i < dimensionsLength ; i ++ ) { if ( this . dimensions [ i ] != null ) this . dimensions [ i ] . traverse ( visitor , scope ) ; } if ( this . initializer != null ) this . initializer . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocAllocationExpression extends AllocationExpression { public int tagSourceStart , tagSourceEnd ; public int tagValue , memberStart ; public char [ ] [ ] qualification ; public JavadocAllocationExpression ( int start , int end ) { this . sourceStart = start ; this . sourceEnd = end ; this . bits |= InsideJavadoc ; } public JavadocAllocationExpression ( long pos ) { this ( ( int ) ( pos > > > <NUM_LIT:32> ) , ( int ) pos ) ; } TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( this . type == null ) { this . resolvedType = scope . enclosingSourceType ( ) ; } else if ( scope . kind == Scope . CLASS_SCOPE ) { this . resolvedType = this . type . resolveType ( ( ClassScope ) scope ) ; } else { this . resolvedType = this . type . resolveType ( ( BlockScope ) scope , true ) ; } TypeBinding [ ] argumentTypes = Binding . NO_PARAMETERS ; boolean hasTypeVarArgs = false ; if ( this . arguments != null ) { boolean argHasError = false ; int length = this . arguments . length ; argumentTypes = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = this . arguments [ i ] ; if ( scope . kind == Scope . CLASS_SCOPE ) { argumentTypes [ i ] = argument . resolveType ( ( ClassScope ) scope ) ; } else { argumentTypes [ i ] = argument . resolveType ( ( BlockScope ) scope ) ; } if ( argumentTypes [ i ] == null ) { argHasError = true ; } else if ( ! hasTypeVarArgs ) { hasTypeVarArgs = argumentTypes [ i ] . isTypeVariable ( ) ; } } if ( argHasError ) { return null ; } } if ( this . resolvedType == null ) { return null ; } this . resolvedType = scope . environment ( ) . convertToRawType ( this . type . resolvedType , true ) ; SourceTypeBinding enclosingType = scope . enclosingSourceType ( ) ; if ( enclosingType == null ? false : enclosingType . isCompatibleWith ( this . resolvedType ) ) { this . bits |= ASTNode . SuperAccess ; } ReferenceBinding allocationType = ( ReferenceBinding ) this . resolvedType ; this . binding = scope . getConstructor ( allocationType , argumentTypes , this ) ; if ( ! this . binding . isValidBinding ( ) ) { ReferenceBinding enclosingTypeBinding = allocationType ; MethodBinding contructorBinding = this . binding ; while ( ! contructorBinding . isValidBinding ( ) && ( enclosingTypeBinding . isMemberType ( ) || enclosingTypeBinding . isLocalType ( ) ) ) { enclosingTypeBinding = enclosingTypeBinding . enclosingType ( ) ; contructorBinding = scope . getConstructor ( enclosingTypeBinding , argumentTypes , this ) ; } if ( contructorBinding . isValidBinding ( ) ) { this . binding = contructorBinding ; } } if ( ! this . binding . isValidBinding ( ) ) { MethodBinding methodBinding = scope . getMethod ( this . resolvedType , this . resolvedType . sourceName ( ) , argumentTypes , this ) ; if ( methodBinding . isValidBinding ( ) ) { this . binding = methodBinding ; } else { if ( this . binding . declaringClass == null ) { this . binding . declaringClass = allocationType ; } scope . problemReporter ( ) . javadocInvalidConstructor ( this , this . binding , scope . getDeclarationModifiers ( ) ) ; } return this . resolvedType ; } else if ( this . binding . isVarargs ( ) ) { int length = argumentTypes . length ; if ( ! ( this . binding . parameters . length == length && argumentTypes [ length - <NUM_LIT:1> ] . isArrayType ( ) ) ) { MethodBinding problem = new ProblemMethodBinding ( this . binding , this . binding . selector , argumentTypes , ProblemReasons . NotFound ) ; scope . problemReporter ( ) . javadocInvalidConstructor ( this , problem , scope . getDeclarationModifiers ( ) ) ; } } else if ( hasTypeVarArgs ) { MethodBinding problem = new ProblemMethodBinding ( this . binding , this . binding . selector , argumentTypes , ProblemReasons . NotFound ) ; scope . problemReporter ( ) . javadocInvalidConstructor ( this , problem , scope . getDeclarationModifiers ( ) ) ; } else if ( this . binding instanceof ParameterizedMethodBinding ) { ParameterizedMethodBinding paramMethodBinding = ( ParameterizedMethodBinding ) this . binding ; if ( paramMethodBinding . hasSubstitutedParameters ( ) ) { int length = argumentTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( paramMethodBinding . parameters [ i ] != argumentTypes [ i ] && paramMethodBinding . parameters [ i ] . erasure ( ) != argumentTypes [ i ] . erasure ( ) ) { MethodBinding problem = new ProblemMethodBinding ( this . binding , this . binding . selector , argumentTypes , ProblemReasons . NotFound ) ; scope . problemReporter ( ) . javadocInvalidConstructor ( this , problem , scope . getDeclarationModifiers ( ) ) ; break ; } } } } else if ( this . resolvedType . isMemberType ( ) ) { int length = this . qualification . length ; if ( length > <NUM_LIT:1> ) { ReferenceBinding enclosingTypeBinding = allocationType ; if ( this . type instanceof JavadocQualifiedTypeReference && ( ( JavadocQualifiedTypeReference ) this . type ) . tokens . length != length ) { scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( this . memberStart + <NUM_LIT:1> , this . sourceEnd , scope . getDeclarationModifiers ( ) ) ; } else { int idx = length ; while ( idx > <NUM_LIT:0> && CharOperation . equals ( this . qualification [ -- idx ] , enclosingTypeBinding . sourceName ) && ( enclosingTypeBinding = enclosingTypeBinding . enclosingType ( ) ) != null ) { } if ( idx > <NUM_LIT:0> || enclosingTypeBinding != null ) { scope . problemReporter ( ) . javadocInvalidMemberTypeQualification ( this . memberStart + <NUM_LIT:1> , this . sourceEnd , scope . getDeclarationModifiers ( ) ) ; } } } } if ( isMethodUseDeprecated ( this . binding , scope , true ) ) { scope . problemReporter ( ) . javadocDeprecatedMethod ( this . binding , this , scope . getDeclarationModifiers ( ) ) ; } return allocationType ; } public boolean isSuperAccess ( ) { return ( this . bits & ASTNode . SuperAccess ) != <NUM_LIT:0> ; } public TypeBinding resolveType ( BlockScope scope ) { return internalResolveType ( scope ) ; } public TypeBinding resolveType ( ClassScope scope ) { return internalResolveType ( scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . typeArguments != null ) { for ( int i = <NUM_LIT:0> , typeArgumentsLength = this . typeArguments . length ; i < typeArgumentsLength ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , scope ) ; } } if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , argumentsLength = this . arguments . length ; i < argumentsLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . typeArguments != null ) { for ( int i = <NUM_LIT:0> , typeArgumentsLength = this . typeArguments . length ; i < typeArgumentsLength ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , scope ) ; } } if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , argumentsLength = this . arguments . length ; i < argumentsLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; public interface OperatorIds { public static final int AND_AND = <NUM_LIT:0> ; public static final int OR_OR = <NUM_LIT:1> ; public static final int AND = <NUM_LIT:2> ; public static final int OR = <NUM_LIT:3> ; public static final int LESS = <NUM_LIT:4> ; public static final int LESS_EQUAL = <NUM_LIT:5> ; public static final int GREATER = <NUM_LIT:6> ; public static final int GREATER_EQUAL = <NUM_LIT:7> ; public static final int XOR = <NUM_LIT:8> ; public static final int DIVIDE = <NUM_LIT:9> ; public static final int LEFT_SHIFT = <NUM_LIT:10> ; public static final int NOT = <NUM_LIT:11> ; public static final int TWIDDLE = <NUM_LIT:12> ; public static final int MINUS = <NUM_LIT> ; public static final int PLUS = <NUM_LIT> ; public static final int MULTIPLY = <NUM_LIT:15> ; public static final int REMAINDER = <NUM_LIT:16> ; public static final int RIGHT_SHIFT = <NUM_LIT> ; public static final int EQUAL_EQUAL = <NUM_LIT> ; public static final int UNSIGNED_RIGHT_SHIFT = <NUM_LIT> ; public static final int NumberOfTables = <NUM_LIT:20> ; public static final int QUESTIONCOLON = <NUM_LIT> ; public static final int NOT_EQUAL = <NUM_LIT> ; public static final int EQUAL = <NUM_LIT:30> ; public static final int INSTANCEOF = <NUM_LIT:31> ; public static final int PLUS_PLUS = <NUM_LIT:32> ; public static final int MINUS_MINUS = <NUM_LIT> ; } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class PostfixExpression extends CompoundAssignment { public PostfixExpression ( Expression lhs , Expression expression , int operator , int pos ) { super ( lhs , expression , operator , pos ) ; this . sourceStart = lhs . sourceStart ; this . sourceEnd = pos ; } public boolean checkCastCompatibility ( ) { return false ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; ( ( Reference ) this . lhs ) . generatePostIncrement ( currentScope , codeStream , this , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public String operatorToString ( ) { switch ( this . operator ) { case PLUS : return "<STR_LIT>" ; case MINUS : return "<STR_LIT:-->" ; } return "<STR_LIT>" ; } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { return this . lhs . printExpression ( indent , output ) . append ( '<CHAR_LIT:U+0020>' ) . append ( operatorToString ( ) ) ; } public boolean restrainUsageToNumericTypes ( ) { return true ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . lhs . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocMessageSend extends MessageSend { public int tagSourceStart , tagSourceEnd ; public int tagValue ; public JavadocMessageSend ( char [ ] name , long pos ) { this . selector = name ; this . nameSourcePosition = pos ; this . sourceStart = ( int ) ( this . nameSourcePosition > > > <NUM_LIT:32> ) ; this . sourceEnd = ( int ) this . nameSourcePosition ; this . bits |= InsideJavadoc ; } public JavadocMessageSend ( char [ ] name , long pos , JavadocArgumentExpression [ ] arguments ) { this ( name , pos ) ; this . arguments = arguments ; } private TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( this . receiver == null ) { this . actualReceiverType = scope . enclosingReceiverType ( ) ; } else if ( scope . kind == Scope . CLASS_SCOPE ) { this . actualReceiverType = this . receiver . resolveType ( ( ClassScope ) scope ) ; } else { this . actualReceiverType = this . receiver . resolveType ( ( BlockScope ) scope ) ; } TypeBinding [ ] argumentTypes = Binding . NO_PARAMETERS ; boolean hasArgsTypeVar = false ; if ( this . arguments != null ) { boolean argHasError = false ; int length = this . arguments . length ; argumentTypes = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = this . arguments [ i ] ; if ( scope . kind == Scope . CLASS_SCOPE ) { argumentTypes [ i ] = argument . resolveType ( ( ClassScope ) scope ) ; } else { argumentTypes [ i ] = argument . resolveType ( ( BlockScope ) scope ) ; } if ( argumentTypes [ i ] == null ) { argHasError = true ; } else if ( ! hasArgsTypeVar ) { hasArgsTypeVar = argumentTypes [ i ] . isTypeVariable ( ) ; } } if ( argHasError ) { return null ; } } if ( this . actualReceiverType == null ) { return null ; } this . actualReceiverType = scope . environment ( ) . convertToRawType ( this . receiver . resolvedType , true ) ; ReferenceBinding enclosingType = scope . enclosingReceiverType ( ) ; if ( enclosingType == null ? false : enclosingType . isCompatibleWith ( this . actualReceiverType ) ) { this . bits |= ASTNode . SuperAccess ; } if ( this . actualReceiverType . isBaseType ( ) ) { scope . problemReporter ( ) . javadocErrorNoMethodFor ( this , this . actualReceiverType , argumentTypes , scope . getDeclarationModifiers ( ) ) ; return null ; } this . binding = scope . getMethod ( this . actualReceiverType , this . selector , argumentTypes , this ) ; if ( ! this . binding . isValidBinding ( ) ) { TypeBinding enclosingTypeBinding = this . actualReceiverType ; MethodBinding methodBinding = this . binding ; while ( ! methodBinding . isValidBinding ( ) && ( enclosingTypeBinding . isMemberType ( ) || enclosingTypeBinding . isLocalType ( ) ) ) { enclosingTypeBinding = enclosingTypeBinding . enclosingType ( ) ; methodBinding = scope . getMethod ( enclosingTypeBinding , this . selector , argumentTypes , this ) ; } if ( methodBinding . isValidBinding ( ) ) { this . binding = methodBinding ; } else { enclosingTypeBinding = this . actualReceiverType ; MethodBinding contructorBinding = this . binding ; while ( ! contructorBinding . isValidBinding ( ) && ( enclosingTypeBinding . isMemberType ( ) || enclosingTypeBinding . isLocalType ( ) ) ) { enclosingTypeBinding = enclosingTypeBinding . enclosingType ( ) ; if ( CharOperation . equals ( this . selector , enclosingTypeBinding . shortReadableName ( ) ) ) { contructorBinding = scope . getConstructor ( ( ReferenceBinding ) enclosingTypeBinding , argumentTypes , this ) ; } } if ( contructorBinding . isValidBinding ( ) ) { this . binding = contructorBinding ; } } } if ( ! this . binding . isValidBinding ( ) ) { switch ( this . binding . problemId ( ) ) { case ProblemReasons . NonStaticReferenceInConstructorInvocation : case ProblemReasons . NonStaticReferenceInStaticContext : case ProblemReasons . InheritedNameHidesEnclosingName : case ProblemReasons . Ambiguous : MethodBinding closestMatch = ( ( ProblemMethodBinding ) this . binding ) . closestMatch ; if ( closestMatch != null ) { this . binding = closestMatch ; } } } if ( ! this . binding . isValidBinding ( ) ) { if ( this . receiver . resolvedType instanceof ProblemReferenceBinding ) { return null ; } if ( this . binding . declaringClass == null ) { if ( this . actualReceiverType instanceof ReferenceBinding ) { this . binding . declaringClass = ( ReferenceBinding ) this . actualReceiverType ; } else { scope . problemReporter ( ) . javadocErrorNoMethodFor ( this , this . actualReceiverType , argumentTypes , scope . getDeclarationModifiers ( ) ) ; return null ; } } scope . problemReporter ( ) . javadocInvalidMethod ( this , this . binding , scope . getDeclarationModifiers ( ) ) ; if ( this . binding instanceof ProblemMethodBinding ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) this . binding ) . closestMatch ; if ( closestMatch != null ) this . binding = closestMatch ; } return this . resolvedType = this . binding == null ? null : this . binding . returnType ; } else if ( hasArgsTypeVar ) { MethodBinding problem = new ProblemMethodBinding ( this . binding , this . selector , argumentTypes , ProblemReasons . NotFound ) ; scope . problemReporter ( ) . javadocInvalidMethod ( this , problem , scope . getDeclarationModifiers ( ) ) ; } else if ( this . binding . isVarargs ( ) ) { int length = argumentTypes . length ; if ( ! ( this . binding . parameters . length == length && argumentTypes [ length - <NUM_LIT:1> ] . isArrayType ( ) ) ) { MethodBinding problem = new ProblemMethodBinding ( this . binding , this . selector , argumentTypes , ProblemReasons . NotFound ) ; scope . problemReporter ( ) . javadocInvalidMethod ( this , problem , scope . getDeclarationModifiers ( ) ) ; } } else { int length = argumentTypes . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( this . binding . parameters [ i ] . erasure ( ) != argumentTypes [ i ] . erasure ( ) ) { MethodBinding problem = new ProblemMethodBinding ( this . binding , this . selector , argumentTypes , ProblemReasons . NotFound ) ; scope . problemReporter ( ) . javadocInvalidMethod ( this , problem , scope . getDeclarationModifiers ( ) ) ; break ; } } } if ( isMethodUseDeprecated ( this . binding , scope , true ) ) { scope . problemReporter ( ) . javadocDeprecatedMethod ( this . binding , this , scope . getDeclarationModifiers ( ) ) ; } return this . resolvedType = this . binding . returnType ; } public boolean isSuperAccess ( ) { return ( this . bits & ASTNode . SuperAccess ) != <NUM_LIT:0> ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { if ( this . receiver != null ) { this . receiver . printExpression ( <NUM_LIT:0> , output ) ; } output . append ( '<CHAR_LIT>' ) . append ( this . selector ) . append ( '<CHAR_LIT:(>' ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> ; i < this . arguments . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . arguments [ i ] . printExpression ( <NUM_LIT:0> , output ) ; } } return output . append ( '<CHAR_LIT:)>' ) ; } public TypeBinding resolveType ( BlockScope scope ) { return internalResolveType ( scope ) ; } public TypeBinding resolveType ( ClassScope scope ) { return internalResolveType ( scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . receiver != null ) { this . receiver . traverse ( visitor , blockScope ) ; } if ( this . arguments != null ) { int argumentsLength = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , blockScope ) ; } } visitor . endVisit ( this , blockScope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . receiver != null ) { this . receiver . traverse ( visitor , scope ) ; } if ( this . arguments != null ) { int argumentsLength = this . arguments . length ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ; public class TypeParameter extends AbstractVariableDeclaration { public TypeVariableBinding binding ; public TypeReference [ ] bounds ; public int getKind ( ) { return TYPE_PARAMETER ; } public void checkBounds ( Scope scope ) { if ( this . type != null ) { this . type . checkBounds ( scope ) ; } if ( this . bounds != null ) { for ( int i = <NUM_LIT:0> , length = this . bounds . length ; i < length ; i ++ ) { this . bounds [ i ] . checkBounds ( scope ) ; } } } private void internalResolve ( Scope scope , boolean staticContext ) { if ( this . binding != null ) { Binding existingType = scope . parent . getBinding ( this . name , Binding . TYPE , this , false ) ; if ( existingType != null && this . binding != existingType && existingType . isValidBinding ( ) && ( existingType . kind ( ) != Binding . TYPE_PARAMETER || ! staticContext ) ) { scope . problemReporter ( ) . typeHiding ( this , existingType ) ; } } } public void resolve ( BlockScope scope ) { internalResolve ( scope , scope . methodScope ( ) . isStatic ) ; } public void resolve ( ClassScope scope ) { internalResolve ( scope , scope . enclosingSourceType ( ) . isStatic ( ) ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { output . append ( this . name ) ; if ( this . type != null ) { output . append ( "<STR_LIT>" ) ; this . type . print ( <NUM_LIT:0> , output ) ; } if ( this . bounds != null ) { for ( int i = <NUM_LIT:0> ; i < this . bounds . length ; i ++ ) { output . append ( "<STR_LIT>" ) ; this . bounds [ i ] . print ( <NUM_LIT:0> , output ) ; } } return output ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . bounds != null ) { int boundsLength = this . bounds . length ; for ( int i = <NUM_LIT:0> ; i < boundsLength ; i ++ ) { this . bounds [ i ] . traverse ( visitor , scope ) ; } } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . bounds != null ) { int boundsLength = this . bounds . length ; for ( int i = <NUM_LIT:0> ; i < boundsLength ; i ++ ) { this . bounds [ i ] . traverse ( visitor , scope ) ; } } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ConditionalExpression extends OperatorExpression { public Expression condition , valueIfTrue , valueIfFalse ; public Constant optimizedBooleanConstant ; public Constant optimizedIfTrueConstant ; public Constant optimizedIfFalseConstant ; int trueInitStateIndex = - <NUM_LIT:1> ; int falseInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; private int nullStatus = FlowInfo . UNKNOWN ; public ConditionalExpression ( Expression condition , Expression valueIfTrue , Expression valueIfFalse ) { this . condition = condition ; this . valueIfTrue = valueIfTrue ; this . valueIfFalse = valueIfFalse ; this . sourceStart = condition . sourceStart ; this . sourceEnd = valueIfFalse . sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { int initialComplaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; Constant cst = this . condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedTrue = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isConditionOptimizedFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; int mode = flowInfo . reachMode ( ) ; flowInfo = this . condition . analyseCode ( currentScope , flowContext , flowInfo , cst == Constant . NotAConstant ) ; FlowInfo trueFlowInfo = flowInfo . initsWhenTrue ( ) . copy ( ) ; if ( isConditionOptimizedFalse ) { if ( ( mode & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { trueFlowInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( ! isKnowDeadCodePattern ( this . condition ) || currentScope . compilerOptions ( ) . reportDeadCodeInTrivialIfStatement ) { this . valueIfTrue . complainIfUnreachable ( trueFlowInfo , currentScope , initialComplaintLevel , false ) ; } } this . trueInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( trueFlowInfo ) ; trueFlowInfo = this . valueIfTrue . analyseCode ( currentScope , flowContext , trueFlowInfo ) ; FlowInfo falseFlowInfo = flowInfo . initsWhenFalse ( ) . copy ( ) ; if ( isConditionOptimizedTrue ) { if ( ( mode & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { falseFlowInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( ! isKnowDeadCodePattern ( this . condition ) || currentScope . compilerOptions ( ) . reportDeadCodeInTrivialIfStatement ) { this . valueIfFalse . complainIfUnreachable ( falseFlowInfo , currentScope , initialComplaintLevel , true ) ; } } this . falseInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( falseFlowInfo ) ; falseFlowInfo = this . valueIfFalse . analyseCode ( currentScope , flowContext , falseFlowInfo ) ; FlowInfo mergedInfo ; if ( isConditionOptimizedTrue ) { mergedInfo = trueFlowInfo . addPotentialInitializationsFrom ( falseFlowInfo ) ; this . nullStatus = this . valueIfTrue . nullStatus ( trueFlowInfo ) ; } else if ( isConditionOptimizedFalse ) { mergedInfo = falseFlowInfo . addPotentialInitializationsFrom ( trueFlowInfo ) ; this . nullStatus = this . valueIfFalse . nullStatus ( falseFlowInfo ) ; } else { computeNullStatus ( trueFlowInfo , falseFlowInfo ) ; cst = this . optimizedIfTrueConstant ; boolean isValueIfTrueOptimizedTrue = cst != null && cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isValueIfTrueOptimizedFalse = cst != null && cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; cst = this . optimizedIfFalseConstant ; boolean isValueIfFalseOptimizedTrue = cst != null && cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isValueIfFalseOptimizedFalse = cst != null && cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; UnconditionalFlowInfo trueFlowTowardsTrue = trueFlowInfo . initsWhenTrue ( ) . unconditionalCopy ( ) ; UnconditionalFlowInfo falseFlowTowardsTrue = falseFlowInfo . initsWhenTrue ( ) . unconditionalCopy ( ) ; UnconditionalFlowInfo trueFlowTowardsFalse = trueFlowInfo . initsWhenFalse ( ) . unconditionalInits ( ) ; UnconditionalFlowInfo falseFlowTowardsFalse = falseFlowInfo . initsWhenFalse ( ) . unconditionalInits ( ) ; if ( isValueIfTrueOptimizedFalse ) { trueFlowTowardsTrue . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( isValueIfFalseOptimizedFalse ) { falseFlowTowardsTrue . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( isValueIfTrueOptimizedTrue ) { trueFlowTowardsFalse . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( isValueIfFalseOptimizedTrue ) { falseFlowTowardsFalse . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } mergedInfo = FlowInfo . conditional ( trueFlowTowardsTrue . mergedWith ( falseFlowTowardsTrue ) , trueFlowTowardsFalse . mergedWith ( falseFlowTowardsFalse ) ) ; } this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; mergedInfo . setReachMode ( mode ) ; return mergedInfo ; } private void computeNullStatus ( FlowInfo trueBranchInfo , FlowInfo falseBranchInfo ) { int ifTrueNullStatus = this . valueIfTrue . nullStatus ( trueBranchInfo ) ; int ifFalseNullStatus = this . valueIfFalse . nullStatus ( falseBranchInfo ) ; if ( ifTrueNullStatus == ifFalseNullStatus ) { this . nullStatus = ifTrueNullStatus ; return ; } if ( trueBranchInfo . reachMode ( ) != FlowInfo . REACHABLE ) { this . nullStatus = ifFalseNullStatus ; return ; } if ( falseBranchInfo . reachMode ( ) != FlowInfo . REACHABLE ) { this . nullStatus = ifTrueNullStatus ; return ; } int status = <NUM_LIT:0> ; int combinedStatus = ifTrueNullStatus | ifFalseNullStatus ; if ( ( combinedStatus & ( FlowInfo . NULL | FlowInfo . POTENTIALLY_NULL ) ) != <NUM_LIT:0> ) status |= FlowInfo . POTENTIALLY_NULL ; if ( ( combinedStatus & ( FlowInfo . NON_NULL | FlowInfo . POTENTIALLY_NON_NULL ) ) != <NUM_LIT:0> ) status |= FlowInfo . POTENTIALLY_NON_NULL ; if ( ( combinedStatus & ( FlowInfo . UNKNOWN | FlowInfo . POTENTIALLY_UNKNOWN ) ) != <NUM_LIT:0> ) status |= FlowInfo . POTENTIALLY_UNKNOWN ; if ( status > <NUM_LIT:0> ) this . nullStatus = status ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; BranchLabel endifLabel , falseLabel ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } Constant cst = this . condition . optimizedBooleanConstant ( ) ; boolean needTruePart = ! ( cst != Constant . NotAConstant && cst . booleanValue ( ) == false ) ; boolean needFalsePart = ! ( cst != Constant . NotAConstant && cst . booleanValue ( ) == true ) ; endifLabel = new BranchLabel ( codeStream ) ; falseLabel = new BranchLabel ( codeStream ) ; falseLabel . tagBits |= BranchLabel . USED ; this . condition . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , cst == Constant . NotAConstant ) ; if ( this . trueInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . trueInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . trueInitStateIndex ) ; } if ( needTruePart ) { this . valueIfTrue . generateCode ( currentScope , codeStream , valueRequired ) ; if ( needFalsePart ) { int position = codeStream . position ; codeStream . goto_ ( endifLabel ) ; codeStream . recordPositionsFrom ( position , this . valueIfTrue . sourceEnd ) ; if ( valueRequired ) { switch ( this . resolvedType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . decrStackSize ( <NUM_LIT:2> ) ; break ; default : codeStream . decrStackSize ( <NUM_LIT:1> ) ; break ; } } } } if ( needFalsePart ) { if ( this . falseInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . falseInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . falseInitStateIndex ) ; } if ( falseLabel . forwardReferenceCount ( ) > <NUM_LIT:0> ) { falseLabel . place ( ) ; } this . valueIfFalse . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { codeStream . recordExpressionType ( this . resolvedType ) ; } if ( needTruePart ) { endifLabel . place ( ) ; } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } if ( valueRequired ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int pc = codeStream . position ; if ( ( this . constant != Constant . NotAConstant ) && ( this . constant . typeID ( ) == T_boolean ) || ( ( this . valueIfTrue . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) != T_boolean ) { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } Constant cst = this . condition . constant ; Constant condCst = this . condition . optimizedBooleanConstant ( ) ; boolean needTruePart = ! ( ( ( cst != Constant . NotAConstant ) && ( cst . booleanValue ( ) == false ) ) || ( ( condCst != Constant . NotAConstant ) && ( condCst . booleanValue ( ) == false ) ) ) ; boolean needFalsePart = ! ( ( ( cst != Constant . NotAConstant ) && ( cst . booleanValue ( ) == true ) ) || ( ( condCst != Constant . NotAConstant ) && ( condCst . booleanValue ( ) == true ) ) ) ; BranchLabel internalFalseLabel , endifLabel = new BranchLabel ( codeStream ) ; boolean needConditionValue = ( cst == Constant . NotAConstant ) && ( condCst == Constant . NotAConstant ) ; this . condition . generateOptimizedBoolean ( currentScope , codeStream , null , internalFalseLabel = new BranchLabel ( codeStream ) , needConditionValue ) ; if ( this . trueInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . trueInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . trueInitStateIndex ) ; } if ( needTruePart ) { this . valueIfTrue . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; if ( needFalsePart ) { JumpEndif : { if ( falseLabel == null ) { if ( trueLabel != null ) { cst = this . optimizedIfTrueConstant ; boolean isValueIfTrueOptimizedTrue = cst != null && cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; if ( isValueIfTrueOptimizedTrue ) break JumpEndif ; } } else { if ( trueLabel == null ) { cst = this . optimizedIfTrueConstant ; boolean isValueIfTrueOptimizedFalse = cst != null && cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; if ( isValueIfTrueOptimizedFalse ) break JumpEndif ; } else { } } int position = codeStream . position ; codeStream . goto_ ( endifLabel ) ; codeStream . recordPositionsFrom ( position , this . valueIfTrue . sourceEnd ) ; } } } if ( needFalsePart ) { internalFalseLabel . place ( ) ; if ( this . falseInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . falseInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . falseInitStateIndex ) ; } this . valueIfFalse . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; endifLabel . place ( ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceEnd ) ; } public int nullStatus ( FlowInfo flowInfo ) { return this . nullStatus ; } public Constant optimizedBooleanConstant ( ) { return this . optimizedBooleanConstant == null ? this . constant : this . optimizedBooleanConstant ; } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { this . condition . printExpression ( indent , output ) . append ( "<STR_LIT>" ) ; this . valueIfTrue . printExpression ( <NUM_LIT:0> , output ) . append ( "<STR_LIT:U+0020:U+0020>" ) ; return this . valueIfFalse . printExpression ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; LookupEnvironment env = scope . environment ( ) ; boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; TypeBinding conditionType = this . condition . resolveTypeExpecting ( scope , TypeBinding . BOOLEAN ) ; this . condition . computeConversion ( scope , TypeBinding . BOOLEAN , conditionType ) ; if ( this . valueIfTrue instanceof CastExpression ) this . valueIfTrue . bits |= DisableUnnecessaryCastCheck ; TypeBinding originalValueIfTrueType = this . valueIfTrue . resolveType ( scope ) ; if ( this . valueIfFalse instanceof CastExpression ) this . valueIfFalse . bits |= DisableUnnecessaryCastCheck ; TypeBinding originalValueIfFalseType = this . valueIfFalse . resolveType ( scope ) ; if ( conditionType == null || originalValueIfTrueType == null || originalValueIfFalseType == null ) return null ; TypeBinding valueIfTrueType = originalValueIfTrueType ; TypeBinding valueIfFalseType = originalValueIfFalseType ; if ( use15specifics && valueIfTrueType != valueIfFalseType ) { if ( valueIfTrueType . isBaseType ( ) ) { if ( valueIfFalseType . isBaseType ( ) ) { if ( valueIfTrueType == TypeBinding . NULL ) { valueIfFalseType = env . computeBoxingType ( valueIfFalseType ) ; } else if ( valueIfFalseType == TypeBinding . NULL ) { valueIfTrueType = env . computeBoxingType ( valueIfTrueType ) ; } } else { TypeBinding unboxedIfFalseType = valueIfFalseType . isBaseType ( ) ? valueIfFalseType : env . computeBoxingType ( valueIfFalseType ) ; if ( valueIfTrueType . isNumericType ( ) && unboxedIfFalseType . isNumericType ( ) ) { valueIfFalseType = unboxedIfFalseType ; } else if ( valueIfTrueType != TypeBinding . NULL ) { valueIfFalseType = env . computeBoxingType ( valueIfFalseType ) ; } } } else if ( valueIfFalseType . isBaseType ( ) ) { TypeBinding unboxedIfTrueType = valueIfTrueType . isBaseType ( ) ? valueIfTrueType : env . computeBoxingType ( valueIfTrueType ) ; if ( unboxedIfTrueType . isNumericType ( ) && valueIfFalseType . isNumericType ( ) ) { valueIfTrueType = unboxedIfTrueType ; } else if ( valueIfFalseType != TypeBinding . NULL ) { valueIfTrueType = env . computeBoxingType ( valueIfTrueType ) ; } } else { TypeBinding unboxedIfTrueType = env . computeBoxingType ( valueIfTrueType ) ; TypeBinding unboxedIfFalseType = env . computeBoxingType ( valueIfFalseType ) ; if ( unboxedIfTrueType . isNumericType ( ) && unboxedIfFalseType . isNumericType ( ) ) { valueIfTrueType = unboxedIfTrueType ; valueIfFalseType = unboxedIfFalseType ; } } } Constant condConstant , trueConstant , falseConstant ; if ( ( condConstant = this . condition . constant ) != Constant . NotAConstant && ( trueConstant = this . valueIfTrue . constant ) != Constant . NotAConstant && ( falseConstant = this . valueIfFalse . constant ) != Constant . NotAConstant ) { this . constant = condConstant . booleanValue ( ) ? trueConstant : falseConstant ; } if ( valueIfTrueType == valueIfFalseType ) { this . valueIfTrue . computeConversion ( scope , valueIfTrueType , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , valueIfFalseType , originalValueIfFalseType ) ; if ( valueIfTrueType == TypeBinding . BOOLEAN ) { this . optimizedIfTrueConstant = this . valueIfTrue . optimizedBooleanConstant ( ) ; this . optimizedIfFalseConstant = this . valueIfFalse . optimizedBooleanConstant ( ) ; if ( this . optimizedIfTrueConstant != Constant . NotAConstant && this . optimizedIfFalseConstant != Constant . NotAConstant && this . optimizedIfTrueConstant . booleanValue ( ) == this . optimizedIfFalseConstant . booleanValue ( ) ) { this . optimizedBooleanConstant = this . optimizedIfTrueConstant ; } else if ( ( condConstant = this . condition . optimizedBooleanConstant ( ) ) != Constant . NotAConstant ) { this . optimizedBooleanConstant = condConstant . booleanValue ( ) ? this . optimizedIfTrueConstant : this . optimizedIfFalseConstant ; } } return this . resolvedType = valueIfTrueType ; } if ( valueIfTrueType . isNumericType ( ) && valueIfFalseType . isNumericType ( ) ) { if ( ( valueIfTrueType == TypeBinding . BYTE && valueIfFalseType == TypeBinding . SHORT ) || ( valueIfTrueType == TypeBinding . SHORT && valueIfFalseType == TypeBinding . BYTE ) ) { this . valueIfTrue . computeConversion ( scope , TypeBinding . SHORT , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , TypeBinding . SHORT , originalValueIfFalseType ) ; return this . resolvedType = TypeBinding . SHORT ; } if ( ( valueIfTrueType == TypeBinding . BYTE || valueIfTrueType == TypeBinding . SHORT || valueIfTrueType == TypeBinding . CHAR ) && ( valueIfFalseType == TypeBinding . INT && this . valueIfFalse . isConstantValueOfTypeAssignableToType ( valueIfFalseType , valueIfTrueType ) ) ) { this . valueIfTrue . computeConversion ( scope , valueIfTrueType , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , valueIfTrueType , originalValueIfFalseType ) ; return this . resolvedType = valueIfTrueType ; } if ( ( valueIfFalseType == TypeBinding . BYTE || valueIfFalseType == TypeBinding . SHORT || valueIfFalseType == TypeBinding . CHAR ) && ( valueIfTrueType == TypeBinding . INT && this . valueIfTrue . isConstantValueOfTypeAssignableToType ( valueIfTrueType , valueIfFalseType ) ) ) { this . valueIfTrue . computeConversion ( scope , valueIfFalseType , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , valueIfFalseType , originalValueIfFalseType ) ; return this . resolvedType = valueIfFalseType ; } if ( BaseTypeBinding . isNarrowing ( valueIfTrueType . id , T_int ) && BaseTypeBinding . isNarrowing ( valueIfFalseType . id , T_int ) ) { this . valueIfTrue . computeConversion ( scope , TypeBinding . INT , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , TypeBinding . INT , originalValueIfFalseType ) ; return this . resolvedType = TypeBinding . INT ; } if ( BaseTypeBinding . isNarrowing ( valueIfTrueType . id , T_long ) && BaseTypeBinding . isNarrowing ( valueIfFalseType . id , T_long ) ) { this . valueIfTrue . computeConversion ( scope , TypeBinding . LONG , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , TypeBinding . LONG , originalValueIfFalseType ) ; return this . resolvedType = TypeBinding . LONG ; } if ( BaseTypeBinding . isNarrowing ( valueIfTrueType . id , T_float ) && BaseTypeBinding . isNarrowing ( valueIfFalseType . id , T_float ) ) { this . valueIfTrue . computeConversion ( scope , TypeBinding . FLOAT , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , TypeBinding . FLOAT , originalValueIfFalseType ) ; return this . resolvedType = TypeBinding . FLOAT ; } this . valueIfTrue . computeConversion ( scope , TypeBinding . DOUBLE , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , TypeBinding . DOUBLE , originalValueIfFalseType ) ; return this . resolvedType = TypeBinding . DOUBLE ; } if ( valueIfTrueType . isBaseType ( ) && valueIfTrueType != TypeBinding . NULL ) { if ( use15specifics ) { valueIfTrueType = env . computeBoxingType ( valueIfTrueType ) ; } else { scope . problemReporter ( ) . conditionalArgumentsIncompatibleTypes ( this , valueIfTrueType , valueIfFalseType ) ; return null ; } } if ( valueIfFalseType . isBaseType ( ) && valueIfFalseType != TypeBinding . NULL ) { if ( use15specifics ) { valueIfFalseType = env . computeBoxingType ( valueIfFalseType ) ; } else { scope . problemReporter ( ) . conditionalArgumentsIncompatibleTypes ( this , valueIfTrueType , valueIfFalseType ) ; return null ; } } if ( use15specifics ) { TypeBinding commonType = null ; if ( valueIfTrueType == TypeBinding . NULL ) { commonType = valueIfFalseType ; } else if ( valueIfFalseType == TypeBinding . NULL ) { commonType = valueIfTrueType ; } else { commonType = scope . lowerUpperBound ( new TypeBinding [ ] { valueIfTrueType , valueIfFalseType } ) ; } if ( commonType != null ) { this . valueIfTrue . computeConversion ( scope , commonType , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , commonType , originalValueIfFalseType ) ; return this . resolvedType = commonType . capture ( scope , this . sourceEnd ) ; } } else { if ( valueIfFalseType . isCompatibleWith ( valueIfTrueType ) ) { this . valueIfTrue . computeConversion ( scope , valueIfTrueType , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , valueIfTrueType , originalValueIfFalseType ) ; return this . resolvedType = valueIfTrueType ; } else if ( valueIfTrueType . isCompatibleWith ( valueIfFalseType ) ) { this . valueIfTrue . computeConversion ( scope , valueIfFalseType , originalValueIfTrueType ) ; this . valueIfFalse . computeConversion ( scope , valueIfFalseType , originalValueIfFalseType ) ; return this . resolvedType = valueIfFalseType ; } } scope . problemReporter ( ) . conditionalArgumentsIncompatibleTypes ( this , valueIfTrueType , valueIfFalseType ) ; return null ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . condition . traverse ( visitor , scope ) ; this . valueIfTrue . traverse ( visitor , scope ) ; this . valueIfFalse . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; public class UnionTypeReference extends TypeReference { public TypeReference [ ] typeReferences ; public UnionTypeReference ( TypeReference [ ] typeReferences ) { this . bits |= ASTNode . IsUnionType ; this . typeReferences = typeReferences ; this . sourceStart = typeReferences [ <NUM_LIT:0> ] . sourceStart ; int length = typeReferences . length ; this . sourceEnd = typeReferences [ length - <NUM_LIT:1> ] . sourceEnd ; } public TypeReference copyDims ( int dim ) { return this ; } public char [ ] getLastToken ( ) { return null ; } protected TypeBinding getTypeBinding ( Scope scope ) { return null ; } public TypeBinding resolveType ( BlockScope scope , boolean checkBounds ) { int length = this . typeReferences . length ; TypeBinding [ ] allExceptionTypes = new TypeBinding [ length ] ; boolean hasError = false ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeBinding exceptionType = this . typeReferences [ i ] . resolveType ( scope , checkBounds ) ; if ( exceptionType == null ) { return null ; } switch ( exceptionType . kind ( ) ) { case Binding . PARAMETERIZED_TYPE : if ( exceptionType . isBoundParameterizedType ( ) ) { hasError = true ; scope . problemReporter ( ) . invalidParameterizedExceptionType ( exceptionType , this . typeReferences [ i ] ) ; } break ; case Binding . TYPE_PARAMETER : scope . problemReporter ( ) . invalidTypeVariableAsException ( exceptionType , this . typeReferences [ i ] ) ; hasError = true ; break ; } if ( exceptionType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) == null && exceptionType . isValidBinding ( ) ) { scope . problemReporter ( ) . cannotThrowType ( this . typeReferences [ i ] , exceptionType ) ; hasError = true ; } allExceptionTypes [ i ] = exceptionType ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( allExceptionTypes [ j ] . isCompatibleWith ( exceptionType ) ) { scope . problemReporter ( ) . wrongSequenceOfExceptionTypes ( this . typeReferences [ j ] , allExceptionTypes [ j ] , exceptionType ) ; hasError = true ; } else if ( exceptionType . isCompatibleWith ( allExceptionTypes [ j ] ) ) { scope . problemReporter ( ) . wrongSequenceOfExceptionTypes ( this . typeReferences [ i ] , exceptionType , allExceptionTypes [ j ] ) ; hasError = true ; } } } if ( hasError ) { return null ; } return ( this . resolvedType = scope . lowerUpperBound ( allExceptionTypes ) ) ; } public char [ ] [ ] getTypeName ( ) { return this . typeReferences [ <NUM_LIT:0> ] . getTypeName ( ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { int length = this . typeReferences == null ? <NUM_LIT:0> : this . typeReferences . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . typeReferences [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { if ( visitor . visit ( this , scope ) ) { int length = this . typeReferences == null ? <NUM_LIT:0> : this . typeReferences . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . typeReferences [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { int length = this . typeReferences == null ? <NUM_LIT:0> : this . typeReferences . length ; printIndent ( indent , output ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . typeReferences [ i ] . printExpression ( <NUM_LIT:0> , output ) ; if ( i != length - <NUM_LIT:1> ) { output . append ( "<STR_LIT>" ) ; } } return output ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class Block extends Statement { public Statement [ ] statements ; public int explicitDeclarations ; public BlockScope scope ; public Block ( int explicitDeclarations ) { this . explicitDeclarations = explicitDeclarations ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . statements == null ) return flowInfo ; int complaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; for ( int i = <NUM_LIT:0> , max = this . statements . length ; i < max ; i ++ ) { Statement stat = this . statements [ i ] ; if ( ( complaintLevel = stat . complainIfUnreachable ( flowInfo , this . scope , complaintLevel , true ) ) < Statement . COMPLAINED_UNREACHABLE ) { flowInfo = stat . analyseCode ( this . scope , flowContext , flowInfo ) ; } } if ( this . explicitDeclarations > <NUM_LIT:0> ) { this . scope . checkUnclosedCloseables ( flowInfo , flowContext , null , null ) ; LocalVariableBinding [ ] locals = this . scope . locals ; if ( locals != null ) { int numLocals = this . scope . localIndex ; for ( int i = <NUM_LIT:0> ; i < numLocals ; i ++ ) { flowInfo . resetAssignmentInfo ( locals [ i ] ) ; } } } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; if ( this . statements != null ) { for ( int i = <NUM_LIT:0> , max = this . statements . length ; i < max ; i ++ ) { this . statements [ i ] . generateCode ( this . scope , codeStream ) ; } } if ( this . scope != currentScope ) { codeStream . exitUserScope ( this . scope ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public boolean isEmptyBlock ( ) { return this . statements == null ; } public StringBuffer printBody ( int indent , StringBuffer output ) { if ( this . statements == null ) return output ; for ( int i = <NUM_LIT:0> ; i < this . statements . length ; i ++ ) { this . statements [ i ] . printStatement ( indent + <NUM_LIT:1> , output ) ; output . append ( '<STR_LIT:\n>' ) ; } return output ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; output . append ( "<STR_LIT>" ) ; printBody ( indent , output ) ; return printIndent ( indent , output ) . append ( '<CHAR_LIT:}>' ) ; } public void resolve ( BlockScope upperScope ) { if ( ( this . bits & UndocumentedEmptyBlock ) != <NUM_LIT:0> ) { upperScope . problemReporter ( ) . undocumentedEmptyBlock ( this . sourceStart , this . sourceEnd ) ; } if ( this . statements != null ) { this . scope = this . explicitDeclarations == <NUM_LIT:0> ? upperScope : new BlockScope ( upperScope , this . explicitDeclarations ) ; for ( int i = <NUM_LIT:0> , length = this . statements . length ; i < length ; i ++ ) { this . statements [ i ] . resolve ( this . scope ) ; } } } public void resolveUsing ( BlockScope givenScope ) { if ( ( this . bits & UndocumentedEmptyBlock ) != <NUM_LIT:0> ) { givenScope . problemReporter ( ) . undocumentedEmptyBlock ( this . sourceStart , this . sourceEnd ) ; } this . scope = givenScope ; if ( this . statements != null ) { for ( int i = <NUM_LIT:0> , length = this . statements . length ; i < length ; i ++ ) { this . statements [ i ] . resolve ( this . scope ) ; } } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . statements != null ) { for ( int i = <NUM_LIT:0> , length = this . statements . length ; i < length ; i ++ ) this . statements [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , blockScope ) ; } public void branchChainTo ( BranchLabel label ) { if ( this . statements != null ) { this . statements [ this . statements . length - <NUM_LIT:1> ] . branchChainTo ( label ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; 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 . ASTVisitor ; public class EmptyStatement extends Statement { public EmptyStatement ( int startPosition , int endPosition ) { this . sourceStart = startPosition ; this . sourceEnd = endPosition ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return flowInfo ; } public int complainIfUnreachable ( FlowInfo flowInfo , BlockScope scope , int complaintLevel , boolean endOfBlock ) { if ( scope . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_4 ) { return complaintLevel ; } return super . complainIfUnreachable ( flowInfo , scope , complaintLevel , endOfBlock ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { return printIndent ( tab , output ) . append ( '<CHAR_LIT:;>' ) ; } public void resolve ( BlockScope scope ) { if ( ( this . bits & IsUsefulEmptyStatement ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . superfluousSemicolon ( this . sourceStart , this . sourceEnd ) ; } else { scope . problemReporter ( ) . emptyControlFlowStatement ( this . sourceStart , this . sourceEnd ) ; } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class Assignment extends Expression { public Expression lhs ; public Expression expression ; public Assignment ( Expression lhs , Expression expression , int sourceEnd ) { this . lhs = lhs ; lhs . bits |= IsStrictlyAssigned ; this . expression = expression ; this . sourceStart = lhs . sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { LocalVariableBinding local = this . lhs . localVariableBinding ( ) ; if ( ( this . expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . expression . checkNPE ( currentScope , flowContext , flowInfo ) ; } FlowInfo preInitInfo = null ; boolean shouldAnalyseResource = local != null && flowInfo . reachMode ( ) == FlowInfo . REACHABLE && currentScope . compilerOptions ( ) . analyseResourceLeaks && ( FakedTrackingVariable . isAnyCloseable ( this . expression . resolvedType ) || this . expression . resolvedType == TypeBinding . NULL ) ; if ( shouldAnalyseResource ) { preInitInfo = flowInfo . unconditionalCopy ( ) ; FakedTrackingVariable . preConnectTrackerAcrossAssignment ( this , local , this . expression ) ; } flowInfo = ( ( Reference ) this . lhs ) . analyseAssignment ( currentScope , flowContext , flowInfo , this , false ) . unconditionalInits ( ) ; if ( shouldAnalyseResource ) FakedTrackingVariable . handleResourceAssignment ( currentScope , preInitInfo , flowInfo , this , this . expression , local ) ; else FakedTrackingVariable . cleanUpAfterAssignment ( currentScope , this . lhs . bits , this . expression ) ; int nullStatus = this . expression . nullStatus ( flowInfo ) ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { if ( nullStatus == FlowInfo . NULL ) { flowContext . recordUsingNullReference ( currentScope , local , this . lhs , FlowContext . CAN_ONLY_NULL | FlowContext . IN_ASSIGNMENT , flowInfo ) ; } } nullStatus = checkAssignmentAgainstNullAnnotation ( currentScope , flowContext , local , nullStatus , this . expression , this . expression . resolvedType ) ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { flowInfo . markNullStatus ( local , nullStatus ) ; if ( flowContext . initsOnFinally != null ) flowContext . initsOnFinally . markNullStatus ( local , nullStatus ) ; } return flowInfo ; } void checkAssignment ( BlockScope scope , TypeBinding lhsType , TypeBinding rhsType ) { FieldBinding leftField = getLastField ( this . lhs ) ; if ( leftField != null && rhsType != TypeBinding . NULL && ( lhsType . kind ( ) == Binding . WILDCARD_TYPE ) && ( ( WildcardBinding ) lhsType ) . boundKind != Wildcard . SUPER ) { scope . problemReporter ( ) . wildcardAssignment ( lhsType , rhsType , this . expression ) ; } else if ( leftField != null && ! leftField . isStatic ( ) && leftField . declaringClass != null && leftField . declaringClass . isRawType ( ) ) { scope . problemReporter ( ) . unsafeRawFieldAssignment ( leftField , rhsType , this . lhs ) ; } else if ( rhsType . needsUncheckedConversion ( lhsType ) ) { scope . problemReporter ( ) . unsafeTypeConversion ( this . expression , rhsType , lhsType ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; ( ( Reference ) this . lhs ) . generateAssignment ( currentScope , codeStream , this , valueRequired ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } FieldBinding getLastField ( Expression someExpression ) { if ( someExpression instanceof SingleNameReference ) { if ( ( someExpression . bits & RestrictiveFlagMASK ) == Binding . FIELD ) { return ( FieldBinding ) ( ( SingleNameReference ) someExpression ) . binding ; } } else if ( someExpression instanceof FieldReference ) { return ( ( FieldReference ) someExpression ) . binding ; } else if ( someExpression instanceof QualifiedNameReference ) { QualifiedNameReference qName = ( QualifiedNameReference ) someExpression ; if ( qName . otherBindings == null ) { if ( ( someExpression . bits & RestrictiveFlagMASK ) == Binding . FIELD ) { return ( FieldBinding ) qName . binding ; } } else { return qName . otherBindings [ qName . otherBindings . length - <NUM_LIT:1> ] ; } } return null ; } public int nullStatus ( FlowInfo flowInfo ) { return this . expression . nullStatus ( flowInfo ) ; } public StringBuffer print ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; return printExpressionNoParenthesis ( indent , output ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { output . append ( '<CHAR_LIT:(>' ) ; return printExpressionNoParenthesis ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:)>' ) ; } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { this . lhs . printExpression ( indent , output ) . append ( "<STR_LIT:U+0020=U+0020>" ) ; return this . expression . printExpression ( <NUM_LIT:0> , output ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { return print ( indent , output ) . append ( '<CHAR_LIT:;>' ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( ! ( this . lhs instanceof Reference ) || this . lhs . isThis ( ) ) { scope . problemReporter ( ) . expressionShouldBeAVariable ( this . lhs ) ; return null ; } TypeBinding lhsType = this . lhs . resolveType ( scope ) ; this . expression . setExpectedType ( lhsType ) ; if ( lhsType != null ) { this . resolvedType = lhsType . capture ( scope , this . sourceEnd ) ; } LocalVariableBinding localVariableBinding = this . lhs . localVariableBinding ( ) ; if ( localVariableBinding != null ) { localVariableBinding . tagBits &= ~ TagBits . IsEffectivelyFinal ; } TypeBinding rhsType = this . expression . resolveType ( scope ) ; if ( lhsType == null || rhsType == null ) { return null ; } Binding left = getDirectBinding ( this . lhs ) ; if ( left != null && ! left . isVolatile ( ) && left == getDirectBinding ( this . expression ) ) { scope . problemReporter ( ) . assignmentHasNoEffect ( this , left . shortReadableName ( ) ) ; } if ( lhsType != rhsType ) { scope . compilationUnitScope ( ) . recordTypeConversion ( lhsType , rhsType ) ; } if ( this . expression . isConstantValueOfTypeAssignableToType ( rhsType , lhsType ) || rhsType . isCompatibleWith ( lhsType ) ) { this . expression . computeConversion ( scope , lhsType , rhsType ) ; checkAssignment ( scope , lhsType , rhsType ) ; if ( this . expression instanceof CastExpression && ( this . expression . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> ) { CastExpression . checkNeedForAssignedCast ( scope , lhsType , ( CastExpression ) this . expression ) ; } return this . resolvedType ; } else if ( isBoxingCompatible ( rhsType , lhsType , this . expression , scope ) ) { this . expression . computeConversion ( scope , lhsType , rhsType ) ; if ( this . expression instanceof CastExpression && ( this . expression . bits & ASTNode . UnnecessaryCast ) == <NUM_LIT:0> ) { CastExpression . checkNeedForAssignedCast ( scope , lhsType , ( CastExpression ) this . expression ) ; } return this . resolvedType ; } scope . problemReporter ( ) . typeMismatchError ( rhsType , lhsType , this . expression , this . lhs ) ; return lhsType ; } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { TypeBinding type = super . resolveTypeExpecting ( scope , expectedType ) ; if ( type == null ) return null ; TypeBinding lhsType = this . resolvedType ; TypeBinding rhsType = this . expression . resolvedType ; if ( expectedType == TypeBinding . BOOLEAN && lhsType == TypeBinding . BOOLEAN && ( this . lhs . bits & IsStrictlyAssigned ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . possibleAccidentalBooleanAssignment ( this ) ; } checkAssignment ( scope , lhsType , rhsType ) ; return type ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . lhs . traverse ( visitor , scope ) ; this . expression . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } public LocalVariableBinding localVariableBinding ( ) { return this . lhs . localVariableBinding ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . flow . FlowContext ; import org . eclipse . jdt . internal . compiler . flow . FlowInfo ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . InvocationSite ; import org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . ProblemMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . RawTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; 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 . VariableBinding ; public class ExplicitConstructorCall extends Statement implements InvocationSite { public Expression [ ] arguments ; public Expression qualification ; public MethodBinding binding ; MethodBinding syntheticAccessor ; public int accessMode ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public final static int ImplicitSuper = <NUM_LIT:1> ; public final static int Super = <NUM_LIT:2> ; public final static int This = <NUM_LIT:3> ; public VariableBinding [ ] [ ] implicitArguments ; public int typeArgumentsSourceStart ; public ExplicitConstructorCall ( int accessMode ) { this . accessMode = accessMode ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { try { ( ( MethodScope ) currentScope ) . isConstructorCall = true ; if ( this . qualification != null ) { flowInfo = this . qualification . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } if ( this . arguments != null ) { boolean analyseResources = currentScope . compilerOptions ( ) . analyseResourceLeaks ; for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { flowInfo = this . arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; if ( analyseResources ) { flowInfo = FakedTrackingVariable . markPassedToOutside ( currentScope , this . arguments [ i ] , flowInfo , false ) ; } if ( ( this . arguments [ i ] . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . arguments [ i ] . checkNPE ( currentScope , flowContext , flowInfo ) ; } } analyseArguments ( currentScope , flowContext , flowInfo , this . binding , this . arguments ) ; } ReferenceBinding [ ] thrownExceptions ; if ( ( thrownExceptions = this . binding . thrownExceptions ) != Binding . NO_EXCEPTIONS ) { if ( ( this . bits & ASTNode . Unchecked ) != <NUM_LIT:0> && this . genericTypeArguments == null ) { thrownExceptions = currentScope . environment ( ) . convertToRawTypes ( this . binding . thrownExceptions , true , true ) ; } flowContext . checkExceptionHandlers ( thrownExceptions , ( this . accessMode == ExplicitConstructorCall . ImplicitSuper ) ? ( ASTNode ) currentScope . methodScope ( ) . referenceContext : ( ASTNode ) this , flowInfo , currentScope ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } finally { ( ( MethodScope ) currentScope ) . isConstructorCall = false ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } try { ( ( MethodScope ) currentScope ) . isConstructorCall = true ; int pc = codeStream . position ; codeStream . aload_0 ( ) ; MethodBinding codegenBinding = this . binding . original ( ) ; ReferenceBinding targetType = codegenBinding . declaringClass ; if ( targetType . erasure ( ) . id == TypeIds . T_JavaLangEnum || targetType . isEnum ( ) ) { codeStream . aload_1 ( ) ; codeStream . iload_2 ( ) ; } if ( targetType . isNestedType ( ) ) { codeStream . generateSyntheticEnclosingInstanceValues ( currentScope , targetType , ( this . bits & ASTNode . DiscardEnclosingInstance ) != <NUM_LIT:0> ? null : this . qualification , this ) ; } generateArguments ( this . binding , this . arguments , currentScope , codeStream ) ; if ( targetType . isNestedType ( ) ) { codeStream . generateSyntheticOuterArgumentValues ( currentScope , targetType , this ) ; } if ( this . syntheticAccessor != null ) { for ( int i = <NUM_LIT:0> , max = this . syntheticAccessor . parameters . length - codegenBinding . parameters . length ; i < max ; i ++ ) { codeStream . aconst_null ( ) ; } codeStream . invoke ( Opcodes . OPC_invokespecial , this . syntheticAccessor , null ) ; } else { codeStream . invoke ( Opcodes . OPC_invokespecial , codegenBinding , null ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } finally { ( ( MethodScope ) currentScope ) . isConstructorCall = false ; } } public TypeBinding [ ] genericTypeArguments ( ) { return this . genericTypeArguments ; } public boolean isImplicitSuper ( ) { return ( this . accessMode == ExplicitConstructorCall . ImplicitSuper ) ; } public boolean isSuperAccess ( ) { return this . accessMode != ExplicitConstructorCall . This ; } public boolean isTypeAccess ( ) { return true ; } void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { ReferenceBinding superTypeErasure = ( ReferenceBinding ) this . binding . declaringClass . erasure ( ) ; if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { if ( superTypeErasure . isNestedType ( ) && currentScope . enclosingSourceType ( ) . isLocalType ( ) ) { if ( superTypeErasure . isLocalType ( ) ) { ( ( LocalTypeBinding ) superTypeErasure ) . addInnerEmulationDependent ( currentScope , this . qualification != null ) ; } else { currentScope . propagateInnerEmulation ( superTypeErasure , this . qualification != null ) ; } } } } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { MethodBinding codegenBinding = this . binding . original ( ) ; if ( this . binding . isPrivate ( ) && this . accessMode != ExplicitConstructorCall . This ) { ReferenceBinding declaringClass = codegenBinding . declaringClass ; if ( ( declaringClass . tagBits & TagBits . IsLocalType ) != <NUM_LIT:0> && currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { codegenBinding . tagBits |= TagBits . ClearPrivateModifier ; } else { this . syntheticAccessor = ( ( SourceTypeBinding ) declaringClass ) . addSyntheticMethod ( codegenBinding , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateMethodAccess ( codegenBinding , this ) ; } } } } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; if ( this . qualification != null ) this . qualification . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:.>' ) ; if ( this . typeArguments != null ) { output . append ( '<CHAR_LIT>' ) ; int max = this . typeArguments . length - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < max ; j ++ ) { this . typeArguments [ j ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } this . typeArguments [ max ] . print ( <NUM_LIT:0> , output ) ; output . append ( '<CHAR_LIT:>>' ) ; } if ( this . accessMode == ExplicitConstructorCall . This ) { output . append ( "<STR_LIT>" ) ; } else { output . append ( "<STR_LIT>" ) ; } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> ; i < this . arguments . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . arguments [ i ] . printExpression ( <NUM_LIT:0> , output ) ; } } return output . append ( "<STR_LIT>" ) ; } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; try { AbstractMethodDeclaration methodDeclaration = methodScope . referenceMethod ( ) ; if ( methodDeclaration == null || ! methodDeclaration . isConstructor ( ) || ( ( ConstructorDeclaration ) methodDeclaration ) . constructorCall != this ) { scope . problemReporter ( ) . invalidExplicitConstructorCall ( this ) ; if ( this . qualification != null ) { this . qualification . resolveType ( scope ) ; } if ( this . typeArguments != null ) { for ( int i = <NUM_LIT:0> , max = this . typeArguments . length ; i < max ; i ++ ) { this . typeArguments [ i ] . resolveType ( scope , true ) ; } } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { this . arguments [ i ] . resolveType ( scope ) ; } } return ; } methodScope . isConstructorCall = true ; ReferenceBinding receiverType = scope . enclosingReceiverType ( ) ; boolean rcvHasError = false ; if ( this . accessMode != ExplicitConstructorCall . This ) { receiverType = receiverType . superclass ( ) ; TypeReference superclassRef = scope . referenceType ( ) . superclass ; if ( superclassRef != null && superclassRef . resolvedType != null && ! superclassRef . resolvedType . isValidBinding ( ) ) { rcvHasError = true ; } } if ( receiverType != null ) { if ( this . accessMode == ExplicitConstructorCall . Super && receiverType . erasure ( ) . id == TypeIds . T_JavaLangEnum ) { scope . problemReporter ( ) . cannotInvokeSuperConstructorInEnum ( this , methodScope . referenceMethod ( ) . binding ) ; } if ( this . qualification != null ) { if ( this . accessMode != ExplicitConstructorCall . Super ) { scope . problemReporter ( ) . unnecessaryEnclosingInstanceSpecification ( this . qualification , receiverType ) ; } if ( ! rcvHasError ) { ReferenceBinding enclosingType = receiverType . enclosingType ( ) ; if ( enclosingType == null ) { scope . problemReporter ( ) . unnecessaryEnclosingInstanceSpecification ( this . qualification , receiverType ) ; this . bits |= ASTNode . DiscardEnclosingInstance ; } else { TypeBinding qTb = this . qualification . resolveTypeExpecting ( scope , enclosingType ) ; this . qualification . computeConversion ( scope , qTb , qTb ) ; } } } } if ( this . typeArguments != null ) { boolean argHasError = scope . compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ; int length = this . typeArguments . length ; this . genericTypeArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference typeReference = this . typeArguments [ i ] ; if ( ( this . genericTypeArguments [ i ] = typeReference . resolveType ( scope , true ) ) == null ) { argHasError = true ; } if ( argHasError && typeReference instanceof Wildcard ) { scope . problemReporter ( ) . illegalUsageOfWildcard ( typeReference ) ; } } if ( argHasError ) { if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { this . arguments [ i ] . resolveType ( scope ) ; } } return ; } } TypeBinding [ ] argumentTypes = Binding . NO_PARAMETERS ; boolean argsContainCast = false ; if ( this . arguments != null ) { boolean argHasError = false ; int length = this . arguments . length ; argumentTypes = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = this . arguments [ i ] ; if ( argument instanceof CastExpression ) { argument . bits |= ASTNode . DisableUnnecessaryCastCheck ; argsContainCast = true ; } if ( ( argumentTypes [ i ] = argument . resolveType ( scope ) ) == null ) { argHasError = true ; } } if ( argHasError ) { if ( receiverType == null ) { return ; } TypeBinding [ ] pseudoArgs = new TypeBinding [ length ] ; for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { pseudoArgs [ i ] = argumentTypes [ i ] == null ? TypeBinding . NULL : argumentTypes [ i ] ; } this . binding = scope . findMethod ( receiverType , TypeConstants . INIT , pseudoArgs , this ) ; if ( this . binding != null && ! this . binding . isValidBinding ( ) ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) this . binding ) . closestMatch ; if ( closestMatch != null ) { if ( closestMatch . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) { closestMatch = scope . environment ( ) . createParameterizedGenericMethod ( closestMatch . original ( ) , ( RawTypeBinding ) null ) ; } this . binding = closestMatch ; MethodBinding closestMatchOriginal = closestMatch . original ( ) ; if ( closestMatchOriginal . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInMethod ( closestMatchOriginal ) ) { closestMatchOriginal . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } } return ; } } else if ( receiverType . erasure ( ) . id == TypeIds . T_JavaLangEnum ) { argumentTypes = new TypeBinding [ ] { scope . getJavaLangString ( ) , TypeBinding . INT } ; } if ( receiverType == null ) { return ; } if ( ( this . binding = scope . getConstructor ( receiverType , argumentTypes , this ) ) . isValidBinding ( ) ) { if ( ( this . binding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { if ( ! methodScope . enclosingSourceType ( ) . isAnonymousType ( ) ) { scope . problemReporter ( ) . missingTypeInConstructor ( this , this . binding ) ; } } if ( isMethodUseDeprecated ( this . binding , scope , this . accessMode != ExplicitConstructorCall . ImplicitSuper ) ) { scope . problemReporter ( ) . deprecatedMethod ( this . binding , this ) ; } if ( checkInvocationArguments ( scope , null , receiverType , this . binding , this . arguments , argumentTypes , argsContainCast , this ) ) { this . bits |= ASTNode . Unchecked ; } if ( this . binding . isOrEnclosedByPrivateType ( ) ) { this . binding . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( this . typeArguments != null && this . binding . original ( ) . typeVariables == Binding . NO_TYPE_VARIABLES ) { scope . problemReporter ( ) . unnecessaryTypeArgumentsForMethodInvocation ( this . binding , this . genericTypeArguments , this . typeArguments ) ; } } else { if ( this . binding . declaringClass == null ) { this . binding . declaringClass = receiverType ; } if ( rcvHasError ) return ; scope . problemReporter ( ) . invalidConstructor ( this , this . binding ) ; } } finally { methodScope . isConstructorCall = false ; } } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . qualification != null ) { this . qualification . traverse ( visitor , scope ) ; } if ( this . typeArguments != null ) { for ( int i = <NUM_LIT:0> , typeArgumentsLength = this . typeArguments . length ; i < typeArgumentsLength ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , scope ) ; } } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , argumentLength = this . arguments . length ; i < argumentLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class AllocationExpression extends Expression implements InvocationSite { public TypeReference type ; public Expression [ ] arguments ; public MethodBinding binding ; MethodBinding syntheticAccessor ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public FieldDeclaration enumConstant ; protected TypeBinding typeExpected ; public boolean inferredReturnType ; public FakedTrackingVariable closeTracker ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { checkCapturedLocalInitializationIfNecessary ( ( ReferenceBinding ) this . binding . declaringClass . erasure ( ) , currentScope , flowInfo ) ; if ( this . arguments != null ) { boolean analyseResources = currentScope . compilerOptions ( ) . analyseResourceLeaks ; boolean hasResourceWrapperType = analyseResources && this . resolvedType instanceof ReferenceBinding && ( ( ReferenceBinding ) this . resolvedType ) . hasTypeBit ( TypeIds . BitWrapperCloseable ) ; for ( int i = <NUM_LIT:0> , count = this . arguments . length ; i < count ; i ++ ) { flowInfo = this . arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; if ( analyseResources && ! hasResourceWrapperType ) { flowInfo = FakedTrackingVariable . markPassedToOutside ( currentScope , this . arguments [ i ] , flowInfo , false ) ; } if ( ( this . arguments [ i ] . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . arguments [ i ] . checkNPE ( currentScope , flowContext , flowInfo ) ; } } analyseArguments ( currentScope , flowContext , flowInfo , this . binding , this . arguments ) ; } ReferenceBinding [ ] thrownExceptions ; if ( ( ( thrownExceptions = this . binding . thrownExceptions ) . length ) != <NUM_LIT:0> ) { if ( ( this . bits & ASTNode . Unchecked ) != <NUM_LIT:0> && this . genericTypeArguments == null ) { thrownExceptions = currentScope . environment ( ) . convertToRawTypes ( this . binding . thrownExceptions , true , true ) ; } flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo . unconditionalCopy ( ) , currentScope ) ; } if ( currentScope . compilerOptions ( ) . analyseResourceLeaks && FakedTrackingVariable . isAnyCloseable ( this . resolvedType ) ) FakedTrackingVariable . analyseCloseableAllocation ( currentScope , flowInfo , this ) ; if ( this . binding . declaringClass . isMemberType ( ) && ! this . binding . declaringClass . isStatic ( ) ) { currentScope . resetDeclaringClassMethodStaticFlag ( this . binding . declaringClass . enclosingType ( ) ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public void checkCapturedLocalInitializationIfNecessary ( ReferenceBinding checkedType , BlockScope currentScope , FlowInfo flowInfo ) { if ( ( ( checkedType . tagBits & ( TagBits . AnonymousTypeMask | TagBits . LocalTypeMask ) ) == TagBits . LocalTypeMask ) && ! currentScope . isDefinedInType ( checkedType ) ) { NestedTypeBinding nestedType = ( NestedTypeBinding ) checkedType ; SyntheticArgumentBinding [ ] syntheticArguments = nestedType . syntheticOuterLocalVariables ( ) ; if ( syntheticArguments != null ) for ( int i = <NUM_LIT:0> , count = syntheticArguments . length ; i < count ; i ++ ) { SyntheticArgumentBinding syntheticArgument = syntheticArguments [ i ] ; LocalVariableBinding targetLocal ; if ( ( targetLocal = syntheticArgument . actualOuterLocalVariable ) == null ) continue ; if ( targetLocal . declaration != null && ! flowInfo . isDefinitelyAssigned ( targetLocal ) ) { currentScope . problemReporter ( ) . uninitializedLocalVariable ( targetLocal , this ) ; } } } } public Expression enclosingInstance ( ) { return null ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { if ( ! valueRequired ) currentScope . problemReporter ( ) . unusedObjectAllocation ( this ) ; int pc = codeStream . position ; MethodBinding codegenBinding = this . binding . original ( ) ; ReferenceBinding allocatedType = codegenBinding . declaringClass ; codeStream . new_ ( allocatedType ) ; boolean isUnboxing = ( this . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ; if ( valueRequired || isUnboxing ) { codeStream . dup ( ) ; } if ( this . type != null ) { codeStream . recordPositionsFrom ( pc , this . type . sourceStart ) ; } else { codeStream . ldc ( String . valueOf ( this . enumConstant . name ) ) ; codeStream . generateInlinedValue ( this . enumConstant . binding . id ) ; } if ( allocatedType . isNestedType ( ) ) { codeStream . generateSyntheticEnclosingInstanceValues ( currentScope , allocatedType , enclosingInstance ( ) , this ) ; } generateArguments ( this . binding , this . arguments , currentScope , codeStream ) ; if ( allocatedType . isNestedType ( ) ) { codeStream . generateSyntheticOuterArgumentValues ( currentScope , allocatedType , this ) ; } if ( this . syntheticAccessor == null ) { codeStream . invoke ( Opcodes . OPC_invokespecial , codegenBinding , null ) ; } else { for ( int i = <NUM_LIT:0> , max = this . syntheticAccessor . parameters . length - codegenBinding . parameters . length ; i < max ; i ++ ) { codeStream . aconst_null ( ) ; } codeStream . invoke ( Opcodes . OPC_invokespecial , this . syntheticAccessor , null ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else if ( isUnboxing ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( postConversionType ( currentScope ) . id ) { case T_long : case T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding [ ] genericTypeArguments ( ) { return this . genericTypeArguments ; } public boolean isSuperAccess ( ) { return false ; } public boolean isTypeAccess ( ) { return true ; } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; ReferenceBinding allocatedTypeErasure = ( ReferenceBinding ) this . binding . declaringClass . erasure ( ) ; if ( allocatedTypeErasure . isNestedType ( ) && currentScope . enclosingSourceType ( ) . isLocalType ( ) ) { if ( allocatedTypeErasure . isLocalType ( ) ) { ( ( LocalTypeBinding ) allocatedTypeErasure ) . addInnerEmulationDependent ( currentScope , false ) ; } else { currentScope . propagateInnerEmulation ( allocatedTypeErasure , false ) ; } } } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) return ; MethodBinding codegenBinding = this . binding . original ( ) ; ReferenceBinding declaringClass ; if ( codegenBinding . isPrivate ( ) && currentScope . enclosingSourceType ( ) != ( declaringClass = codegenBinding . declaringClass ) ) { if ( ( declaringClass . tagBits & TagBits . IsLocalType ) != <NUM_LIT:0> && currentScope . compilerOptions ( ) . complianceLevel >= ClassFileConstants . JDK1_4 ) { codegenBinding . tagBits |= TagBits . ClearPrivateModifier ; } else { this . syntheticAccessor = ( ( SourceTypeBinding ) declaringClass ) . addSyntheticMethod ( codegenBinding , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateMethodAccess ( codegenBinding , this ) ; } } } public StringBuffer printExpression ( int indent , StringBuffer output ) { if ( this . type != null ) { output . append ( "<STR_LIT>" ) ; } if ( this . typeArguments != null ) { output . append ( '<CHAR_LIT>' ) ; int max = this . typeArguments . length - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < max ; j ++ ) { this . typeArguments [ j ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+002CU+0020>" ) ; } this . typeArguments [ max ] . print ( <NUM_LIT:0> , output ) ; output . append ( '<CHAR_LIT:>>' ) ; } if ( this . type != null ) { this . type . printExpression ( <NUM_LIT:0> , output ) ; } output . append ( '<CHAR_LIT:(>' ) ; if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> ; i < this . arguments . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . arguments [ i ] . printExpression ( <NUM_LIT:0> , output ) ; } } return output . append ( '<CHAR_LIT:)>' ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( this . type == null ) { this . resolvedType = scope . enclosingReceiverType ( ) ; } else { this . resolvedType = this . type . resolveType ( scope , true ) ; checkParameterizedAllocation : { if ( this . type instanceof ParameterizedQualifiedTypeReference ) { ReferenceBinding currentType = ( ReferenceBinding ) this . resolvedType ; if ( currentType == null ) return currentType ; do { if ( ( currentType . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ) break checkParameterizedAllocation ; if ( currentType . isRawType ( ) ) break checkParameterizedAllocation ; } while ( ( currentType = currentType . enclosingType ( ) ) != null ) ; ParameterizedQualifiedTypeReference qRef = ( ParameterizedQualifiedTypeReference ) this . type ; for ( int i = qRef . typeArguments . length - <NUM_LIT:2> ; i >= <NUM_LIT:0> ; i -- ) { if ( qRef . typeArguments [ i ] != null ) { scope . problemReporter ( ) . illegalQualifiedParameterizedTypeAllocation ( this . type , this . resolvedType ) ; break ; } } } } } final boolean isDiamond = this . type != null && ( this . type . bits & ASTNode . IsDiamond ) != <NUM_LIT:0> ; if ( this . typeArguments != null ) { int length = this . typeArguments . length ; boolean argHasError = scope . compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ; this . genericTypeArguments = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference typeReference = this . typeArguments [ i ] ; if ( ( this . genericTypeArguments [ i ] = typeReference . resolveType ( scope , true ) ) == null ) { argHasError = true ; } if ( argHasError && typeReference instanceof Wildcard ) { scope . problemReporter ( ) . illegalUsageOfWildcard ( typeReference ) ; } } if ( isDiamond ) { scope . problemReporter ( ) . diamondNotWithExplicitTypeArguments ( this . typeArguments ) ; return null ; } if ( argHasError ) { if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , max = this . arguments . length ; i < max ; i ++ ) { this . arguments [ i ] . resolveType ( scope ) ; } } return null ; } } boolean argsContainCast = false ; TypeBinding [ ] argumentTypes = Binding . NO_PARAMETERS ; if ( this . arguments != null ) { boolean argHasError = false ; int length = this . arguments . length ; argumentTypes = new TypeBinding [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Expression argument = this . arguments [ i ] ; if ( argument instanceof CastExpression ) { argument . bits |= DisableUnnecessaryCastCheck ; argsContainCast = true ; } if ( ( argumentTypes [ i ] = argument . resolveType ( scope ) ) == null ) { argHasError = true ; } } if ( argHasError ) { if ( isDiamond ) { return null ; } if ( this . resolvedType instanceof ReferenceBinding ) { TypeBinding [ ] pseudoArgs = new TypeBinding [ length ] ; for ( int i = length ; -- i >= <NUM_LIT:0> ; ) { pseudoArgs [ i ] = argumentTypes [ i ] == null ? TypeBinding . NULL : argumentTypes [ i ] ; } this . binding = scope . findMethod ( ( ReferenceBinding ) this . resolvedType , TypeConstants . INIT , pseudoArgs , this ) ; if ( this . binding != null && ! this . binding . isValidBinding ( ) ) { MethodBinding closestMatch = ( ( ProblemMethodBinding ) this . binding ) . closestMatch ; if ( closestMatch != null ) { if ( closestMatch . original ( ) . typeVariables != Binding . NO_TYPE_VARIABLES ) { closestMatch = scope . environment ( ) . createParameterizedGenericMethod ( closestMatch . original ( ) , ( RawTypeBinding ) null ) ; } this . binding = closestMatch ; MethodBinding closestMatchOriginal = closestMatch . original ( ) ; if ( closestMatchOriginal . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInMethod ( closestMatchOriginal ) ) { closestMatchOriginal . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } } } } return this . resolvedType ; } } if ( this . resolvedType == null || ! this . resolvedType . isValidBinding ( ) ) { return null ; } if ( this . type != null && ! this . resolvedType . canBeInstantiated ( ) ) { scope . problemReporter ( ) . cannotInstantiate ( this . type , this . resolvedType ) ; return this . resolvedType ; } if ( isDiamond ) { TypeBinding [ ] inferredTypes = inferElidedTypes ( ( ( ParameterizedTypeBinding ) this . resolvedType ) . genericType ( ) , null , argumentTypes , scope ) ; if ( inferredTypes == null ) { scope . problemReporter ( ) . cannotInferElidedTypes ( this ) ; return this . resolvedType = null ; } this . resolvedType = this . type . resolvedType = scope . environment ( ) . createParameterizedType ( ( ( ParameterizedTypeBinding ) this . resolvedType ) . genericType ( ) , inferredTypes , ( ( ParameterizedTypeBinding ) this . resolvedType ) . enclosingType ( ) ) ; } ReferenceBinding allocationType = ( ReferenceBinding ) this . resolvedType ; if ( ! ( this . binding = scope . getConstructor ( allocationType , argumentTypes , this ) ) . isValidBinding ( ) ) { if ( this . binding . declaringClass == null ) { this . binding . declaringClass = allocationType ; } if ( this . type != null && ! this . type . resolvedType . isValidBinding ( ) ) { return null ; } scope . problemReporter ( ) . invalidConstructor ( this , this . binding ) ; return this . resolvedType ; } if ( ( this . binding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . missingTypeInConstructor ( this , this . binding ) ; } if ( isMethodUseDeprecated ( this . binding , scope , true ) ) scope . problemReporter ( ) . deprecatedMethod ( this . binding , this ) ; if ( checkInvocationArguments ( scope , null , allocationType , this . binding , this . arguments , argumentTypes , argsContainCast , this ) ) { this . bits |= ASTNode . Unchecked ; } if ( this . typeArguments != null && this . binding . original ( ) . typeVariables == Binding . NO_TYPE_VARIABLES ) { scope . problemReporter ( ) . unnecessaryTypeArgumentsForMethodInvocation ( this . binding , this . genericTypeArguments , this . typeArguments ) ; } if ( ! isDiamond && this . resolvedType . isParameterizedTypeWithActualArguments ( ) ) { checkTypeArgumentRedundancy ( ( ParameterizedTypeBinding ) this . resolvedType , null , argumentTypes , scope ) ; } return allocationType ; } public TypeBinding [ ] inferElidedTypes ( ReferenceBinding allocationType , ReferenceBinding enclosingType , TypeBinding [ ] argumentTypes , final BlockScope scope ) { MethodBinding factory = scope . getStaticFactory ( allocationType , enclosingType , argumentTypes , this ) ; if ( factory instanceof ParameterizedGenericMethodBinding && factory . isValidBinding ( ) ) { ParameterizedGenericMethodBinding genericFactory = ( ParameterizedGenericMethodBinding ) factory ; this . inferredReturnType = genericFactory . inferredReturnType ; return ( ( ParameterizedTypeBinding ) factory . returnType ) . arguments ; } return null ; } public void checkTypeArgumentRedundancy ( ParameterizedTypeBinding allocationType , ReferenceBinding enclosingType , TypeBinding [ ] argumentTypes , final BlockScope scope ) { ProblemReporter reporter = scope . problemReporter ( ) ; if ( ( reporter . computeSeverity ( IProblem . RedundantSpecificationOfTypeArguments ) == ProblemSeverities . Ignore ) || scope . compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_7 ) return ; if ( allocationType . arguments == null ) return ; if ( this . genericTypeArguments != null ) return ; if ( argumentTypes == Binding . NO_PARAMETERS && this . typeExpected instanceof ParameterizedTypeBinding ) { ParameterizedTypeBinding expected = ( ParameterizedTypeBinding ) this . typeExpected ; if ( expected . arguments != null && allocationType . arguments . length == expected . arguments . length ) { int i ; for ( i = <NUM_LIT:0> ; i < allocationType . arguments . length ; i ++ ) { if ( allocationType . arguments [ i ] != expected . arguments [ i ] ) break ; } if ( i == allocationType . arguments . length ) { reporter . redundantSpecificationOfTypeArguments ( this . type , allocationType . arguments ) ; return ; } } } TypeBinding [ ] inferredTypes = inferElidedTypes ( allocationType . genericType ( ) , enclosingType , argumentTypes , scope ) ; if ( inferredTypes == null ) { return ; } for ( int i = <NUM_LIT:0> ; i < inferredTypes . length ; i ++ ) { if ( inferredTypes [ i ] != allocationType . arguments [ i ] ) return ; } reporter . redundantSpecificationOfTypeArguments ( this . type , allocationType . arguments ) ; } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int i ) { } public void setFieldIndex ( int i ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . typeArguments != null ) { for ( int i = <NUM_LIT:0> , typeArgumentsLength = this . typeArguments . length ; i < typeArgumentsLength ; i ++ ) { this . typeArguments [ i ] . traverse ( visitor , scope ) ; } } if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . arguments != null ) { for ( int i = <NUM_LIT:0> , argumentsLength = this . arguments . length ; i < argumentsLength ; i ++ ) this . arguments [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void setExpectedType ( TypeBinding expectedType ) { this . typeExpected = expectedType ; } public TypeBinding expectedType ( ) { return this . typeExpected ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import java . util . Arrays ; import java . util . Comparator ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ClassFile ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . IrritantSet ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . CompilationUnitScope ; import org . eclipse . jdt . internal . compiler . lookup . ImportBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . LookupEnvironment ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . parser . NLSTag ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilationUnit ; import org . eclipse . jdt . internal . compiler . problem . AbortMethod ; import org . eclipse . jdt . internal . compiler . problem . AbortType ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . HashSetOfInt ; public class CompilationUnitDeclaration extends ASTNode implements ProblemSeverities , ReferenceContext { private static final Comparator STRING_LITERAL_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { StringLiteral literal1 = ( StringLiteral ) o1 ; StringLiteral literal2 = ( StringLiteral ) o2 ; return literal1 . sourceStart - literal2 . sourceStart ; } } ; private static final int STRING_LITERALS_INCREMENT = <NUM_LIT:10> ; public ImportReference currentPackage ; public ImportReference [ ] imports ; public TypeDeclaration [ ] types ; public int [ ] [ ] comments ; public boolean ignoreFurtherInvestigation = false ; public boolean ignoreMethodBodies = false ; public CompilationUnitScope scope ; public ProblemReporter problemReporter ; public CompilationResult compilationResult ; public LocalTypeBinding [ ] localTypes ; public int localTypeCount = <NUM_LIT:0> ; public boolean isPropagatingInnerClassEmulation ; public Javadoc javadoc ; public NLSTag [ ] nlsTags ; private StringLiteral [ ] stringLiterals ; private int stringLiteralsPtr ; private HashSetOfInt stringLiteralsStart ; IrritantSet [ ] suppressWarningIrritants ; Annotation [ ] suppressWarningAnnotations ; long [ ] suppressWarningScopePositions ; int suppressWarningsCount ; public CompilationUnitDeclaration ( ProblemReporter problemReporter , CompilationResult compilationResult , int sourceLength ) { this . problemReporter = problemReporter ; this . compilationResult = compilationResult ; this . sourceStart = <NUM_LIT:0> ; this . sourceEnd = sourceLength - <NUM_LIT:1> ; } public void abort ( int abortLevel , CategorizedProblem problem ) { switch ( abortLevel ) { case AbortType : throw new AbortType ( this . compilationResult , problem ) ; case AbortMethod : throw new AbortMethod ( this . compilationResult , problem ) ; default : throw new AbortCompilationUnit ( this . compilationResult , problem ) ; } } public void analyseCode ( ) { if ( this . ignoreFurtherInvestigation ) return ; try { if ( this . types != null ) { for ( int i = <NUM_LIT:0> , count = this . types . length ; i < count ; i ++ ) { this . types [ i ] . analyseCode ( this . scope ) ; } } propagateInnerEmulationForAllLocalTypes ( ) ; } catch ( AbortCompilationUnit e ) { this . ignoreFurtherInvestigation = true ; return ; } } public void cleanUp ( ) { if ( this . types != null ) { for ( int i = <NUM_LIT:0> , max = this . types . length ; i < max ; i ++ ) { cleanUp ( this . types [ i ] ) ; } for ( int i = <NUM_LIT:0> , max = this . localTypeCount ; i < max ; i ++ ) { LocalTypeBinding localType = this . localTypes [ i ] ; localType . scope = null ; localType . enclosingCase = null ; } } this . compilationResult . recoveryScannerData = null ; ClassFile [ ] classFiles = this . compilationResult . getClassFiles ( ) ; for ( int i = <NUM_LIT:0> , max = classFiles . length ; i < max ; i ++ ) { ClassFile classFile = classFiles [ i ] ; classFile . referenceBinding = null ; classFile . innerClassesBindings = null ; classFile . missingTypes = null ; classFile . visitedTypes = null ; } this . suppressWarningAnnotations = null ; } private void cleanUp ( TypeDeclaration type ) { if ( type . memberTypes != null ) { for ( int i = <NUM_LIT:0> , max = type . memberTypes . length ; i < max ; i ++ ) { cleanUp ( type . memberTypes [ i ] ) ; } } if ( type . binding != null && type . binding . isAnnotationType ( ) ) this . compilationResult . hasAnnotations = true ; if ( type . binding != null ) { type . binding . scope = null ; } } public void checkUnusedImports ( ) { if ( this . scope . imports != null ) { for ( int i = <NUM_LIT:0> , max = this . scope . imports . length ; i < max ; i ++ ) { ImportBinding importBinding = this . scope . imports [ i ] ; ImportReference importReference = importBinding . reference ; if ( importReference != null && ( ( importReference . bits & ASTNode . Used ) == <NUM_LIT:0> ) ) { this . scope . problemReporter ( ) . unusedImport ( importReference ) ; } } } } public CompilationResult compilationResult ( ) { return this . compilationResult ; } public void createPackageInfoType ( ) { TypeDeclaration declaration = new TypeDeclaration ( this . compilationResult ) ; declaration . name = TypeConstants . PACKAGE_INFO_NAME ; declaration . modifiers = ClassFileConstants . AccDefault | ClassFileConstants . AccInterface ; declaration . javadoc = this . javadoc ; this . types [ <NUM_LIT:0> ] = declaration ; } public TypeDeclaration declarationOfType ( char [ ] [ ] typeName ) { for ( int i = <NUM_LIT:0> ; i < this . types . length ; i ++ ) { TypeDeclaration typeDecl = this . types [ i ] . declarationOfType ( typeName ) ; if ( typeDecl != null ) { return typeDecl ; } } return null ; } public void finalizeProblems ( ) { if ( this . suppressWarningsCount == <NUM_LIT:0> ) return ; int removed = <NUM_LIT:0> ; CategorizedProblem [ ] problems = this . compilationResult . problems ; int problemCount = this . compilationResult . problemCount ; IrritantSet [ ] foundIrritants = new IrritantSet [ this . suppressWarningsCount ] ; CompilerOptions options = this . scope . compilerOptions ( ) ; boolean hasMandatoryErrors = false ; nextProblem : for ( int iProblem = <NUM_LIT:0> , length = problemCount ; iProblem < length ; iProblem ++ ) { CategorizedProblem problem = problems [ iProblem ] ; int problemID = problem . getID ( ) ; int irritant = ProblemReporter . getIrritant ( problemID ) ; boolean isError = problem . isError ( ) ; if ( isError ) { if ( irritant == <NUM_LIT:0> ) { hasMandatoryErrors = true ; continue ; } if ( ! options . suppressOptionalErrors ) { continue ; } } int start = problem . getSourceStart ( ) ; int end = problem . getSourceEnd ( ) ; nextSuppress : for ( int iSuppress = <NUM_LIT:0> , suppressCount = this . suppressWarningsCount ; iSuppress < suppressCount ; iSuppress ++ ) { long position = this . suppressWarningScopePositions [ iSuppress ] ; int startSuppress = ( int ) ( position > > > <NUM_LIT:32> ) ; int endSuppress = ( int ) position ; if ( start < startSuppress ) continue nextSuppress ; if ( end > endSuppress ) continue nextSuppress ; if ( ! this . suppressWarningIrritants [ iSuppress ] . isSet ( irritant ) ) continue nextSuppress ; removed ++ ; problems [ iProblem ] = null ; this . compilationResult . removeProblem ( problem ) ; if ( foundIrritants [ iSuppress ] == null ) { foundIrritants [ iSuppress ] = new IrritantSet ( irritant ) ; } else { foundIrritants [ iSuppress ] . set ( irritant ) ; } continue nextProblem ; } } if ( removed > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , index = <NUM_LIT:0> ; i < problemCount ; i ++ ) { CategorizedProblem problem ; if ( ( problem = problems [ i ] ) != null ) { if ( i > index ) { problems [ index ++ ] = problem ; } else { index ++ ; } } } } if ( ! hasMandatoryErrors ) { int severity = options . getSeverity ( CompilerOptions . UnusedWarningToken ) ; if ( severity != ProblemSeverities . Ignore ) { boolean unusedWarningTokenIsWarning = ( severity & ProblemSeverities . Error ) == <NUM_LIT:0> ; for ( int iSuppress = <NUM_LIT:0> , suppressCount = this . suppressWarningsCount ; iSuppress < suppressCount ; iSuppress ++ ) { Annotation annotation = this . suppressWarningAnnotations [ iSuppress ] ; if ( annotation == null ) continue ; IrritantSet irritants = this . suppressWarningIrritants [ iSuppress ] ; if ( unusedWarningTokenIsWarning && irritants . areAllSet ( ) ) continue ; if ( irritants != foundIrritants [ iSuppress ] ) { MemberValuePair [ ] pairs = annotation . memberValuePairs ( ) ; pairLoop : for ( int iPair = <NUM_LIT:0> , pairCount = pairs . length ; iPair < pairCount ; iPair ++ ) { MemberValuePair pair = pairs [ iPair ] ; if ( CharOperation . equals ( pair . name , TypeConstants . VALUE ) ) { Expression value = pair . value ; if ( value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) value ; Expression [ ] inits = initializer . expressions ; if ( inits != null ) { for ( int iToken = <NUM_LIT:0> , tokenCount = inits . length ; iToken < tokenCount ; iToken ++ ) { Constant cst = inits [ iToken ] . constant ; if ( cst != Constant . NotAConstant && cst . typeID ( ) == TypeIds . T_JavaLangString ) { IrritantSet tokenIrritants = CompilerOptions . warningTokenToIrritants ( cst . stringValue ( ) ) ; if ( tokenIrritants != null && ! tokenIrritants . areAllSet ( ) && options . isAnyEnabled ( tokenIrritants ) && ( foundIrritants [ iSuppress ] == null || ! foundIrritants [ iSuppress ] . isAnySet ( tokenIrritants ) ) ) { if ( unusedWarningTokenIsWarning ) { int start = value . sourceStart , end = value . sourceEnd ; nextSuppress : for ( int jSuppress = iSuppress - <NUM_LIT:1> ; jSuppress >= <NUM_LIT:0> ; jSuppress -- ) { long position = this . suppressWarningScopePositions [ jSuppress ] ; int startSuppress = ( int ) ( position > > > <NUM_LIT:32> ) ; int endSuppress = ( int ) position ; if ( start < startSuppress ) continue nextSuppress ; if ( end > endSuppress ) continue nextSuppress ; if ( this . suppressWarningIrritants [ jSuppress ] . areAllSet ( ) ) break pairLoop ; } } this . scope . problemReporter ( ) . unusedWarningToken ( inits [ iToken ] ) ; } } } } } else { Constant cst = value . constant ; if ( cst != Constant . NotAConstant && cst . typeID ( ) == T_JavaLangString ) { IrritantSet tokenIrritants = CompilerOptions . warningTokenToIrritants ( cst . stringValue ( ) ) ; if ( tokenIrritants != null && ! tokenIrritants . areAllSet ( ) && options . isAnyEnabled ( tokenIrritants ) && ( foundIrritants [ iSuppress ] == null || ! foundIrritants [ iSuppress ] . isAnySet ( tokenIrritants ) ) ) { if ( unusedWarningTokenIsWarning ) { int start = value . sourceStart , end = value . sourceEnd ; nextSuppress : for ( int jSuppress = iSuppress - <NUM_LIT:1> ; jSuppress >= <NUM_LIT:0> ; jSuppress -- ) { long position = this . suppressWarningScopePositions [ jSuppress ] ; int startSuppress = ( int ) ( position > > > <NUM_LIT:32> ) ; int endSuppress = ( int ) position ; if ( start < startSuppress ) continue nextSuppress ; if ( end > endSuppress ) continue nextSuppress ; if ( this . suppressWarningIrritants [ jSuppress ] . areAllSet ( ) ) break pairLoop ; } } this . scope . problemReporter ( ) . unusedWarningToken ( value ) ; } } } break pairLoop ; } } } } } } } public void generateCode ( ) { if ( this . ignoreFurtherInvestigation ) { if ( this . types != null ) { for ( int i = <NUM_LIT:0> , count = this . types . length ; i < count ; i ++ ) { this . types [ i ] . ignoreFurtherInvestigation = true ; this . types [ i ] . generateCode ( this . scope ) ; } } return ; } try { if ( this . types != null ) { for ( int i = <NUM_LIT:0> , count = this . types . length ; i < count ; i ++ ) this . types [ i ] . generateCode ( this . scope ) ; } } catch ( AbortCompilationUnit e ) { } } public CompilationUnitDeclaration getCompilationUnitDeclaration ( ) { return this ; } public char [ ] getFileName ( ) { return this . compilationResult . getFileName ( ) ; } public char [ ] getMainTypeName ( ) { if ( this . compilationResult . compilationUnit == null ) { char [ ] fileName = this . compilationResult . getFileName ( ) ; int start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , fileName ) + <NUM_LIT:1> ; if ( start == <NUM_LIT:0> || start < CharOperation . lastIndexOf ( '<STR_LIT:\\>' , fileName ) ) start = CharOperation . lastIndexOf ( '<STR_LIT:\\>' , fileName ) + <NUM_LIT:1> ; int end = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , fileName ) ; if ( end == - <NUM_LIT:1> ) end = fileName . length ; return CharOperation . subarray ( fileName , start , end ) ; } else { return this . compilationResult . compilationUnit . getMainTypeName ( ) ; } } public boolean isEmpty ( ) { return ( this . currentPackage == null ) && ( this . imports == null ) && ( this . types == null ) ; } public boolean isPackageInfo ( ) { return CharOperation . equals ( getMainTypeName ( ) , TypeConstants . PACKAGE_INFO_NAME ) ; } public boolean isSuppressed ( CategorizedProblem problem ) { if ( this . suppressWarningsCount == <NUM_LIT:0> ) return false ; int irritant = ProblemReporter . getIrritant ( problem . getID ( ) ) ; if ( irritant == <NUM_LIT:0> ) return false ; int start = problem . getSourceStart ( ) ; int end = problem . getSourceEnd ( ) ; nextSuppress : for ( int iSuppress = <NUM_LIT:0> , suppressCount = this . suppressWarningsCount ; iSuppress < suppressCount ; iSuppress ++ ) { long position = this . suppressWarningScopePositions [ iSuppress ] ; int startSuppress = ( int ) ( position > > > <NUM_LIT:32> ) ; int endSuppress = ( int ) position ; if ( start < startSuppress ) continue nextSuppress ; if ( end > endSuppress ) continue nextSuppress ; if ( this . suppressWarningIrritants [ iSuppress ] . isSet ( irritant ) ) return true ; } return false ; } public boolean hasErrors ( ) { return this . ignoreFurtherInvestigation ; } public StringBuffer print ( int indent , StringBuffer output ) { if ( this . currentPackage != null ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . currentPackage . print ( <NUM_LIT:0> , output , false ) . append ( "<STR_LIT>" ) ; } if ( this . imports != null ) for ( int i = <NUM_LIT:0> ; i < this . imports . length ; i ++ ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; ImportReference currentImport = this . imports [ i ] ; if ( currentImport . isStatic ( ) ) { output . append ( "<STR_LIT>" ) ; } currentImport . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; } if ( this . types != null ) { for ( int i = <NUM_LIT:0> ; i < this . types . length ; i ++ ) { this . types [ i ] . print ( indent , output ) . append ( "<STR_LIT:n>" ) ; } } return output ; } public void propagateInnerEmulationForAllLocalTypes ( ) { this . isPropagatingInnerClassEmulation = true ; for ( int i = <NUM_LIT:0> , max = this . localTypeCount ; i < max ; i ++ ) { LocalTypeBinding localType = this . localTypes [ i ] ; if ( ( localType . scope . referenceType ( ) . bits & IsReachable ) != <NUM_LIT:0> ) { localType . updateInnerEmulationDependents ( ) ; } } } public void recordStringLiteral ( StringLiteral literal , boolean fromRecovery ) { if ( this . stringLiteralsStart != null ) { if ( this . stringLiteralsStart . contains ( literal . sourceStart ) ) return ; this . stringLiteralsStart . add ( literal . sourceStart ) ; } else if ( fromRecovery ) { this . stringLiteralsStart = new HashSetOfInt ( this . stringLiteralsPtr + STRING_LITERALS_INCREMENT ) ; for ( int i = <NUM_LIT:0> ; i < this . stringLiteralsPtr ; i ++ ) { this . stringLiteralsStart . add ( this . stringLiterals [ i ] . sourceStart ) ; } if ( this . stringLiteralsStart . contains ( literal . sourceStart ) ) return ; this . stringLiteralsStart . add ( literal . sourceStart ) ; } if ( this . stringLiterals == null ) { this . stringLiterals = new StringLiteral [ STRING_LITERALS_INCREMENT ] ; this . stringLiteralsPtr = <NUM_LIT:0> ; } else { int stackLength = this . stringLiterals . length ; if ( this . stringLiteralsPtr == stackLength ) { System . arraycopy ( this . stringLiterals , <NUM_LIT:0> , this . stringLiterals = new StringLiteral [ stackLength + STRING_LITERALS_INCREMENT ] , <NUM_LIT:0> , stackLength ) ; } } this . stringLiterals [ this . stringLiteralsPtr ++ ] = literal ; } public void recordSuppressWarnings ( IrritantSet irritants , Annotation annotation , int scopeStart , int scopeEnd ) { if ( this . suppressWarningIrritants == null ) { this . suppressWarningIrritants = new IrritantSet [ <NUM_LIT:3> ] ; this . suppressWarningAnnotations = new Annotation [ <NUM_LIT:3> ] ; this . suppressWarningScopePositions = new long [ <NUM_LIT:3> ] ; } else if ( this . suppressWarningIrritants . length == this . suppressWarningsCount ) { System . arraycopy ( this . suppressWarningIrritants , <NUM_LIT:0> , this . suppressWarningIrritants = new IrritantSet [ <NUM_LIT:2> * this . suppressWarningsCount ] , <NUM_LIT:0> , this . suppressWarningsCount ) ; System . arraycopy ( this . suppressWarningAnnotations , <NUM_LIT:0> , this . suppressWarningAnnotations = new Annotation [ <NUM_LIT:2> * this . suppressWarningsCount ] , <NUM_LIT:0> , this . suppressWarningsCount ) ; System . arraycopy ( this . suppressWarningScopePositions , <NUM_LIT:0> , this . suppressWarningScopePositions = new long [ <NUM_LIT:2> * this . suppressWarningsCount ] , <NUM_LIT:0> , this . suppressWarningsCount ) ; } final long scopePositions = ( ( long ) scopeStart << <NUM_LIT:32> ) + scopeEnd ; for ( int i = <NUM_LIT:0> , max = this . suppressWarningsCount ; i < max ; i ++ ) { if ( this . suppressWarningAnnotations [ i ] == annotation && this . suppressWarningScopePositions [ i ] == scopePositions && this . suppressWarningIrritants [ i ] . hasSameIrritants ( irritants ) ) { return ; } } this . suppressWarningIrritants [ this . suppressWarningsCount ] = irritants ; this . suppressWarningAnnotations [ this . suppressWarningsCount ] = annotation ; this . suppressWarningScopePositions [ this . suppressWarningsCount ++ ] = scopePositions ; } public void record ( LocalTypeBinding localType ) { if ( this . localTypeCount == <NUM_LIT:0> ) { this . localTypes = new LocalTypeBinding [ <NUM_LIT:5> ] ; } else if ( this . localTypeCount == this . localTypes . length ) { System . arraycopy ( this . localTypes , <NUM_LIT:0> , ( this . localTypes = new LocalTypeBinding [ this . localTypeCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . localTypeCount ) ; } this . localTypes [ this . localTypeCount ++ ] = localType ; } public void resolve ( ) { int startingTypeIndex = <NUM_LIT:0> ; boolean isPackageInfo = isPackageInfo ( ) ; if ( this . types != null && isPackageInfo ) { final TypeDeclaration syntheticTypeDeclaration = this . types [ <NUM_LIT:0> ] ; if ( syntheticTypeDeclaration . javadoc == null ) { syntheticTypeDeclaration . javadoc = new Javadoc ( syntheticTypeDeclaration . declarationSourceStart , syntheticTypeDeclaration . declarationSourceStart ) ; } syntheticTypeDeclaration . resolve ( this . scope ) ; if ( this . javadoc != null && syntheticTypeDeclaration . staticInitializerScope != null ) { this . javadoc . resolve ( syntheticTypeDeclaration . staticInitializerScope ) ; } startingTypeIndex = <NUM_LIT:1> ; } else { if ( this . javadoc != null ) { this . javadoc . resolve ( this . scope ) ; } } if ( this . currentPackage != null && this . currentPackage . annotations != null && ! isPackageInfo ) { this . scope . problemReporter ( ) . invalidFileNameForPackageAnnotations ( this . currentPackage . annotations [ <NUM_LIT:0> ] ) ; } try { if ( this . types != null ) { for ( int i = startingTypeIndex , count = this . types . length ; i < count ; i ++ ) { this . types [ i ] . resolve ( this . scope ) ; } } if ( ! this . compilationResult . hasMandatoryErrors ( ) ) checkUnusedImports ( ) ; reportNLSProblems ( ) ; } catch ( AbortCompilationUnit e ) { this . ignoreFurtherInvestigation = true ; return ; } } private void reportNLSProblems ( ) { if ( this . nlsTags != null || this . stringLiterals != null ) { final int stringLiteralsLength = this . stringLiteralsPtr ; final int nlsTagsLength = this . nlsTags == null ? <NUM_LIT:0> : this . nlsTags . length ; if ( stringLiteralsLength == <NUM_LIT:0> ) { if ( nlsTagsLength != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < nlsTagsLength ; i ++ ) { NLSTag tag = this . nlsTags [ i ] ; if ( tag != null ) { this . scope . problemReporter ( ) . unnecessaryNLSTags ( tag . start , tag . end ) ; } } } } else if ( nlsTagsLength == <NUM_LIT:0> ) { if ( this . stringLiterals . length != stringLiteralsLength ) { System . arraycopy ( this . stringLiterals , <NUM_LIT:0> , ( this . stringLiterals = new StringLiteral [ stringLiteralsLength ] ) , <NUM_LIT:0> , stringLiteralsLength ) ; } Arrays . sort ( this . stringLiterals , STRING_LITERAL_COMPARATOR ) ; for ( int i = <NUM_LIT:0> ; i < stringLiteralsLength ; i ++ ) { this . scope . problemReporter ( ) . nonExternalizedStringLiteral ( this . stringLiterals [ i ] ) ; } } else { if ( this . stringLiterals . length != stringLiteralsLength ) { System . arraycopy ( this . stringLiterals , <NUM_LIT:0> , ( this . stringLiterals = new StringLiteral [ stringLiteralsLength ] ) , <NUM_LIT:0> , stringLiteralsLength ) ; } Arrays . sort ( this . stringLiterals , STRING_LITERAL_COMPARATOR ) ; int indexInLine = <NUM_LIT:1> ; int lastLineNumber = - <NUM_LIT:1> ; StringLiteral literal = null ; int index = <NUM_LIT:0> ; int i = <NUM_LIT:0> ; stringLiteralsLoop : for ( ; i < stringLiteralsLength ; i ++ ) { literal = this . stringLiterals [ i ] ; final int literalLineNumber = literal . lineNumber ; if ( lastLineNumber != literalLineNumber ) { indexInLine = <NUM_LIT:1> ; lastLineNumber = literalLineNumber ; } else { indexInLine ++ ; } if ( index < nlsTagsLength ) { nlsTagsLoop : for ( ; index < nlsTagsLength ; index ++ ) { NLSTag tag = this . nlsTags [ index ] ; if ( tag == null ) continue nlsTagsLoop ; int tagLineNumber = tag . lineNumber ; if ( literalLineNumber < tagLineNumber ) { this . scope . problemReporter ( ) . nonExternalizedStringLiteral ( literal ) ; continue stringLiteralsLoop ; } else if ( literalLineNumber == tagLineNumber ) { if ( tag . index == indexInLine ) { this . nlsTags [ index ] = null ; index ++ ; continue stringLiteralsLoop ; } else { nlsTagsLoop2 : for ( int index2 = index + <NUM_LIT:1> ; index2 < nlsTagsLength ; index2 ++ ) { NLSTag tag2 = this . nlsTags [ index2 ] ; if ( tag2 == null ) continue nlsTagsLoop2 ; int tagLineNumber2 = tag2 . lineNumber ; if ( literalLineNumber == tagLineNumber2 ) { if ( tag2 . index == indexInLine ) { this . nlsTags [ index2 ] = null ; continue stringLiteralsLoop ; } else { continue nlsTagsLoop2 ; } } else { this . scope . problemReporter ( ) . nonExternalizedStringLiteral ( literal ) ; continue stringLiteralsLoop ; } } this . scope . problemReporter ( ) . nonExternalizedStringLiteral ( literal ) ; continue stringLiteralsLoop ; } } else { this . scope . problemReporter ( ) . unnecessaryNLSTags ( tag . start , tag . end ) ; continue nlsTagsLoop ; } } } break stringLiteralsLoop ; } for ( ; i < stringLiteralsLength ; i ++ ) { this . scope . problemReporter ( ) . nonExternalizedStringLiteral ( this . stringLiterals [ i ] ) ; } if ( index < nlsTagsLength ) { for ( ; index < nlsTagsLength ; index ++ ) { NLSTag tag = this . nlsTags [ index ] ; if ( tag != null ) { this . scope . problemReporter ( ) . unnecessaryNLSTags ( tag . start , tag . end ) ; } } } } } } public void tagAsHavingErrors ( ) { this . ignoreFurtherInvestigation = true ; } public void traverse ( ASTVisitor visitor , CompilationUnitScope unitScope ) { if ( this . ignoreFurtherInvestigation ) return ; try { if ( visitor . visit ( this , this . scope ) ) { if ( this . types != null && isPackageInfo ( ) ) { final TypeDeclaration syntheticTypeDeclaration = this . types [ <NUM_LIT:0> ] ; final MethodScope methodScope = syntheticTypeDeclaration . staticInitializerScope ; if ( this . javadoc != null && methodScope != null ) { this . javadoc . traverse ( visitor , methodScope ) ; } if ( this . currentPackage != null && methodScope != null ) { final Annotation [ ] annotations = this . currentPackage . annotations ; if ( annotations != null ) { int annotationsLength = annotations . length ; for ( int i = <NUM_LIT:0> ; i < annotationsLength ; i ++ ) { annotations [ i ] . traverse ( visitor , methodScope ) ; } } } } if ( this . currentPackage != null ) { this . currentPackage . traverse ( visitor , this . scope ) ; } if ( this . imports != null ) { int importLength = this . imports . length ; for ( int i = <NUM_LIT:0> ; i < importLength ; i ++ ) { this . imports [ i ] . traverse ( visitor , this . scope ) ; } } if ( this . types != null ) { int typesLength = this . types . length ; for ( int i = <NUM_LIT:0> ; i < typesLength ; i ++ ) { this . types [ i ] . traverse ( visitor , this . scope ) ; } } } visitor . endVisit ( this , this . scope ) ; } catch ( AbortCompilationUnit e ) { } } public CompilationUnitScope buildCompilationUnitScope ( LookupEnvironment lookupEnvironment ) { return new CompilationUnitScope ( this , lookupEnvironment ) ; } public org . eclipse . jdt . core . dom . CompilationUnit getSpecialDomCompilationUnit ( org . eclipse . jdt . core . dom . AST ast ) { return null ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; public abstract class ASTNode implements TypeConstants , TypeIds { public int sourceStart , sourceEnd ; public final static int Bit1 = <NUM_LIT> ; public final static int Bit2 = <NUM_LIT> ; public final static int Bit3 = <NUM_LIT> ; public final static int Bit4 = <NUM_LIT> ; public final static int Bit5 = <NUM_LIT> ; public final static int Bit6 = <NUM_LIT> ; public final static int Bit7 = <NUM_LIT> ; public final static int Bit8 = <NUM_LIT> ; public final static int Bit9 = <NUM_LIT> ; public final static int Bit10 = <NUM_LIT> ; public final static int Bit11 = <NUM_LIT> ; public final static int Bit12 = <NUM_LIT> ; public final static int Bit13 = <NUM_LIT> ; public final static int Bit14 = <NUM_LIT> ; public final static int Bit15 = <NUM_LIT> ; public final static int Bit16 = <NUM_LIT> ; public final static int Bit17 = <NUM_LIT> ; public final static int Bit18 = <NUM_LIT> ; public final static int Bit19 = <NUM_LIT> ; public final static int Bit20 = <NUM_LIT> ; public final static int Bit21 = <NUM_LIT> ; public final static int Bit22 = <NUM_LIT> ; public final static int Bit23 = <NUM_LIT> ; public final static int Bit24 = <NUM_LIT> ; public final static int Bit25 = <NUM_LIT> ; public final static int Bit26 = <NUM_LIT> ; public final static int Bit27 = <NUM_LIT> ; public final static int Bit28 = <NUM_LIT> ; public final static int Bit29 = <NUM_LIT> ; public final static int Bit30 = <NUM_LIT> ; public final static int Bit31 = <NUM_LIT> ; public final static int Bit32 = <NUM_LIT> ; public final static long Bit32L = <NUM_LIT> ; public final static long Bit33L = <NUM_LIT> ; public final static long Bit34L = <NUM_LIT> ; public final static long Bit35L = <NUM_LIT> ; public final static long Bit36L = <NUM_LIT> ; public final static long Bit37L = <NUM_LIT> ; public final static long Bit38L = <NUM_LIT> ; public final static long Bit39L = <NUM_LIT> ; public final static long Bit40L = <NUM_LIT> ; public final static long Bit41L = <NUM_LIT> ; public final static long Bit42L = <NUM_LIT> ; public final static long Bit43L = <NUM_LIT> ; public final static long Bit44L = <NUM_LIT> ; public final static long Bit45L = <NUM_LIT> ; public final static long Bit46L = <NUM_LIT> ; public final static long Bit47L = <NUM_LIT> ; public final static long Bit48L = <NUM_LIT> ; public final static long Bit49L = <NUM_LIT> ; public final static long Bit50L = <NUM_LIT> ; public final static long Bit51L = <NUM_LIT> ; public final static long Bit52L = <NUM_LIT> ; public final static long Bit53L = <NUM_LIT> ; public final static long Bit54L = <NUM_LIT> ; public final static long Bit55L = <NUM_LIT> ; public final static long Bit56L = <NUM_LIT> ; public final static long Bit57L = <NUM_LIT> ; public final static long Bit58L = <NUM_LIT> ; public final static long Bit59L = <NUM_LIT> ; public final static long Bit60L = <NUM_LIT> ; public final static long Bit61L = <NUM_LIT> ; public final static long Bit62L = <NUM_LIT> ; public final static long Bit63L = <NUM_LIT> ; public final static long Bit64L = <NUM_LIT> ; public int bits = IsReachable ; public static final int ReturnTypeIDMASK = Bit1 | Bit2 | Bit3 | Bit4 ; public static final int OperatorSHIFT = <NUM_LIT:6> ; public static final int OperatorMASK = Bit7 | Bit8 | Bit9 | Bit10 | Bit11 | Bit12 ; public static final int IsReturnedValue = Bit5 ; public static final int UnnecessaryCast = Bit15 ; public static final int DisableUnnecessaryCastCheck = Bit6 ; public static final int GenerateCheckcast = Bit7 ; public static final int UnsafeCast = Bit8 ; public static final int RestrictiveFlagMASK = Bit1 | Bit2 | Bit3 ; public static final int IsArgument = Bit3 ; public static final int FirstAssignmentToLocal = Bit4 ; public static final int NeedReceiverGenericCast = Bit19 ; public static final int IsImplicitThis = Bit3 ; public static final int DepthSHIFT = <NUM_LIT:5> ; public static final int DepthMASK = Bit6 | Bit7 | Bit8 | Bit9 | Bit10 | Bit11 | Bit12 | Bit13 ; public static final int IsReachable = Bit32 ; public static final int LabelUsed = Bit7 ; public static final int DocumentedFallthrough = Bit30 ; public static final int DocumentedCasesOmitted = Bit31 ; public static final int IsLocalDeclarationReachable = Bit31 ; public static final int IsSubRoutineEscaping = Bit15 ; public static final int IsTryBlockExiting = Bit30 ; public static final int ContainsAssertion = Bit1 ; public static final int IsLocalType = Bit9 ; public static final int IsAnonymousType = Bit10 ; public static final int IsMemberType = Bit11 ; public static final int HasAbstractMethods = Bit12 ; public static final int IsSecondaryType = Bit13 ; public static final int HasBeenGenerated = Bit14 ; public static final int HasLocalType = Bit2 ; public static final int HasBeenResolved = Bit5 ; public static final int ParenthesizedSHIFT = <NUM_LIT> ; public static final int ParenthesizedMASK = Bit22 | Bit23 | Bit24 | Bit25 | Bit26 | Bit27 | Bit28 | Bit29 ; public static final int IgnoreNoEffectAssignCheck = Bit30 ; public static final int IsStrictlyAssigned = Bit14 ; public static final int IsCompoundAssigned = Bit17 ; public static final int DiscardEnclosingInstance = Bit14 ; public static final int Unchecked = Bit17 ; public static final int ResolveJavadoc = Bit17 ; public static final int IsUsefulEmptyStatement = Bit1 ; public static final int UndocumentedEmptyBlock = Bit4 ; public static final int OverridingMethodWithSupercall = Bit5 ; public static final int CanBeStatic = Bit9 ; public static final int ErrorInSignature = Bit6 ; public static final int NeedFreeReturn = Bit7 ; public static final int IsDefaultConstructor = Bit8 ; public static final int HasAllMethodBodies = Bit5 ; public static final int IsImplicitUnit = Bit1 ; public static final int InsideJavadoc = Bit16 ; public static final int SuperAccess = Bit15 ; public static final int Empty = Bit19 ; public static final int IsElseIfStatement = Bit30 ; public static final int ThenExit = Bit31 ; public static final int IsElseStatementUnreachable = Bit8 ; public static final int IsThenStatementUnreachable = Bit9 ; public static final int IsSuperType = Bit5 ; public static final int IsVarArgs = Bit15 ; public static final int IgnoreRawTypeCheck = Bit31 ; public static final int IsAnnotationDefaultValue = Bit1 ; public static final int IsNonNull = Bit18 ; public static final int NeededScope = Bit30 ; public static final int OnDemand = Bit18 ; public static final int Used = Bit2 ; public static final int DidResolve = Bit19 ; public static final int IsAnySubRoutineEscaping = Bit30 ; public static final int IsSynchronized = Bit31 ; public static final int BlockExit = Bit30 ; public static final int IsRecovered = Bit6 ; public static final int HasSyntaxErrors = Bit20 ; public static final int INVOCATION_ARGUMENT_OK = <NUM_LIT:0> ; public static final int INVOCATION_ARGUMENT_UNCHECKED = <NUM_LIT:1> ; public static final int INVOCATION_ARGUMENT_WILDCARD = <NUM_LIT:2> ; public static final int IsUnionType = Bit30 ; public static final int IsDiamond = Bit20 ; public static final int InsideExpressionStatement = Bit5 ; public static final int IsSynthetic = ASTNode . Bit7 ; public ASTNode ( ) { super ( ) ; } private static int checkInvocationArgument ( BlockScope scope , Expression argument , TypeBinding parameterType , TypeBinding argumentType , TypeBinding originalParameterType ) { argument . computeConversion ( scope , parameterType , argumentType ) ; if ( argumentType != TypeBinding . NULL && parameterType . kind ( ) == Binding . WILDCARD_TYPE ) { WildcardBinding wildcard = ( WildcardBinding ) parameterType ; if ( wildcard . boundKind != Wildcard . SUPER ) { return INVOCATION_ARGUMENT_WILDCARD ; } } TypeBinding checkedParameterType = parameterType ; if ( argumentType != checkedParameterType && argumentType . needsUncheckedConversion ( checkedParameterType ) ) { scope . problemReporter ( ) . unsafeTypeConversion ( argument , argumentType , checkedParameterType ) ; return INVOCATION_ARGUMENT_UNCHECKED ; } return INVOCATION_ARGUMENT_OK ; } public static boolean checkInvocationArguments ( BlockScope scope , Expression receiver , TypeBinding receiverType , MethodBinding method , Expression [ ] arguments , TypeBinding [ ] argumentTypes , boolean argsContainCast , InvocationSite invocationSite ) { boolean is1_7 = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_7 ; if ( is1_7 && method . isPolymorphic ( ) ) { return false ; } TypeBinding [ ] params = method . parameters ; int paramLength = params . length ; boolean isRawMemberInvocation = ! method . isStatic ( ) && ! receiverType . isUnboundWildcard ( ) && method . declaringClass . isRawType ( ) && method . hasSubstitutedParameters ( ) ; boolean uncheckedBoundCheck = ( method . tagBits & TagBits . HasUncheckedTypeArgumentForBoundCheck ) != <NUM_LIT:0> ; MethodBinding rawOriginalGenericMethod = null ; if ( ! isRawMemberInvocation ) { if ( method instanceof ParameterizedGenericMethodBinding ) { ParameterizedGenericMethodBinding paramMethod = ( ParameterizedGenericMethodBinding ) method ; if ( paramMethod . isRaw && method . hasSubstitutedParameters ( ) ) { rawOriginalGenericMethod = method . original ( ) ; } } } int invocationStatus = INVOCATION_ARGUMENT_OK ; if ( arguments == null ) { if ( method . isVarargs ( ) ) { TypeBinding parameterType = ( ( ArrayBinding ) params [ paramLength - <NUM_LIT:1> ] ) . elementsType ( ) ; if ( ! parameterType . isReifiable ( ) && ( ! is1_7 || ( ( method . tagBits & TagBits . AnnotationSafeVarargs ) == <NUM_LIT:0> ) ) ) { scope . problemReporter ( ) . unsafeGenericArrayForVarargs ( parameterType , ( ASTNode ) invocationSite ) ; } } } else { if ( method . isVarargs ( ) ) { int lastIndex = paramLength - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < lastIndex ; i ++ ) { TypeBinding originalRawParam = rawOriginalGenericMethod == null ? null : rawOriginalGenericMethod . parameters [ i ] ; invocationStatus |= checkInvocationArgument ( scope , arguments [ i ] , params [ i ] , argumentTypes [ i ] , originalRawParam ) ; } int argLength = arguments . length ; if ( lastIndex <= argLength ) { TypeBinding parameterType = params [ lastIndex ] ; TypeBinding originalRawParam = null ; if ( paramLength != argLength || parameterType . dimensions ( ) != argumentTypes [ lastIndex ] . dimensions ( ) ) { parameterType = ( ( ArrayBinding ) parameterType ) . elementsType ( ) ; if ( ! parameterType . isReifiable ( ) && ( ! is1_7 || ( ( method . tagBits & TagBits . AnnotationSafeVarargs ) == <NUM_LIT:0> ) ) ) { scope . problemReporter ( ) . unsafeGenericArrayForVarargs ( parameterType , ( ASTNode ) invocationSite ) ; } originalRawParam = rawOriginalGenericMethod == null ? null : ( ( ArrayBinding ) rawOriginalGenericMethod . parameters [ lastIndex ] ) . elementsType ( ) ; } for ( int i = lastIndex ; i < argLength ; i ++ ) { invocationStatus |= checkInvocationArgument ( scope , arguments [ i ] , parameterType , argumentTypes [ i ] , originalRawParam ) ; } } if ( paramLength == argLength ) { int varargsIndex = paramLength - <NUM_LIT:1> ; ArrayBinding varargsType = ( ArrayBinding ) params [ varargsIndex ] ; TypeBinding lastArgType = argumentTypes [ varargsIndex ] ; int dimensions ; if ( lastArgType == TypeBinding . NULL ) { if ( ! ( varargsType . leafComponentType ( ) . isBaseType ( ) && varargsType . dimensions ( ) == <NUM_LIT:1> ) ) scope . problemReporter ( ) . varargsArgumentNeedCast ( method , lastArgType , invocationSite ) ; } else if ( varargsType . dimensions <= ( dimensions = lastArgType . dimensions ( ) ) ) { if ( lastArgType . leafComponentType ( ) . isBaseType ( ) ) { dimensions -- ; } if ( varargsType . dimensions < dimensions ) { scope . problemReporter ( ) . varargsArgumentNeedCast ( method , lastArgType , invocationSite ) ; } else if ( varargsType . dimensions == dimensions && lastArgType != varargsType && lastArgType . leafComponentType ( ) . erasure ( ) != varargsType . leafComponentType . erasure ( ) && lastArgType . isCompatibleWith ( varargsType . elementsType ( ) ) && lastArgType . isCompatibleWith ( varargsType ) ) { scope . problemReporter ( ) . varargsArgumentNeedCast ( method , lastArgType , invocationSite ) ; } } } } else { for ( int i = <NUM_LIT:0> ; i < paramLength ; i ++ ) { TypeBinding originalRawParam = rawOriginalGenericMethod == null ? null : rawOriginalGenericMethod . parameters [ i ] ; invocationStatus |= checkInvocationArgument ( scope , arguments [ i ] , params [ i ] , argumentTypes [ i ] , originalRawParam ) ; } } if ( argsContainCast ) { CastExpression . checkNeedForArgumentCasts ( scope , receiver , receiverType , method , arguments , argumentTypes , invocationSite ) ; } } if ( ( invocationStatus & INVOCATION_ARGUMENT_WILDCARD ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . wildcardInvocation ( ( ASTNode ) invocationSite , receiverType , method , argumentTypes ) ; } else if ( ! method . isStatic ( ) && ! receiverType . isUnboundWildcard ( ) && method . declaringClass . isRawType ( ) && method . hasSubstitutedParameters ( ) ) { if ( scope . compilerOptions ( ) . reportUnavoidableGenericTypeProblems || receiver == null || ! receiver . forcedToBeRaw ( scope . referenceContext ( ) ) ) { scope . problemReporter ( ) . unsafeRawInvocation ( ( ASTNode ) invocationSite , method ) ; } } else if ( rawOriginalGenericMethod != null || uncheckedBoundCheck || ( ( invocationStatus & INVOCATION_ARGUMENT_UNCHECKED ) != <NUM_LIT:0> && method instanceof ParameterizedGenericMethodBinding ) ) { scope . problemReporter ( ) . unsafeRawGenericMethodInvocation ( ( ASTNode ) invocationSite , method , argumentTypes ) ; return true ; } return false ; } public ASTNode concreteStatement ( ) { return this ; } public final boolean isFieldUseDeprecated ( FieldBinding field , Scope scope , int filteredBits ) { if ( ( this . bits & ASTNode . InsideJavadoc ) == <NUM_LIT:0> && ( filteredBits & IsStrictlyAssigned ) == <NUM_LIT:0> && field . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInField ( field ) ) { if ( ( ( filteredBits & IsCompoundAssigned ) != <NUM_LIT:0> ) ) field . original ( ) . compoundUseFlag ++ ; else field . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( ( field . modifiers & ExtraCompilerModifiers . AccRestrictedAccess ) != <NUM_LIT:0> ) { AccessRestriction restriction = scope . environment ( ) . getAccessRestriction ( field . declaringClass . erasure ( ) ) ; if ( restriction != null ) { scope . problemReporter ( ) . forbiddenReference ( field , this , restriction . classpathEntryType , restriction . classpathEntryName , restriction . getProblemId ( ) ) ; } } if ( ! field . isViewedAsDeprecated ( ) ) return false ; if ( scope . isDefinedInSameUnit ( field . declaringClass ) ) return false ; if ( ! scope . compilerOptions ( ) . reportDeprecationInsideDeprecatedCode && scope . isInsideDeprecatedCode ( ) ) return false ; return true ; } public boolean isImplicitThis ( ) { return false ; } public final boolean isMethodUseDeprecated ( MethodBinding method , Scope scope , boolean isExplicitUse ) { if ( ( this . bits & ASTNode . InsideJavadoc ) == <NUM_LIT:0> && method . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInMethod ( method ) ) { method . original ( ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( isExplicitUse && ( method . modifiers & ExtraCompilerModifiers . AccRestrictedAccess ) != <NUM_LIT:0> ) { AccessRestriction restriction = scope . environment ( ) . getAccessRestriction ( method . declaringClass . erasure ( ) ) ; if ( restriction != null ) { scope . problemReporter ( ) . forbiddenReference ( method , this , restriction . classpathEntryType , restriction . classpathEntryName , restriction . getProblemId ( ) ) ; } } if ( ! method . isViewedAsDeprecated ( ) ) return false ; if ( scope . isDefinedInSameUnit ( method . declaringClass ) ) return false ; if ( ! isExplicitUse && ( method . modifiers & ClassFileConstants . AccDeprecated ) == <NUM_LIT:0> ) { return false ; } if ( ! scope . compilerOptions ( ) . reportDeprecationInsideDeprecatedCode && scope . isInsideDeprecatedCode ( ) ) return false ; return true ; } public boolean isSuper ( ) { return false ; } public boolean isThis ( ) { return false ; } public final boolean isTypeUseDeprecated ( TypeBinding type , Scope scope ) { if ( type . isArrayType ( ) ) { type = ( ( ArrayBinding ) type ) . leafComponentType ; } if ( type . isBaseType ( ) ) return false ; ReferenceBinding refType = ( ReferenceBinding ) type ; if ( ( this . bits & ASTNode . InsideJavadoc ) == <NUM_LIT:0> && refType . isOrEnclosedByPrivateType ( ) && ! scope . isDefinedInType ( refType ) ) { ( ( ReferenceBinding ) refType . erasure ( ) ) . modifiers |= ExtraCompilerModifiers . AccLocallyUsed ; } if ( refType . hasRestrictedAccess ( ) ) { AccessRestriction restriction = scope . environment ( ) . getAccessRestriction ( type . erasure ( ) ) ; if ( restriction != null ) { scope . problemReporter ( ) . forbiddenReference ( type , this , restriction . classpathEntryType , restriction . classpathEntryName , restriction . getProblemId ( ) ) ; } } refType . initializeDeprecatedAnnotationTagBits ( ) ; if ( ! refType . isViewedAsDeprecated ( ) ) return false ; if ( scope . isDefinedInSameUnit ( refType ) ) return false ; if ( ! scope . compilerOptions ( ) . reportDeprecationInsideDeprecatedCode && scope . isInsideDeprecatedCode ( ) ) return false ; return true ; } public abstract StringBuffer print ( int indent , StringBuffer output ) ; public static StringBuffer printAnnotations ( Annotation [ ] annotations , StringBuffer output ) { int length = annotations . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { annotations [ i ] . print ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+0020>" ) ; } return output ; } public static StringBuffer printIndent ( int indent , StringBuffer output ) { for ( int i = indent ; i > <NUM_LIT:0> ; i -- ) output . append ( "<STR_LIT:U+0020U+0020>" ) ; return output ; } public static StringBuffer printModifiers ( int modifiers , StringBuffer output ) { if ( ( modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccProtected ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccSynchronized ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccVolatile ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccTransient ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccNative ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ) output . append ( "<STR_LIT>" ) ; return output ; } public static void resolveAnnotations ( BlockScope scope , Annotation [ ] sourceAnnotations , Binding recipient ) { AnnotationBinding [ ] annotations = null ; int length = sourceAnnotations == null ? <NUM_LIT:0> : sourceAnnotations . length ; if ( recipient != null ) { switch ( recipient . kind ( ) ) { case Binding . PACKAGE : PackageBinding packageBinding = ( PackageBinding ) recipient ; if ( ( packageBinding . tagBits & TagBits . AnnotationResolved ) != <NUM_LIT:0> ) return ; packageBinding . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; break ; case Binding . TYPE : case Binding . GENERIC_TYPE : ReferenceBinding type = ( ReferenceBinding ) recipient ; if ( ( type . tagBits & TagBits . AnnotationResolved ) != <NUM_LIT:0> ) return ; type . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; if ( length > <NUM_LIT:0> ) { annotations = new AnnotationBinding [ length ] ; type . setAnnotations ( annotations ) ; } break ; case Binding . METHOD : MethodBinding method = ( MethodBinding ) recipient ; if ( ( method . tagBits & TagBits . AnnotationResolved ) != <NUM_LIT:0> ) return ; method . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; if ( length > <NUM_LIT:0> ) { annotations = new AnnotationBinding [ length ] ; method . setAnnotations ( annotations ) ; } break ; case Binding . FIELD : FieldBinding field = ( FieldBinding ) recipient ; if ( ( field . tagBits & TagBits . AnnotationResolved ) != <NUM_LIT:0> ) return ; field . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; if ( length > <NUM_LIT:0> ) { annotations = new AnnotationBinding [ length ] ; field . setAnnotations ( annotations ) ; } break ; case Binding . LOCAL : LocalVariableBinding local = ( LocalVariableBinding ) recipient ; if ( ( local . tagBits & TagBits . AnnotationResolved ) != <NUM_LIT:0> ) return ; local . tagBits |= ( TagBits . AnnotationResolved | TagBits . DeprecatedAnnotationResolved ) ; if ( length > <NUM_LIT:0> ) { annotations = new AnnotationBinding [ length ] ; local . setAnnotations ( annotations , scope ) ; } break ; default : return ; } } if ( sourceAnnotations == null ) return ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Annotation annotation = sourceAnnotations [ i ] ; final Binding annotationRecipient = annotation . recipient ; if ( annotationRecipient != null && recipient != null ) { switch ( recipient . kind ( ) ) { case Binding . FIELD : FieldBinding field = ( FieldBinding ) recipient ; field . tagBits = ( ( FieldBinding ) annotationRecipient ) . tagBits ; if ( annotations != null ) { for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { Annotation annot = sourceAnnotations [ j ] ; annotations [ j ] = annot . getCompilerAnnotation ( ) ; } } break ; case Binding . LOCAL : LocalVariableBinding local = ( LocalVariableBinding ) recipient ; long otherLocalTagBits = ( ( LocalVariableBinding ) annotationRecipient ) . tagBits ; local . tagBits = otherLocalTagBits ; if ( ( otherLocalTagBits & TagBits . AnnotationSuppressWarnings ) == <NUM_LIT:0> ) { if ( annotations != null ) { for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { Annotation annot = sourceAnnotations [ j ] ; annotations [ j ] = annot . getCompilerAnnotation ( ) ; } } } else if ( annotations != null ) { LocalDeclaration localDeclaration = local . declaration ; int declarationSourceEnd = localDeclaration . declarationSourceEnd ; int declarationSourceStart = localDeclaration . declarationSourceStart ; for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { Annotation annot = sourceAnnotations [ j ] ; AnnotationBinding annotationBinding = annot . getCompilerAnnotation ( ) ; annotations [ j ] = annotationBinding ; if ( annotationBinding != null ) { final ReferenceBinding annotationType = annotationBinding . getAnnotationType ( ) ; if ( annotationType != null && annotationType . id == TypeIds . T_JavaLangSuppressWarnings ) { annot . recordSuppressWarnings ( scope , declarationSourceStart , declarationSourceEnd , scope . compilerOptions ( ) . suppressWarnings ) ; } } } } break ; } return ; } else { annotation . recipient = recipient ; annotation . resolveType ( scope ) ; if ( annotations != null ) { annotations [ i ] = annotation . getCompilerAnnotation ( ) ; } } } if ( annotations != null ) { AnnotationBinding [ ] distinctAnnotations = annotations ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { AnnotationBinding annotation = distinctAnnotations [ i ] ; if ( annotation == null ) continue ; TypeBinding annotationType = annotation . getAnnotationType ( ) ; boolean foundDuplicate = false ; for ( int j = i + <NUM_LIT:1> ; j < length ; j ++ ) { AnnotationBinding otherAnnotation = distinctAnnotations [ j ] ; if ( otherAnnotation == null ) continue ; if ( otherAnnotation . getAnnotationType ( ) == annotationType ) { foundDuplicate = true ; if ( distinctAnnotations == annotations ) { System . arraycopy ( distinctAnnotations , <NUM_LIT:0> , distinctAnnotations = new AnnotationBinding [ length ] , <NUM_LIT:0> , length ) ; } distinctAnnotations [ j ] = null ; scope . problemReporter ( ) . duplicateAnnotation ( sourceAnnotations [ j ] ) ; } } if ( foundDuplicate ) { scope . problemReporter ( ) . duplicateAnnotation ( sourceAnnotations [ i ] ) ; } } } } public static void resolveDeprecatedAnnotations ( BlockScope scope , Annotation [ ] annotations , Binding recipient ) { if ( recipient != null ) { int kind = recipient . kind ( ) ; if ( annotations != null ) { int length ; if ( ( length = annotations . length ) >= <NUM_LIT:0> ) { switch ( kind ) { case Binding . PACKAGE : PackageBinding packageBinding = ( PackageBinding ) recipient ; if ( ( packageBinding . tagBits & TagBits . DeprecatedAnnotationResolved ) != <NUM_LIT:0> ) return ; break ; case Binding . TYPE : case Binding . GENERIC_TYPE : ReferenceBinding type = ( ReferenceBinding ) recipient ; if ( ( type . tagBits & TagBits . DeprecatedAnnotationResolved ) != <NUM_LIT:0> ) return ; break ; case Binding . METHOD : MethodBinding method = ( MethodBinding ) recipient ; if ( ( method . tagBits & TagBits . DeprecatedAnnotationResolved ) != <NUM_LIT:0> ) return ; break ; case Binding . FIELD : FieldBinding field = ( FieldBinding ) recipient ; if ( ( field . tagBits & TagBits . DeprecatedAnnotationResolved ) != <NUM_LIT:0> ) return ; break ; case Binding . LOCAL : LocalVariableBinding local = ( LocalVariableBinding ) recipient ; if ( ( local . tagBits & TagBits . DeprecatedAnnotationResolved ) != <NUM_LIT:0> ) return ; break ; default : return ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { TypeReference annotationTypeRef = annotations [ i ] . type ; if ( ! CharOperation . equals ( TypeConstants . JAVA_LANG_DEPRECATED [ <NUM_LIT:2> ] , annotationTypeRef . getLastToken ( ) ) ) return ; TypeBinding annotationType = annotations [ i ] . type . resolveType ( scope ) ; if ( annotationType != null && annotationType . isValidBinding ( ) && annotationType . id == TypeIds . T_JavaLangDeprecated ) { switch ( kind ) { case Binding . PACKAGE : PackageBinding packageBinding = ( PackageBinding ) recipient ; packageBinding . tagBits |= ( TagBits . AnnotationDeprecated | TagBits . DeprecatedAnnotationResolved ) ; return ; case Binding . TYPE : case Binding . GENERIC_TYPE : case Binding . TYPE_PARAMETER : ReferenceBinding type = ( ReferenceBinding ) recipient ; type . tagBits |= ( TagBits . AnnotationDeprecated | TagBits . DeprecatedAnnotationResolved ) ; return ; case Binding . METHOD : MethodBinding method = ( MethodBinding ) recipient ; method . tagBits |= ( TagBits . AnnotationDeprecated | TagBits . DeprecatedAnnotationResolved ) ; return ; case Binding . FIELD : FieldBinding field = ( FieldBinding ) recipient ; field . tagBits |= ( TagBits . AnnotationDeprecated | TagBits . DeprecatedAnnotationResolved ) ; return ; case Binding . LOCAL : LocalVariableBinding local = ( LocalVariableBinding ) recipient ; local . tagBits |= ( TagBits . AnnotationDeprecated | TagBits . DeprecatedAnnotationResolved ) ; return ; default : return ; } } } } } switch ( kind ) { case Binding . PACKAGE : PackageBinding packageBinding = ( PackageBinding ) recipient ; packageBinding . tagBits |= TagBits . DeprecatedAnnotationResolved ; return ; case Binding . TYPE : case Binding . GENERIC_TYPE : case Binding . TYPE_PARAMETER : ReferenceBinding type = ( ReferenceBinding ) recipient ; type . tagBits |= TagBits . DeprecatedAnnotationResolved ; return ; case Binding . METHOD : MethodBinding method = ( MethodBinding ) recipient ; method . tagBits |= TagBits . DeprecatedAnnotationResolved ; return ; case Binding . FIELD : FieldBinding field = ( FieldBinding ) recipient ; field . tagBits |= TagBits . DeprecatedAnnotationResolved ; return ; case Binding . LOCAL : LocalVariableBinding local = ( LocalVariableBinding ) recipient ; local . tagBits |= TagBits . DeprecatedAnnotationResolved ; return ; default : return ; } } } public int sourceStart ( ) { return this . sourceStart ; } public int sourceEnd ( ) { return this . sourceEnd ; } public String toString ( ) { return print ( <NUM_LIT:0> , new StringBuffer ( <NUM_LIT:30> ) ) . toString ( ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ForStatement extends Statement { public Statement [ ] initializations ; public Expression condition ; public Statement [ ] increments ; public Statement action ; public BlockScope scope ; private BranchLabel breakLabel , continueLabel ; int preCondInitStateIndex = - <NUM_LIT:1> ; int preIncrementsInitStateIndex = - <NUM_LIT:1> ; int condIfTrueInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; public ForStatement ( Statement [ ] initializations , Expression condition , Statement [ ] increments , Statement action , boolean neededScope , int s , int e ) { this . sourceStart = s ; this . sourceEnd = e ; this . initializations = initializations ; this . condition = condition ; this . increments = increments ; this . action = action ; if ( action instanceof EmptyStatement ) action . bits |= ASTNode . IsUsefulEmptyStatement ; if ( neededScope ) { this . bits |= ASTNode . NeededScope ; } } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . breakLabel = new BranchLabel ( ) ; this . continueLabel = new BranchLabel ( ) ; int initialComplaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; if ( this . initializations != null ) { for ( int i = <NUM_LIT:0> , count = this . initializations . length ; i < count ; i ++ ) { flowInfo = this . initializations [ i ] . analyseCode ( this . scope , flowContext , flowInfo ) ; } } this . preCondInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; Constant cst = this . condition == null ? null : this . condition . constant ; boolean isConditionTrue = cst == null || ( cst != Constant . NotAConstant && cst . booleanValue ( ) == true ) ; boolean isConditionFalse = cst != null && ( cst != Constant . NotAConstant && cst . booleanValue ( ) == false ) ; cst = this . condition == null ? null : this . condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedTrue = cst == null || ( cst != Constant . NotAConstant && cst . booleanValue ( ) == true ) ; boolean isConditionOptimizedFalse = cst != null && ( cst != Constant . NotAConstant && cst . booleanValue ( ) == false ) ; LoopingFlowContext condLoopContext = null ; FlowInfo condInfo = flowInfo . nullInfoLessUnconditionalCopy ( ) ; if ( this . condition != null ) { if ( ! isConditionTrue ) { condInfo = this . condition . analyseCode ( this . scope , ( condLoopContext = new LoopingFlowContext ( flowContext , flowInfo , this , null , null , this . scope ) ) , condInfo ) ; if ( ( this . condition . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . condition . checkNPE ( currentScope , flowContext , flowInfo ) ; } } } LoopingFlowContext loopingContext ; UnconditionalFlowInfo actionInfo ; if ( this . action == null || ( this . action . isEmptyBlock ( ) && currentScope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_3 ) ) { if ( condLoopContext != null ) condLoopContext . complainOnDeferredFinalChecks ( this . scope , condInfo ) ; if ( isConditionTrue ) { if ( condLoopContext != null ) { condLoopContext . complainOnDeferredNullChecks ( currentScope , condInfo ) ; } return FlowInfo . DEAD_END ; } else { if ( isConditionFalse ) { this . continueLabel = null ; } actionInfo = condInfo . initsWhenTrue ( ) . unconditionalCopy ( ) ; loopingContext = new LoopingFlowContext ( flowContext , flowInfo , this , this . breakLabel , this . continueLabel , this . scope ) ; } } else { loopingContext = new LoopingFlowContext ( flowContext , flowInfo , this , this . breakLabel , this . continueLabel , this . scope ) ; FlowInfo initsWhenTrue = condInfo . initsWhenTrue ( ) ; this . condIfTrueInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( initsWhenTrue ) ; if ( isConditionFalse ) { actionInfo = FlowInfo . DEAD_END ; } else { actionInfo = initsWhenTrue . unconditionalCopy ( ) ; if ( isConditionOptimizedFalse ) { actionInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } } if ( this . action . complainIfUnreachable ( actionInfo , this . scope , initialComplaintLevel , true ) < Statement . COMPLAINED_UNREACHABLE ) { actionInfo = this . action . analyseCode ( this . scope , loopingContext , actionInfo ) . unconditionalInits ( ) ; } if ( ( actionInfo . tagBits & loopingContext . initsOnContinue . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) { this . continueLabel = null ; } else { if ( condLoopContext != null ) { condLoopContext . complainOnDeferredFinalChecks ( this . scope , condInfo ) ; } actionInfo = actionInfo . mergedWith ( loopingContext . initsOnContinue ) ; loopingContext . complainOnDeferredFinalChecks ( this . scope , actionInfo ) ; } } FlowInfo exitBranch = flowInfo . copy ( ) ; LoopingFlowContext incrementContext = null ; if ( this . continueLabel != null ) { if ( this . increments != null ) { incrementContext = new LoopingFlowContext ( flowContext , flowInfo , this , null , null , this . scope ) ; FlowInfo incrementInfo = actionInfo ; this . preIncrementsInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( incrementInfo ) ; for ( int i = <NUM_LIT:0> , count = this . increments . length ; i < count ; i ++ ) { incrementInfo = this . increments [ i ] . analyseCode ( this . scope , incrementContext , incrementInfo ) ; } incrementContext . complainOnDeferredFinalChecks ( this . scope , actionInfo = incrementInfo . unconditionalInits ( ) ) ; } exitBranch . addPotentialInitializationsFrom ( actionInfo ) . addInitializationsFrom ( condInfo . initsWhenFalse ( ) ) ; } else { exitBranch . addInitializationsFrom ( condInfo . initsWhenFalse ( ) ) ; if ( this . increments != null ) { if ( initialComplaintLevel == Statement . NOT_COMPLAINED ) { currentScope . problemReporter ( ) . fakeReachable ( this . increments [ <NUM_LIT:0> ] ) ; } } } if ( condLoopContext != null ) { condLoopContext . complainOnDeferredNullChecks ( currentScope , actionInfo ) ; } loopingContext . complainOnDeferredNullChecks ( currentScope , actionInfo ) ; if ( incrementContext != null ) { incrementContext . complainOnDeferredNullChecks ( currentScope , actionInfo ) ; } if ( loopingContext . hasEscapingExceptions ( ) ) { FlowInfo loopbackFlowInfo = flowInfo . copy ( ) ; if ( this . continueLabel != null ) { loopbackFlowInfo . mergedWith ( actionInfo . unconditionalCopy ( ) ) ; } loopingContext . simulateThrowAfterLoopBack ( loopbackFlowInfo ) ; } FlowInfo mergedInfo = FlowInfo . mergedOptimizedBranches ( ( loopingContext . initsOnBreak . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? loopingContext . initsOnBreak : flowInfo . addInitializationsFrom ( loopingContext . initsOnBreak ) , isConditionOptimizedTrue , exitBranch , isConditionOptimizedFalse , ! isConditionTrue ) ; if ( this . initializations != null ) { for ( int i = <NUM_LIT:0> ; i < this . initializations . length ; i ++ ) { Statement init = this . initializations [ i ] ; if ( init instanceof LocalDeclaration ) { LocalVariableBinding binding = ( ( LocalDeclaration ) init ) . binding ; mergedInfo . resetAssignmentInfo ( binding ) ; } } } this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; if ( this . initializations != null ) { for ( int i = <NUM_LIT:0> , max = this . initializations . length ; i < max ; i ++ ) { this . initializations [ i ] . generateCode ( this . scope , codeStream ) ; } } Constant cst = this . condition == null ? null : this . condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedFalse = cst != null && ( cst != Constant . NotAConstant && cst . booleanValue ( ) == false ) ; if ( isConditionOptimizedFalse ) { this . condition . generateCode ( this . scope , codeStream , false ) ; if ( ( this . bits & ASTNode . NeededScope ) != <NUM_LIT:0> ) { codeStream . exitUserScope ( this . scope ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } BranchLabel actionLabel = new BranchLabel ( codeStream ) ; actionLabel . tagBits |= BranchLabel . USED ; BranchLabel conditionLabel = new BranchLabel ( codeStream ) ; this . breakLabel . initialize ( codeStream ) ; if ( this . continueLabel == null ) { conditionLabel . place ( ) ; if ( ( this . condition != null ) && ( this . condition . constant == Constant . NotAConstant ) ) { this . condition . generateOptimizedBoolean ( this . scope , codeStream , null , this . breakLabel , true ) ; } } else { this . continueLabel . initialize ( codeStream ) ; if ( ( this . condition != null ) && ( this . condition . constant == Constant . NotAConstant ) && ! ( ( this . action == null || this . action . isEmptyBlock ( ) ) && ( this . increments == null ) ) ) { conditionLabel . tagBits |= BranchLabel . USED ; int jumpPC = codeStream . position ; codeStream . goto_ ( conditionLabel ) ; codeStream . recordPositionsFrom ( jumpPC , this . condition . sourceStart ) ; } } if ( this . action != null ) { if ( this . condIfTrueInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . condIfTrueInitStateIndex ) ; } actionLabel . place ( ) ; this . action . generateCode ( this . scope , codeStream ) ; } else { actionLabel . place ( ) ; } if ( this . preIncrementsInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preIncrementsInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . preIncrementsInitStateIndex ) ; } if ( this . continueLabel != null ) { this . continueLabel . place ( ) ; if ( this . increments != null ) { for ( int i = <NUM_LIT:0> , max = this . increments . length ; i < max ; i ++ ) { this . increments [ i ] . generateCode ( this . scope , codeStream ) ; } } if ( this . preCondInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preCondInitStateIndex ) ; } conditionLabel . place ( ) ; if ( ( this . condition != null ) && ( this . condition . constant == Constant . NotAConstant ) ) { this . condition . generateOptimizedBoolean ( this . scope , codeStream , actionLabel , null , true ) ; } else { codeStream . goto_ ( actionLabel ) ; } } else { if ( this . preCondInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preCondInitStateIndex ) ; } } if ( ( this . bits & ASTNode . NeededScope ) != <NUM_LIT:0> ) { codeStream . exitUserScope ( this . scope ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } this . breakLabel . place ( ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( "<STR_LIT>" ) ; if ( this . initializations != null ) { for ( int i = <NUM_LIT:0> ; i < this . initializations . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . initializations [ i ] . print ( <NUM_LIT:0> , output ) ; } } output . append ( "<STR_LIT:;U+0020>" ) ; if ( this . condition != null ) this . condition . printExpression ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:;U+0020>" ) ; if ( this . increments != null ) { for ( int i = <NUM_LIT:0> ; i < this . increments . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( "<STR_LIT:U+002CU+0020>" ) ; this . increments [ i ] . print ( <NUM_LIT:0> , output ) ; } } output . append ( "<STR_LIT>" ) ; if ( this . action == null ) output . append ( '<CHAR_LIT:;>' ) ; else { output . append ( '<STR_LIT:\n>' ) ; this . action . printStatement ( tab + <NUM_LIT:1> , output ) ; } return output ; } public void resolve ( BlockScope upperScope ) { this . scope = ( this . bits & ASTNode . NeededScope ) != <NUM_LIT:0> ? new BlockScope ( upperScope ) : upperScope ; if ( this . initializations != null ) for ( int i = <NUM_LIT:0> , length = this . initializations . length ; i < length ; i ++ ) this . initializations [ i ] . resolve ( this . scope ) ; if ( this . condition != null ) { TypeBinding type = this . condition . resolveTypeExpecting ( this . scope , TypeBinding . BOOLEAN ) ; this . condition . computeConversion ( this . scope , type , type ) ; } if ( this . increments != null ) for ( int i = <NUM_LIT:0> , length = this . increments . length ; i < length ; i ++ ) this . increments [ i ] . resolve ( this . scope ) ; if ( this . action != null ) this . action . resolve ( this . scope ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { if ( this . initializations != null ) { int initializationsLength = this . initializations . length ; for ( int i = <NUM_LIT:0> ; i < initializationsLength ; i ++ ) this . initializations [ i ] . traverse ( visitor , this . scope ) ; } if ( this . condition != null ) this . condition . traverse ( visitor , this . scope ) ; if ( this . increments != null ) { int incrementsLength = this . increments . length ; for ( int i = <NUM_LIT:0> ; i < incrementsLength ; i ++ ) this . increments [ i ] . traverse ( visitor , this . scope ) ; } if ( this . action != null ) this . action . traverse ( visitor , this . scope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class JavadocReturnStatement extends ReturnStatement { public JavadocReturnStatement ( int s , int e ) { super ( null , s , e ) ; this . bits |= ( ASTNode . InsideJavadoc | ASTNode . Empty ) ; } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; MethodBinding methodBinding = null ; TypeBinding methodType = ( methodScope . referenceContext instanceof AbstractMethodDeclaration ) ? ( ( methodBinding = ( ( AbstractMethodDeclaration ) methodScope . referenceContext ) . binding ) == null ? null : methodBinding . returnType ) : TypeBinding . VOID ; if ( methodType == null || methodType == TypeBinding . VOID ) { scope . problemReporter ( ) . javadocUnexpectedTag ( this . sourceStart , this . sourceEnd ) ; } else if ( ( this . bits & ASTNode . Empty ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . javadocEmptyReturnTag ( this . sourceStart , this . sourceEnd , scope . getDeclarationModifiers ( ) ) ; } } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( "<STR_LIT>" ) ; if ( ( this . bits & ASTNode . Empty ) == <NUM_LIT:0> ) output . append ( '<CHAR_LIT:U+0020>' ) . append ( "<STR_LIT>" ) ; return output ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ImportReference extends ASTNode { public char [ ] [ ] tokens ; public long [ ] sourcePositions ; public int declarationEnd ; public int declarationSourceStart ; public int declarationSourceEnd ; public int modifiers ; public Annotation [ ] annotations ; public int trailingStarPosition ; public ImportReference ( char [ ] [ ] tokens , long [ ] sourcePositions , boolean onDemand , int modifiers ) { this . tokens = tokens ; this . sourcePositions = sourcePositions ; if ( onDemand ) { this . bits |= ASTNode . OnDemand ; } this . sourceEnd = ( int ) ( sourcePositions [ sourcePositions . length - <NUM_LIT:1> ] & <NUM_LIT> ) ; this . sourceStart = ( int ) ( sourcePositions [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; this . modifiers = modifiers ; } public boolean isStatic ( ) { return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public char [ ] [ ] getImportName ( ) { return this . tokens ; } public StringBuffer print ( int indent , StringBuffer output ) { return print ( indent , output , true ) ; } public StringBuffer print ( int tab , StringBuffer output , boolean withOnDemand ) { for ( int i = <NUM_LIT:0> ; i < this . tokens . length ; i ++ ) { if ( i > <NUM_LIT:0> ) output . append ( '<CHAR_LIT:.>' ) ; output . append ( this . tokens [ i ] ) ; } if ( withOnDemand && ( ( this . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) ) { output . append ( "<STR_LIT>" ) ; } return output ; } public void traverse ( ASTVisitor visitor , CompilationUnitScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public char [ ] getSimpleName ( ) { return this . tokens [ this . tokens . length - <NUM_LIT:1> ] ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class CompoundAssignment extends Assignment implements OperatorIds { public int operator ; public int preAssignImplicitConversion ; public CompoundAssignment ( Expression lhs , Expression expression , int operator , int sourceEnd ) { super ( lhs , expression , sourceEnd ) ; lhs . bits &= ~ IsStrictlyAssigned ; lhs . bits |= IsCompoundAssigned ; this . operator = operator ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . resolvedType . id != T_JavaLangString ) { this . lhs . checkNPE ( currentScope , flowContext , flowInfo ) ; } flowInfo = ( ( Reference ) this . lhs ) . analyseAssignment ( currentScope , flowContext , flowInfo , this , true ) . unconditionalInits ( ) ; if ( this . resolvedType . id == T_JavaLangString ) { LocalVariableBinding local = this . lhs . localVariableBinding ( ) ; if ( local != null ) { flowInfo . markAsDefinitelyNonNull ( local ) ; if ( flowContext . initsOnFinally != null ) flowContext . initsOnFinally . markAsDefinitelyNonNull ( local ) ; } } return flowInfo ; } public boolean checkCastCompatibility ( ) { return true ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; ( ( Reference ) this . lhs ) . generateCompoundAssignment ( currentScope , codeStream , this . expression , this . operator , this . preAssignImplicitConversion , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . NON_NULL ; } public String operatorToString ( ) { switch ( this . operator ) { case PLUS : return "<STR_LIT>" ; case MINUS : return "<STR_LIT>" ; case MULTIPLY : return "<STR_LIT>" ; case DIVIDE : return "<STR_LIT>" ; case AND : return "<STR_LIT>" ; case OR : return "<STR_LIT>" ; case XOR : return "<STR_LIT>" ; case REMAINDER : return "<STR_LIT>" ; case LEFT_SHIFT : return "<STR_LIT>" ; case RIGHT_SHIFT : return "<STR_LIT>" ; case UNSIGNED_RIGHT_SHIFT : return "<STR_LIT>" ; } return "<STR_LIT>" ; } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { this . lhs . printExpression ( indent , output ) . append ( '<CHAR_LIT:U+0020>' ) . append ( operatorToString ( ) ) . append ( '<CHAR_LIT:U+0020>' ) ; return this . expression . printExpression ( <NUM_LIT:0> , output ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( ! ( this . lhs instanceof Reference ) || this . lhs . isThis ( ) ) { scope . problemReporter ( ) . expressionShouldBeAVariable ( this . lhs ) ; return null ; } boolean expressionIsCast = this . expression instanceof CastExpression ; if ( expressionIsCast ) this . expression . bits |= ASTNode . DisableUnnecessaryCastCheck ; TypeBinding originalLhsType = this . lhs . resolveType ( scope ) ; TypeBinding originalExpressionType = this . expression . resolveType ( scope ) ; if ( originalLhsType == null || originalExpressionType == null ) return null ; LocalVariableBinding localVariableBinding = this . lhs . localVariableBinding ( ) ; if ( localVariableBinding != null ) { localVariableBinding . tagBits &= ~ TagBits . IsEffectivelyFinal ; } LookupEnvironment env = scope . environment ( ) ; TypeBinding lhsType = originalLhsType , expressionType = originalExpressionType ; boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; boolean unboxedLhs = false ; if ( use15specifics ) { if ( ! lhsType . isBaseType ( ) && expressionType . id != T_JavaLangString && expressionType . id != T_null ) { TypeBinding unboxedType = env . computeBoxingType ( lhsType ) ; if ( unboxedType != lhsType ) { lhsType = unboxedType ; unboxedLhs = true ; } } if ( ! expressionType . isBaseType ( ) && lhsType . id != T_JavaLangString && lhsType . id != T_null ) { expressionType = env . computeBoxingType ( expressionType ) ; } } if ( restrainUsageToNumericTypes ( ) && ! lhsType . isNumericType ( ) ) { scope . problemReporter ( ) . operatorOnlyValidOnNumericType ( this , lhsType , expressionType ) ; return null ; } int lhsID = lhsType . id ; int expressionID = expressionType . id ; if ( lhsID > <NUM_LIT:15> || expressionID > <NUM_LIT:15> ) { if ( lhsID != T_JavaLangString ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } expressionID = T_JavaLangObject ; } int result = OperatorExpression . OperatorSignatures [ this . operator ] [ ( lhsID << <NUM_LIT:4> ) + expressionID ] ; if ( result == T_undefined ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } if ( this . operator == PLUS ) { if ( lhsID == T_JavaLangObject && ( scope . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } else { if ( ( lhsType . isNumericType ( ) || lhsID == T_boolean ) && ! expressionType . isNumericType ( ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } } } TypeBinding resultType = TypeBinding . wellKnownType ( scope , result & <NUM_LIT> ) ; if ( checkCastCompatibility ( ) ) { if ( originalLhsType . id != T_JavaLangString && resultType . id != T_JavaLangString ) { if ( ! checkCastTypesCompatibility ( scope , originalLhsType , resultType , null ) ) { scope . problemReporter ( ) . invalidOperator ( this , originalLhsType , expressionType ) ; return null ; } } } this . lhs . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( result > > > <NUM_LIT:16> ) & <NUM_LIT> ) , originalLhsType ) ; this . expression . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( result > > > <NUM_LIT:8> ) & <NUM_LIT> ) , originalExpressionType ) ; this . preAssignImplicitConversion = ( unboxedLhs ? BOXING : <NUM_LIT:0> ) | ( lhsID << <NUM_LIT:4> ) | ( result & <NUM_LIT> ) ; if ( unboxedLhs ) scope . problemReporter ( ) . autoboxing ( this , lhsType , originalLhsType ) ; if ( expressionIsCast ) CastExpression . checkNeedForArgumentCasts ( scope , this . operator , result , this . lhs , originalLhsType . id , false , this . expression , originalExpressionType . id , true ) ; return this . resolvedType = originalLhsType ; } public boolean restrainUsageToNumericTypes ( ) { return false ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . lhs . traverse ( visitor , scope ) ; this . expression . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class AND_AND_Expression extends BinaryExpression { int rightInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; public AND_AND_Expression ( Expression left , Expression right , int operator ) { super ( left , right , operator ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { Constant cst = this . left . optimizedBooleanConstant ( ) ; boolean isLeftOptimizedTrue = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isLeftOptimizedFalse = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; if ( isLeftOptimizedTrue ) { FlowInfo mergedInfo = this . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; mergedInfo = this . right . analyseCode ( currentScope , flowContext , mergedInfo ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } FlowInfo leftInfo = this . left . analyseCode ( currentScope , flowContext , flowInfo ) ; FlowInfo rightInfo = leftInfo . initsWhenTrue ( ) . unconditionalCopy ( ) ; this . rightInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( rightInfo ) ; int previousMode = rightInfo . reachMode ( ) ; if ( isLeftOptimizedFalse ) { if ( ( rightInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { currentScope . problemReporter ( ) . fakeReachable ( this . right ) ; rightInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } } rightInfo = this . right . analyseCode ( currentScope , flowContext , rightInfo ) ; if ( ( this . left . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . left . checkNPE ( currentScope , flowContext , flowInfo ) ; } if ( ( this . right . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . right . checkNPE ( currentScope , flowContext , flowInfo ) ; } FlowInfo mergedInfo = FlowInfo . conditional ( rightInfo . safeInitsWhenTrue ( ) , leftInfo . initsWhenFalse ( ) . unconditionalInits ( ) . mergedWith ( rightInfo . initsWhenFalse ( ) . setReachMode ( previousMode ) . unconditionalInits ( ) ) ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } Constant cst = this . right . constant ; if ( cst != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == true ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; } else { this . left . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) codeStream . iconst_0 ( ) ; } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } BranchLabel falseLabel = new BranchLabel ( codeStream ) , endLabel ; cst = this . left . optimizedBooleanConstant ( ) ; boolean leftIsConst = cst != Constant . NotAConstant ; boolean leftIsTrue = leftIsConst && cst . booleanValue ( ) == true ; cst = this . right . optimizedBooleanConstant ( ) ; boolean rightIsConst = cst != Constant . NotAConstant ; boolean rightIsTrue = rightIsConst && cst . booleanValue ( ) == true ; generateOperands : { if ( leftIsConst ) { this . left . generateCode ( currentScope , codeStream , false ) ; if ( ! leftIsTrue ) { break generateOperands ; } } else { this . left . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , true ) ; } if ( this . rightInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . rightInitStateIndex ) ; } if ( rightIsConst ) { this . right . generateCode ( currentScope , codeStream , false ) ; } else { this . right . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , valueRequired ) ; } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } if ( valueRequired ) { if ( leftIsConst && ! leftIsTrue ) { codeStream . iconst_0 ( ) ; } else { if ( rightIsConst && ! rightIsTrue ) { codeStream . iconst_0 ( ) ; } else { codeStream . iconst_1 ( ) ; } if ( falseLabel . forwardReferenceCount ( ) > <NUM_LIT:0> ) { if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { codeStream . goto_ ( endLabel = new BranchLabel ( codeStream ) ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } else { falseLabel . place ( ) ; } } codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } else { falseLabel . place ( ) ; } } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { if ( this . constant != Constant . NotAConstant ) { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } Constant cst = this . right . constant ; if ( cst != Constant . NotAConstant && cst . booleanValue ( ) == true ) { int pc = codeStream . position ; this . left . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } cst = this . left . optimizedBooleanConstant ( ) ; boolean leftIsConst = cst != Constant . NotAConstant ; boolean leftIsTrue = leftIsConst && cst . booleanValue ( ) == true ; cst = this . right . optimizedBooleanConstant ( ) ; boolean rightIsConst = cst != Constant . NotAConstant ; boolean rightIsTrue = rightIsConst && cst . booleanValue ( ) == true ; generateOperands : { if ( falseLabel == null ) { if ( trueLabel != null ) { BranchLabel internalFalseLabel = new BranchLabel ( codeStream ) ; this . left . generateOptimizedBoolean ( currentScope , codeStream , null , internalFalseLabel , ! leftIsConst ) ; if ( leftIsConst && ! leftIsTrue ) { internalFalseLabel . place ( ) ; break generateOperands ; } if ( this . rightInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . rightInitStateIndex ) ; } this . right . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , null , valueRequired && ! rightIsConst ) ; if ( valueRequired && rightIsConst && rightIsTrue ) { codeStream . goto_ ( trueLabel ) ; codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd ) ; } internalFalseLabel . place ( ) ; } } else { if ( trueLabel == null ) { this . left . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , ! leftIsConst ) ; int pc = codeStream . position ; if ( leftIsConst && ! leftIsTrue ) { if ( valueRequired ) { codeStream . goto_ ( falseLabel ) ; } codeStream . recordPositionsFrom ( pc , this . sourceEnd ) ; break generateOperands ; } if ( this . rightInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . rightInitStateIndex ) ; } this . right . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , valueRequired && ! rightIsConst ) ; if ( valueRequired && rightIsConst && ! rightIsTrue ) { codeStream . goto_ ( falseLabel ) ; codeStream . recordPositionsFrom ( pc , this . sourceEnd ) ; } } else { } } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } } public boolean isCompactableOperation ( ) { return false ; } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding result = super . resolveType ( scope ) ; Binding leftDirect = Expression . getDirectBinding ( this . left ) ; if ( leftDirect != null && leftDirect == Expression . getDirectBinding ( this . right ) ) { if ( ! ( this . right instanceof Assignment ) ) scope . problemReporter ( ) . comparingIdenticalExpressions ( this ) ; } return result ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . left . traverse ( visitor , scope ) ; this . right . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; import org . eclipse . jdt . internal . compiler . lookup . ProblemReasons ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class JavadocSingleTypeReference extends SingleTypeReference { public int tagSourceStart , tagSourceEnd ; public PackageBinding packageBinding ; public JavadocSingleTypeReference ( char [ ] source , long pos , int tagStart , int tagEnd ) { super ( source , pos ) ; this . tagSourceStart = tagStart ; this . tagSourceEnd = tagEnd ; this . bits |= ASTNode . InsideJavadoc ; } protected TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( this . resolvedType != null ) { if ( this . resolvedType . isValidBinding ( ) ) { return this . resolvedType ; } else { switch ( this . resolvedType . problemId ( ) ) { case ProblemReasons . NotFound : case ProblemReasons . NotVisible : case ProblemReasons . InheritedNameHidesEnclosingName : TypeBinding type = this . resolvedType . closestMatch ( ) ; return type ; default : return null ; } } } this . resolvedType = getTypeBinding ( scope ) ; if ( this . resolvedType == null ) return null ; if ( ! this . resolvedType . isValidBinding ( ) ) { char [ ] [ ] tokens = { this . token } ; Binding binding = scope . getTypeOrPackage ( tokens ) ; if ( binding instanceof PackageBinding ) { this . packageBinding = ( PackageBinding ) binding ; } else { if ( this . resolvedType . problemId ( ) == ProblemReasons . NonStaticReferenceInStaticContext ) { TypeBinding closestMatch = this . resolvedType . closestMatch ( ) ; if ( closestMatch != null && closestMatch . isTypeVariable ( ) ) { this . resolvedType = closestMatch ; return this . resolvedType ; } } reportInvalidType ( scope ) ; } return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) reportDeprecatedType ( this . resolvedType , scope ) ; if ( this . resolvedType . isGenericType ( ) || this . resolvedType . isParameterizedType ( ) ) { this . resolvedType = scope . environment ( ) . convertToRawType ( this . resolvedType , true ) ; } return this . resolvedType ; } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { scope . problemReporter ( ) . javadocDeprecatedType ( type , this , scope . getDeclarationModifiers ( ) ) ; } protected void reportInvalidType ( Scope scope ) { scope . problemReporter ( ) . javadocInvalidType ( this , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class SynchronizedStatement extends SubRoutineStatement { public Expression expression ; public Block block ; public BlockScope scope ; public LocalVariableBinding synchroVariable ; static final char [ ] SecretLocalDeclarationName = "<STR_LIT>" . toCharArray ( ) ; int preSynchronizedInitStateIndex = - <NUM_LIT:1> ; int mergedSynchronizedInitStateIndex = - <NUM_LIT:1> ; public SynchronizedStatement ( Expression expression , Block statement , int s , int e ) { this . expression = expression ; this . block = statement ; this . sourceEnd = e ; this . sourceStart = s ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . preSynchronizedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; this . synchroVariable . useFlag = LocalVariableBinding . USED ; flowInfo = this . block . analyseCode ( this . scope , new InsideSubRoutineFlowContext ( flowContext , this ) , this . expression . analyseCode ( this . scope , flowContext , flowInfo ) ) ; this . mergedSynchronizedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) { this . bits |= ASTNode . BlockExit ; } return flowInfo ; } public boolean isSubRoutineEscaping ( ) { return false ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } this . anyExceptionLabel = null ; int pc = codeStream . position ; this . expression . generateCode ( this . scope , codeStream , true ) ; if ( this . block . isEmptyBlock ( ) ) { switch ( this . synchroVariable . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . dup2 ( ) ; break ; default : codeStream . dup ( ) ; break ; } codeStream . monitorenter ( ) ; codeStream . monitorexit ( ) ; if ( this . scope != currentScope ) { codeStream . exitUserScope ( this . scope ) ; } } else { codeStream . store ( this . synchroVariable , true ) ; codeStream . addVariable ( this . synchroVariable ) ; codeStream . monitorenter ( ) ; enterAnyExceptionHandler ( codeStream ) ; this . block . generateCode ( this . scope , codeStream ) ; if ( this . scope != currentScope ) { codeStream . exitUserScope ( this . scope , this . synchroVariable ) ; } BranchLabel endLabel = new BranchLabel ( codeStream ) ; if ( ( this . bits & ASTNode . BlockExit ) == <NUM_LIT:0> ) { codeStream . load ( this . synchroVariable ) ; codeStream . monitorexit ( ) ; exitAnyExceptionHandler ( ) ; codeStream . goto_ ( endLabel ) ; enterAnyExceptionHandler ( codeStream ) ; } codeStream . pushExceptionOnStack ( this . scope . getJavaLangThrowable ( ) ) ; if ( this . preSynchronizedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preSynchronizedInitStateIndex ) ; } placeAllAnyExceptionHandler ( ) ; codeStream . load ( this . synchroVariable ) ; codeStream . monitorexit ( ) ; exitAnyExceptionHandler ( ) ; codeStream . athrow ( ) ; if ( this . mergedSynchronizedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedSynchronizedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedSynchronizedInitStateIndex ) ; } if ( this . scope != currentScope ) { codeStream . removeVariable ( this . synchroVariable ) ; } if ( ( this . bits & ASTNode . BlockExit ) == <NUM_LIT:0> ) { endLabel . place ( ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public boolean generateSubRoutineInvocation ( BlockScope currentScope , CodeStream codeStream , Object targetLocation , int stateIndex , LocalVariableBinding secretLocal ) { codeStream . load ( this . synchroVariable ) ; codeStream . monitorexit ( ) ; exitAnyExceptionHandler ( ) ; return false ; } public void resolve ( BlockScope upperScope ) { this . scope = new BlockScope ( upperScope ) ; TypeBinding type = this . expression . resolveType ( this . scope ) ; if ( type == null ) return ; switch ( type . id ) { case T_boolean : case T_char : case T_float : case T_double : case T_byte : case T_short : case T_int : case T_long : this . scope . problemReporter ( ) . invalidTypeToSynchronize ( this . expression , type ) ; break ; case T_void : this . scope . problemReporter ( ) . illegalVoidExpression ( this . expression ) ; break ; case T_null : this . scope . problemReporter ( ) . invalidNullToSynchronize ( this . expression ) ; break ; } this . synchroVariable = new LocalVariableBinding ( SecretLocalDeclarationName , type , ClassFileConstants . AccDefault , false ) ; this . scope . addLocalVariable ( this . synchroVariable ) ; this . synchroVariable . setConstant ( Constant . NotAConstant ) ; this . expression . computeConversion ( this . scope , type , type ) ; this . block . resolveUsing ( this . scope ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; output . append ( "<STR_LIT>" ) ; this . expression . printExpression ( <NUM_LIT:0> , output ) . append ( '<CHAR_LIT:)>' ) ; output . append ( '<STR_LIT:\n>' ) ; return this . block . printStatement ( indent + <NUM_LIT:1> , output ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . expression . traverse ( visitor , this . scope ) ; this . block . traverse ( visitor , this . scope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . IntConstant ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public class IntLiteral extends NumberLiteral { private static final char [ ] HEXA_MIN_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] HEXA_MINUS_ONE_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] OCTAL_MIN_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] OCTAL_MINUS_ONE_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] DECIMAL_MIN_VALUE = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] DECIMAL_MAX_VALUE = "<STR_LIT>" . toCharArray ( ) ; private char [ ] reducedForm ; public int value ; public static final IntLiteral One = new IntLiteral ( new char [ ] { '<CHAR_LIT:1>' } , null , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> , IntConstant . fromValue ( <NUM_LIT:1> ) ) ; public static IntLiteral buildIntLiteral ( char [ ] token , int s , int e ) { char [ ] intReducedToken = removePrefixZerosAndUnderscores ( token , false ) ; return new IntLiteral ( token , intReducedToken != token ? intReducedToken : null , s , e ) ; } IntLiteral ( char [ ] token , char [ ] reducedForm , int start , int end ) { super ( token , start , end ) ; this . reducedForm = reducedForm ; } IntLiteral ( char [ ] token , char [ ] reducedForm , int start , int end , int value , Constant constant ) { super ( token , start , end ) ; this . reducedForm = reducedForm ; this . value = value ; this . constant = constant ; } public void computeConstant ( ) { char [ ] token = this . reducedForm != null ? this . reducedForm : this . source ; int tokenLength = token . length ; int radix = <NUM_LIT:10> ; int j = <NUM_LIT:0> ; if ( token [ <NUM_LIT:0> ] == '<CHAR_LIT:0>' ) { if ( tokenLength == <NUM_LIT:1> ) { this . constant = IntConstant . fromValue ( <NUM_LIT:0> ) ; return ; } if ( ( token [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) || ( token [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { radix = <NUM_LIT:16> ; j = <NUM_LIT:2> ; } else if ( ( token [ <NUM_LIT:1> ] == '<CHAR_LIT:b>' ) || ( token [ <NUM_LIT:1> ] == '<CHAR_LIT>' ) ) { radix = <NUM_LIT:2> ; j = <NUM_LIT:2> ; } else { radix = <NUM_LIT:8> ; j = <NUM_LIT:1> ; } } switch ( radix ) { case <NUM_LIT:2> : if ( ( tokenLength - <NUM_LIT:2> ) > <NUM_LIT:32> ) { return ; } computeValue ( token , tokenLength , radix , j ) ; return ; case <NUM_LIT:16> : if ( tokenLength <= <NUM_LIT:10> ) { if ( CharOperation . equals ( token , HEXA_MINUS_ONE_VALUE ) ) { this . constant = IntConstant . fromValue ( - <NUM_LIT:1> ) ; return ; } computeValue ( token , tokenLength , radix , j ) ; return ; } break ; case <NUM_LIT:10> : if ( tokenLength > DECIMAL_MAX_VALUE . length || ( tokenLength == DECIMAL_MAX_VALUE . length && CharOperation . compareTo ( token , DECIMAL_MAX_VALUE ) > <NUM_LIT:0> ) ) { return ; } computeValue ( token , tokenLength , radix , j ) ; break ; case <NUM_LIT:8> : if ( tokenLength <= <NUM_LIT:12> ) { if ( tokenLength == <NUM_LIT:12> && token [ j ] > '<CHAR_LIT>' ) { return ; } if ( CharOperation . equals ( token , OCTAL_MINUS_ONE_VALUE ) ) { this . constant = IntConstant . fromValue ( - <NUM_LIT:1> ) ; return ; } computeValue ( token , tokenLength , radix , j ) ; return ; } break ; } } private void computeValue ( char [ ] token , int tokenLength , int radix , int j ) { int digitValue ; int computedValue = <NUM_LIT:0> ; while ( j < tokenLength ) { if ( ( digitValue = ScannerHelper . digit ( token [ j ++ ] , radix ) ) < <NUM_LIT:0> ) { return ; } computedValue = ( computedValue * radix ) + digitValue ; } this . constant = IntConstant . fromValue ( computedValue ) ; } public IntLiteral convertToMinValue ( ) { if ( ( ( this . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { return this ; } char [ ] token = this . reducedForm != null ? this . reducedForm : this . source ; switch ( token . length ) { case <NUM_LIT:10> : if ( CharOperation . equals ( token , DECIMAL_MIN_VALUE ) ) { return new IntLiteralMinValue ( this . source , this . reducedForm , this . sourceStart , this . sourceEnd ) ; } break ; } return this ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . INT ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; public class AssertStatement extends Statement { public Expression assertExpression , exceptionArgument ; int preAssertInitStateIndex = - <NUM_LIT:1> ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { this . assertExpression = assertExpression ; this . exceptionArgument = exceptionArgument ; this . sourceStart = startPosition ; this . sourceEnd = exceptionArgument . sourceEnd ; } public AssertStatement ( Expression assertExpression , int startPosition ) { this . assertExpression = assertExpression ; this . sourceStart = startPosition ; this . sourceEnd = assertExpression . sourceEnd ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . preAssertInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; Constant cst = this . assertExpression . optimizedBooleanConstant ( ) ; if ( ( this . assertExpression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { this . assertExpression . checkNPE ( currentScope , flowContext , flowInfo ) ; } boolean isOptimizedTrueAssertion = cst != Constant . NotAConstant && cst . booleanValue ( ) == true ; boolean isOptimizedFalseAssertion = cst != Constant . NotAConstant && cst . booleanValue ( ) == false ; flowContext . tagBits |= FlowContext . HIDE_NULL_COMPARISON_WARNING ; FlowInfo conditionFlowInfo = this . assertExpression . analyseCode ( currentScope , flowContext , flowInfo . copy ( ) ) ; flowContext . tagBits &= ~ FlowContext . HIDE_NULL_COMPARISON_WARNING ; UnconditionalFlowInfo assertWhenTrueInfo = conditionFlowInfo . initsWhenTrue ( ) . unconditionalInits ( ) ; FlowInfo assertInfo = conditionFlowInfo . initsWhenFalse ( ) ; if ( isOptimizedTrueAssertion ) { assertInfo . setReachMode ( FlowInfo . UNREACHABLE_OR_DEAD ) ; } if ( this . exceptionArgument != null ) { FlowInfo exceptionInfo = this . exceptionArgument . analyseCode ( currentScope , flowContext , assertInfo . copy ( ) ) ; if ( isOptimizedTrueAssertion ) { currentScope . problemReporter ( ) . fakeReachable ( this . exceptionArgument ) ; } else { flowContext . checkExceptionHandlers ( currentScope . getJavaLangAssertionError ( ) , this , exceptionInfo , currentScope ) ; } } if ( ! isOptimizedTrueAssertion ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; } if ( isOptimizedFalseAssertion ) { return flowInfo ; } else { CompilerOptions compilerOptions = currentScope . compilerOptions ( ) ; if ( ! compilerOptions . includeNullInfoFromAsserts ) { return ( ( flowInfo . nullInfoLessUnconditionalCopy ( ) ) . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) ) . addNullInfoFrom ( flowInfo ) ; } return flowInfo . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) . addInitializationsFrom ( assertWhenTrueInfo . discardInitializationInfo ( ) ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; if ( this . assertionSyntheticFieldBinding != null ) { BranchLabel assertionActivationLabel = new BranchLabel ( codeStream ) ; codeStream . fieldAccess ( Opcodes . OPC_getstatic , this . assertionSyntheticFieldBinding , null ) ; codeStream . ifne ( assertionActivationLabel ) ; BranchLabel falseLabel ; this . assertExpression . generateOptimizedBoolean ( currentScope , codeStream , ( falseLabel = new BranchLabel ( codeStream ) ) , null , true ) ; codeStream . newJavaLangAssertionError ( ) ; codeStream . dup ( ) ; if ( this . exceptionArgument != null ) { this . exceptionArgument . generateCode ( currentScope , codeStream , true ) ; codeStream . invokeJavaLangAssertionErrorConstructor ( this . exceptionArgument . implicitConversion & <NUM_LIT> ) ; } else { codeStream . invokeJavaLangAssertionErrorDefaultConstructor ( ) ; } codeStream . athrow ( ) ; if ( this . preAssertInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preAssertInitStateIndex ) ; } falseLabel . place ( ) ; assertionActivationLabel . place ( ) ; } else { if ( this . preAssertInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preAssertInitStateIndex ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void resolve ( BlockScope scope ) { this . assertExpression . resolveTypeExpecting ( scope , TypeBinding . BOOLEAN ) ; if ( this . exceptionArgument != null ) { TypeBinding exceptionArgumentType = this . exceptionArgument . resolveType ( scope ) ; if ( exceptionArgumentType != null ) { int id = exceptionArgumentType . id ; switch ( id ) { case T_void : scope . problemReporter ( ) . illegalVoidExpression ( this . exceptionArgument ) ; default : id = T_JavaLangObject ; case T_boolean : case T_byte : case T_char : case T_short : case T_double : case T_float : case T_int : case T_long : case T_JavaLangString : this . exceptionArgument . implicitConversion = ( id << <NUM_LIT:4> ) + id ; } } } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . assertExpression . traverse ( visitor , scope ) ; if ( this . exceptionArgument != null ) { this . exceptionArgument . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) == <NUM_LIT:0> ) { SourceTypeBinding outerMostClass = currentScope . enclosingSourceType ( ) ; while ( outerMostClass . isLocalType ( ) ) { ReferenceBinding enclosing = outerMostClass . enclosingType ( ) ; if ( enclosing == null || enclosing . isInterface ( ) ) break ; outerMostClass = ( SourceTypeBinding ) enclosing ; } this . assertionSyntheticFieldBinding = outerMostClass . addSyntheticFieldForAssert ( currentScope ) ; TypeDeclaration typeDeclaration = outerMostClass . scope . referenceType ( ) ; AbstractMethodDeclaration [ ] methods = typeDeclaration . methods ; for ( int i = <NUM_LIT:0> , max = methods . length ; i < max ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( method . isClinit ( ) ) { ( ( Clinit ) method ) . setAssertionSupport ( this . assertionSyntheticFieldBinding , currentScope . compilerOptions ( ) . sourceLevel < ClassFileConstants . JDK1_5 ) ; break ; } } } } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) ; output . append ( "<STR_LIT>" ) ; this . assertExpression . printExpression ( <NUM_LIT:0> , output ) ; if ( this . exceptionArgument != null ) { output . append ( "<STR_LIT::U+0020>" ) ; this . exceptionArgument . printExpression ( <NUM_LIT:0> , output ) ; } return output . append ( '<CHAR_LIT:;>' ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import java . util . ArrayList ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; 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 . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ; import org . eclipse . jdt . internal . compiler . lookup . BaseTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . WildcardBinding ; import org . eclipse . jdt . internal . compiler . problem . ShouldNotImplement ; import org . eclipse . jdt . internal . compiler . util . Messages ; public abstract class Expression extends Statement { public Constant constant ; public int statementEnd = - <NUM_LIT:1> ; public int implicitConversion ; public TypeBinding resolvedType ; public static final boolean isConstantValueRepresentable ( Constant constant , int constantTypeID , int targetTypeID ) { if ( targetTypeID == constantTypeID ) return true ; switch ( targetTypeID ) { case T_char : switch ( constantTypeID ) { case T_char : return true ; case T_double : return constant . doubleValue ( ) == constant . charValue ( ) ; case T_float : return constant . floatValue ( ) == constant . charValue ( ) ; case T_int : return constant . intValue ( ) == constant . charValue ( ) ; case T_short : return constant . shortValue ( ) == constant . charValue ( ) ; case T_byte : return constant . byteValue ( ) == constant . charValue ( ) ; case T_long : return constant . longValue ( ) == constant . charValue ( ) ; default : return false ; } case T_float : switch ( constantTypeID ) { case T_char : return constant . charValue ( ) == constant . floatValue ( ) ; case T_double : return constant . doubleValue ( ) == constant . floatValue ( ) ; case T_float : return true ; case T_int : return constant . intValue ( ) == constant . floatValue ( ) ; case T_short : return constant . shortValue ( ) == constant . floatValue ( ) ; case T_byte : return constant . byteValue ( ) == constant . floatValue ( ) ; case T_long : return constant . longValue ( ) == constant . floatValue ( ) ; default : return false ; } case T_double : switch ( constantTypeID ) { case T_char : return constant . charValue ( ) == constant . doubleValue ( ) ; case T_double : return true ; case T_float : return constant . floatValue ( ) == constant . doubleValue ( ) ; case T_int : return constant . intValue ( ) == constant . doubleValue ( ) ; case T_short : return constant . shortValue ( ) == constant . doubleValue ( ) ; case T_byte : return constant . byteValue ( ) == constant . doubleValue ( ) ; case T_long : return constant . longValue ( ) == constant . doubleValue ( ) ; default : return false ; } case T_byte : switch ( constantTypeID ) { case T_char : return constant . charValue ( ) == constant . byteValue ( ) ; case T_double : return constant . doubleValue ( ) == constant . byteValue ( ) ; case T_float : return constant . floatValue ( ) == constant . byteValue ( ) ; case T_int : return constant . intValue ( ) == constant . byteValue ( ) ; case T_short : return constant . shortValue ( ) == constant . byteValue ( ) ; case T_byte : return true ; case T_long : return constant . longValue ( ) == constant . byteValue ( ) ; default : return false ; } case T_short : switch ( constantTypeID ) { case T_char : return constant . charValue ( ) == constant . shortValue ( ) ; case T_double : return constant . doubleValue ( ) == constant . shortValue ( ) ; case T_float : return constant . floatValue ( ) == constant . shortValue ( ) ; case T_int : return constant . intValue ( ) == constant . shortValue ( ) ; case T_short : return true ; case T_byte : return constant . byteValue ( ) == constant . shortValue ( ) ; case T_long : return constant . longValue ( ) == constant . shortValue ( ) ; default : return false ; } case T_int : switch ( constantTypeID ) { case T_char : return constant . charValue ( ) == constant . intValue ( ) ; case T_double : return constant . doubleValue ( ) == constant . intValue ( ) ; case T_float : return constant . floatValue ( ) == constant . intValue ( ) ; case T_int : return true ; case T_short : return constant . shortValue ( ) == constant . intValue ( ) ; case T_byte : return constant . byteValue ( ) == constant . intValue ( ) ; case T_long : return constant . longValue ( ) == constant . intValue ( ) ; default : return false ; } case T_long : switch ( constantTypeID ) { case T_char : return constant . charValue ( ) == constant . longValue ( ) ; case T_double : return constant . doubleValue ( ) == constant . longValue ( ) ; case T_float : return constant . floatValue ( ) == constant . longValue ( ) ; case T_int : return constant . intValue ( ) == constant . longValue ( ) ; case T_short : return constant . shortValue ( ) == constant . longValue ( ) ; case T_byte : return constant . byteValue ( ) == constant . longValue ( ) ; case T_long : return true ; default : return false ; } default : return false ; } } public Expression ( ) { super ( ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return flowInfo ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { return analyseCode ( currentScope , flowContext , flowInfo ) ; } public final boolean checkCastTypesCompatibility ( Scope scope , TypeBinding castType , TypeBinding expressionType , Expression expression ) { if ( castType == null || expressionType == null ) return true ; boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; boolean use17specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_7 ; if ( castType . isBaseType ( ) ) { if ( expressionType . isBaseType ( ) ) { if ( expressionType == castType ) { if ( expression != null ) { this . constant = expression . constant ; } tagAsUnnecessaryCast ( scope , castType ) ; return true ; } boolean necessary = false ; if ( expressionType . isCompatibleWith ( castType ) || ( necessary = BaseTypeBinding . isNarrowing ( castType . id , expressionType . id ) ) ) { if ( expression != null ) { expression . implicitConversion = ( castType . id << <NUM_LIT:4> ) + expressionType . id ; if ( expression . constant != Constant . NotAConstant ) { this . constant = expression . constant . castTo ( expression . implicitConversion ) ; } } if ( ! necessary ) tagAsUnnecessaryCast ( scope , castType ) ; return true ; } } else if ( use17specifics && expressionType . id == TypeIds . T_JavaLangObject ) { return true ; } else if ( use15specifics && scope . environment ( ) . computeBoxingType ( expressionType ) . isCompatibleWith ( castType ) ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } return false ; } else if ( use15specifics && expressionType . isBaseType ( ) && scope . environment ( ) . computeBoxingType ( expressionType ) . isCompatibleWith ( castType ) ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } switch ( expressionType . kind ( ) ) { case Binding . BASE_TYPE : if ( expressionType == TypeBinding . NULL ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } return false ; case Binding . ARRAY_TYPE : if ( castType == expressionType ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } switch ( castType . kind ( ) ) { case Binding . ARRAY_TYPE : TypeBinding castElementType = ( ( ArrayBinding ) castType ) . elementsType ( ) ; TypeBinding exprElementType = ( ( ArrayBinding ) expressionType ) . elementsType ( ) ; if ( exprElementType . isBaseType ( ) || castElementType . isBaseType ( ) ) { if ( castElementType == exprElementType ) { tagAsNeedCheckCast ( ) ; return true ; } return false ; } return checkCastTypesCompatibility ( scope , castElementType , exprElementType , expression ) ; case Binding . TYPE_PARAMETER : TypeBinding match = expressionType . findSuperTypeOriginatingFrom ( castType ) ; if ( match == null ) { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; } return checkCastTypesCompatibility ( scope , ( ( TypeVariableBinding ) castType ) . upperBound ( ) , expressionType , expression ) ; default : switch ( castType . id ) { case T_JavaLangCloneable : case T_JavaIoSerializable : tagAsNeedCheckCast ( ) ; return true ; case T_JavaLangObject : tagAsUnnecessaryCast ( scope , castType ) ; return true ; default : return false ; } } case Binding . TYPE_PARAMETER : TypeBinding match = expressionType . findSuperTypeOriginatingFrom ( castType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , expressionType , match , false ) ; } return checkCastTypesCompatibility ( scope , castType , ( ( TypeVariableBinding ) expressionType ) . upperBound ( ) , expression ) ; case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : match = expressionType . findSuperTypeOriginatingFrom ( castType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , expressionType , match , false ) ; } return checkCastTypesCompatibility ( scope , castType , ( ( WildcardBinding ) expressionType ) . bound , expression ) ; default : if ( expressionType . isInterface ( ) ) { switch ( castType . kind ( ) ) { case Binding . ARRAY_TYPE : switch ( expressionType . id ) { case T_JavaLangCloneable : case T_JavaIoSerializable : tagAsNeedCheckCast ( ) ; return true ; default : return false ; } case Binding . TYPE_PARAMETER : match = expressionType . findSuperTypeOriginatingFrom ( castType ) ; if ( match == null ) { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; } return checkCastTypesCompatibility ( scope , ( ( TypeVariableBinding ) castType ) . upperBound ( ) , expressionType , expression ) ; default : if ( castType . isInterface ( ) ) { ReferenceBinding interfaceType = ( ReferenceBinding ) expressionType ; match = interfaceType . findSuperTypeOriginatingFrom ( castType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , interfaceType , match , false ) ; } tagAsNeedCheckCast ( ) ; match = castType . findSuperTypeOriginatingFrom ( interfaceType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , interfaceType , match , true ) ; } if ( use15specifics ) { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; if ( scope . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( interfaceType . hasIncompatibleSuperType ( ( ReferenceBinding ) castType ) ) { return false ; } } else if ( ! castType . isRawType ( ) && interfaceType . hasIncompatibleSuperType ( ( ReferenceBinding ) castType ) ) { return false ; } } else { MethodBinding [ ] castTypeMethods = getAllOriginalInheritedMethods ( ( ReferenceBinding ) castType ) ; MethodBinding [ ] expressionTypeMethods = getAllOriginalInheritedMethods ( ( ReferenceBinding ) expressionType ) ; int exprMethodsLength = expressionTypeMethods . length ; for ( int i = <NUM_LIT:0> , castMethodsLength = castTypeMethods . length ; i < castMethodsLength ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < exprMethodsLength ; j ++ ) { if ( ( castTypeMethods [ i ] . returnType != expressionTypeMethods [ j ] . returnType ) && ( CharOperation . equals ( castTypeMethods [ i ] . selector , expressionTypeMethods [ j ] . selector ) ) && castTypeMethods [ i ] . areParametersEqual ( expressionTypeMethods [ j ] ) ) { return false ; } } } } return true ; } else { if ( castType . id == TypeIds . T_JavaLangObject ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } tagAsNeedCheckCast ( ) ; match = castType . findSuperTypeOriginatingFrom ( expressionType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , expressionType , match , true ) ; } if ( ( ( ReferenceBinding ) castType ) . isFinal ( ) ) { return false ; } if ( use15specifics ) { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; if ( scope . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( ( ( ReferenceBinding ) castType ) . hasIncompatibleSuperType ( ( ReferenceBinding ) expressionType ) ) { return false ; } } else if ( ! castType . isRawType ( ) && ( ( ReferenceBinding ) castType ) . hasIncompatibleSuperType ( ( ReferenceBinding ) expressionType ) ) { return false ; } } return true ; } } } else { switch ( castType . kind ( ) ) { case Binding . ARRAY_TYPE : if ( expressionType . id == TypeIds . T_JavaLangObject ) { if ( use15specifics ) checkUnsafeCast ( scope , castType , expressionType , expressionType , true ) ; tagAsNeedCheckCast ( ) ; return true ; } return false ; case Binding . TYPE_PARAMETER : match = expressionType . findSuperTypeOriginatingFrom ( castType ) ; if ( match == null ) { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; } return checkCastTypesCompatibility ( scope , ( ( TypeVariableBinding ) castType ) . upperBound ( ) , expressionType , expression ) ; default : if ( castType . isInterface ( ) ) { ReferenceBinding refExprType = ( ReferenceBinding ) expressionType ; match = refExprType . findSuperTypeOriginatingFrom ( castType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , expressionType , match , false ) ; } if ( refExprType . isFinal ( ) ) { return false ; } tagAsNeedCheckCast ( ) ; match = castType . findSuperTypeOriginatingFrom ( expressionType ) ; if ( match != null ) { return checkUnsafeCast ( scope , castType , expressionType , match , true ) ; } if ( use15specifics ) { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; if ( scope . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_7 ) { if ( refExprType . hasIncompatibleSuperType ( ( ReferenceBinding ) castType ) ) { return false ; } } else if ( ! castType . isRawType ( ) && refExprType . hasIncompatibleSuperType ( ( ReferenceBinding ) castType ) ) { return false ; } } return true ; } else { match = expressionType . findSuperTypeOriginatingFrom ( castType ) ; if ( match != null ) { if ( expression != null && castType . id == TypeIds . T_JavaLangString ) this . constant = expression . constant ; return checkUnsafeCast ( scope , castType , expressionType , match , false ) ; } match = castType . findSuperTypeOriginatingFrom ( expressionType ) ; if ( match != null ) { tagAsNeedCheckCast ( ) ; return checkUnsafeCast ( scope , castType , expressionType , match , true ) ; } return false ; } } } } } public void checkNPE ( BlockScope scope , FlowContext flowContext , FlowInfo flowInfo ) { LocalVariableBinding local = localVariableBinding ( ) ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { if ( ( this . bits & ASTNode . IsNonNull ) == <NUM_LIT:0> ) { flowContext . recordUsingNullReference ( scope , local , this , FlowContext . MAY_NULL , flowInfo ) ; } flowInfo . markAsComparedEqualToNonNull ( local ) ; if ( flowContext . initsOnFinally != null ) { flowContext . initsOnFinally . markAsComparedEqualToNonNull ( local ) ; } } } public boolean checkUnsafeCast ( Scope scope , TypeBinding castType , TypeBinding expressionType , TypeBinding match , boolean isNarrowing ) { if ( match == castType ) { if ( ! isNarrowing ) tagAsUnnecessaryCast ( scope , castType ) ; return true ; } if ( match != null && ( ! castType . isReifiable ( ) || ! expressionType . isReifiable ( ) ) ) { if ( isNarrowing ? match . isProvablyDistinct ( expressionType ) : castType . isProvablyDistinct ( match ) ) { return false ; } } if ( ! isNarrowing ) tagAsUnnecessaryCast ( scope , castType ) ; return true ; } public void computeConversion ( Scope scope , TypeBinding runtimeType , TypeBinding compileTimeType ) { if ( runtimeType == null || compileTimeType == null ) return ; if ( this . implicitConversion != <NUM_LIT:0> ) return ; if ( runtimeType != TypeBinding . NULL && runtimeType . isBaseType ( ) ) { if ( ! compileTimeType . isBaseType ( ) ) { TypeBinding unboxedType = scope . environment ( ) . computeBoxingType ( compileTimeType ) ; this . implicitConversion = TypeIds . UNBOXING ; scope . problemReporter ( ) . autoboxing ( this , compileTimeType , runtimeType ) ; compileTimeType = unboxedType ; } } else if ( compileTimeType != TypeBinding . NULL && compileTimeType . isBaseType ( ) ) { TypeBinding boxedType = scope . environment ( ) . computeBoxingType ( runtimeType ) ; if ( boxedType == runtimeType ) boxedType = compileTimeType ; this . implicitConversion = TypeIds . BOXING | ( boxedType . id << <NUM_LIT:4> ) + compileTimeType . id ; scope . problemReporter ( ) . autoboxing ( this , compileTimeType , scope . environment ( ) . computeBoxingType ( boxedType ) ) ; return ; } else if ( this . constant != Constant . NotAConstant && this . constant . typeID ( ) != TypeIds . T_JavaLangString ) { this . implicitConversion = TypeIds . BOXING ; return ; } int compileTimeTypeID , runtimeTypeID ; if ( ( compileTimeTypeID = compileTimeType . id ) == TypeIds . NoId ) { compileTimeTypeID = compileTimeType . erasure ( ) . id == TypeIds . T_JavaLangString ? TypeIds . T_JavaLangString : TypeIds . T_JavaLangObject ; } switch ( runtimeTypeID = runtimeType . id ) { case T_byte : case T_short : case T_char : if ( compileTimeTypeID == TypeIds . T_JavaLangObject ) { this . implicitConversion |= ( runtimeTypeID << <NUM_LIT:4> ) + compileTimeTypeID ; } else { this . implicitConversion |= ( TypeIds . T_int << <NUM_LIT:4> ) + compileTimeTypeID ; } break ; case T_JavaLangString : case T_float : case T_boolean : case T_double : case T_int : case T_long : this . implicitConversion |= ( runtimeTypeID << <NUM_LIT:4> ) + compileTimeTypeID ; break ; default : } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & ASTNode . IsReachable ) == <NUM_LIT:0> ) { return ; } generateCode ( currentScope , codeStream , false ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { if ( this . constant != Constant . NotAConstant ) { int pc = codeStream . position ; codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } else { throw new ShouldNotImplement ( Messages . ast_missingCode ) ; } } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { Constant cst = optimizedBooleanConstant ( ) ; generateCode ( currentScope , codeStream , valueRequired && cst == Constant . NotAConstant ) ; if ( ( cst != Constant . NotAConstant ) && ( cst . typeID ( ) == TypeIds . T_boolean ) ) { int pc = codeStream . position ; if ( cst . booleanValue ( ) == true ) { if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . goto_ ( trueLabel ) ; } } } } else { if ( valueRequired ) { if ( falseLabel != null ) { if ( trueLabel == null ) { codeStream . goto_ ( falseLabel ) ; } } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } int position = codeStream . position ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifne ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifeq ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( position , this . sourceEnd ) ; } public void generateOptimizedStringConcatenation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { if ( typeID == TypeIds . T_JavaLangString && this . constant != Constant . NotAConstant && this . constant . stringValue ( ) . length ( ) == <NUM_LIT:0> ) { return ; } generateCode ( blockScope , codeStream , true ) ; codeStream . invokeStringConcatenationAppendForType ( typeID ) ; } public void generateOptimizedStringConcatenationCreation ( BlockScope blockScope , CodeStream codeStream , int typeID ) { codeStream . newStringContatenation ( ) ; codeStream . dup ( ) ; switch ( typeID ) { case T_JavaLangObject : case T_undefined : codeStream . invokeStringConcatenationDefaultConstructor ( ) ; generateCode ( blockScope , codeStream , true ) ; codeStream . invokeStringConcatenationAppendForType ( TypeIds . T_JavaLangObject ) ; return ; case T_JavaLangString : case T_null : if ( this . constant != Constant . NotAConstant ) { String stringValue = this . constant . stringValue ( ) ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { codeStream . invokeStringConcatenationDefaultConstructor ( ) ; return ; } codeStream . ldc ( stringValue ) ; } else { generateCode ( blockScope , codeStream , true ) ; codeStream . invokeStringValueOf ( TypeIds . T_JavaLangObject ) ; } break ; default : generateCode ( blockScope , codeStream , true ) ; codeStream . invokeStringValueOf ( typeID ) ; } codeStream . invokeStringConcatenationStringConstructor ( ) ; } private MethodBinding [ ] getAllOriginalInheritedMethods ( ReferenceBinding binding ) { ArrayList collector = new ArrayList ( ) ; getAllInheritedMethods0 ( binding , collector ) ; for ( int i = <NUM_LIT:0> , len = collector . size ( ) ; i < len ; i ++ ) { collector . set ( i , ( ( MethodBinding ) collector . get ( i ) ) . original ( ) ) ; } return ( MethodBinding [ ] ) collector . toArray ( new MethodBinding [ collector . size ( ) ] ) ; } private void getAllInheritedMethods0 ( ReferenceBinding binding , ArrayList collector ) { if ( ! binding . isInterface ( ) ) return ; MethodBinding [ ] methodBindings = binding . methods ( ) ; for ( int i = <NUM_LIT:0> , max = methodBindings . length ; i < max ; i ++ ) { collector . add ( methodBindings [ i ] ) ; } ReferenceBinding [ ] superInterfaces = binding . superInterfaces ( ) ; for ( int i = <NUM_LIT:0> , max = superInterfaces . length ; i < max ; i ++ ) { getAllInheritedMethods0 ( superInterfaces [ i ] , collector ) ; } } public static Binding getDirectBinding ( Expression someExpression ) { if ( ( someExpression . bits & ASTNode . IgnoreNoEffectAssignCheck ) != <NUM_LIT:0> ) { return null ; } if ( someExpression instanceof SingleNameReference ) { return ( ( SingleNameReference ) someExpression ) . binding ; } else if ( someExpression instanceof FieldReference ) { FieldReference fieldRef = ( FieldReference ) someExpression ; if ( fieldRef . receiver . isThis ( ) && ! ( fieldRef . receiver instanceof QualifiedThisReference ) ) { return fieldRef . binding ; } } else if ( someExpression instanceof Assignment ) { Expression lhs = ( ( Assignment ) someExpression ) . lhs ; if ( ( lhs . bits & ASTNode . IsStrictlyAssigned ) != <NUM_LIT:0> ) { return getDirectBinding ( ( ( Assignment ) someExpression ) . lhs ) ; } else if ( someExpression instanceof PrefixExpression ) { return getDirectBinding ( ( ( Assignment ) someExpression ) . lhs ) ; } } else if ( someExpression instanceof QualifiedNameReference ) { QualifiedNameReference qualifiedNameReference = ( QualifiedNameReference ) someExpression ; if ( qualifiedNameReference . indexOfFirstFieldBinding != <NUM_LIT:1> && qualifiedNameReference . otherBindings == null ) { return qualifiedNameReference . binding ; } } else if ( someExpression . isThis ( ) ) { return someExpression . resolvedType ; } return null ; } public boolean isCompactableOperation ( ) { return false ; } public boolean isConstantValueOfTypeAssignableToType ( TypeBinding constantType , TypeBinding targetType ) { if ( this . constant == Constant . NotAConstant ) return false ; if ( constantType == targetType ) return true ; if ( BaseTypeBinding . isWidening ( TypeIds . T_int , constantType . id ) && ( BaseTypeBinding . isNarrowing ( targetType . id , TypeIds . T_int ) ) ) { return isConstantValueRepresentable ( this . constant , constantType . id , targetType . id ) ; } return false ; } public boolean isTypeReference ( ) { return false ; } public LocalVariableBinding localVariableBinding ( ) { return null ; } public void markAsNonNull ( ) { this . bits |= ASTNode . IsNonNull ; } public int nullStatus ( FlowInfo flowInfo ) { if ( this . constant != null && this . constant != Constant . NotAConstant ) return FlowInfo . NON_NULL ; LocalVariableBinding local = localVariableBinding ( ) ; if ( local != null ) return flowInfo . nullStatus ( local ) ; return FlowInfo . NON_NULL ; } public Constant optimizedBooleanConstant ( ) { return this . constant ; } public TypeBinding postConversionType ( Scope scope ) { TypeBinding convertedType = this . resolvedType ; int runtimeType = ( this . implicitConversion & TypeIds . IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ; switch ( runtimeType ) { case T_boolean : convertedType = TypeBinding . BOOLEAN ; break ; case T_byte : convertedType = TypeBinding . BYTE ; break ; case T_short : convertedType = TypeBinding . SHORT ; break ; case T_char : convertedType = TypeBinding . CHAR ; break ; case T_int : convertedType = TypeBinding . INT ; break ; case T_float : convertedType = TypeBinding . FLOAT ; break ; case T_long : convertedType = TypeBinding . LONG ; break ; case T_double : convertedType = TypeBinding . DOUBLE ; break ; default : } if ( ( this . implicitConversion & TypeIds . BOXING ) != <NUM_LIT:0> ) { convertedType = scope . environment ( ) . computeBoxingType ( convertedType ) ; } return convertedType ; } public StringBuffer print ( int indent , StringBuffer output ) { printIndent ( indent , output ) ; return printExpression ( indent , output ) ; } public abstract StringBuffer printExpression ( int indent , StringBuffer output ) ; public StringBuffer printStatement ( int indent , StringBuffer output ) { return print ( indent , output ) . append ( "<STR_LIT:;>" ) ; } public void resolve ( BlockScope scope ) { this . resolveType ( scope ) ; return ; } public TypeBinding resolveType ( BlockScope scope ) { return null ; } public TypeBinding resolveType ( ClassScope scope ) { return null ; } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { setExpectedType ( expectedType ) ; TypeBinding expressionType = this . resolveType ( scope ) ; if ( expressionType == null ) return null ; if ( expressionType == expectedType ) return expressionType ; if ( ! expressionType . isCompatibleWith ( expectedType ) ) { if ( scope . isBoxingCompatibleWith ( expressionType , expectedType ) ) { computeConversion ( scope , expectedType , expressionType ) ; } else { scope . problemReporter ( ) . typeMismatchError ( expressionType , expectedType , this , null ) ; return null ; } } return expressionType ; } public boolean forcedToBeRaw ( ReferenceContext referenceContext ) { if ( this instanceof NameReference ) { final Binding receiverBinding = ( ( NameReference ) this ) . binding ; if ( receiverBinding . isParameter ( ) && ( ( ( LocalVariableBinding ) receiverBinding ) . tagBits & TagBits . ForcedToBeRawType ) != <NUM_LIT:0> ) { return true ; } else if ( receiverBinding instanceof FieldBinding ) { FieldBinding field = ( FieldBinding ) receiverBinding ; if ( field . type . isRawType ( ) ) { if ( referenceContext instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration methodDecl = ( AbstractMethodDeclaration ) referenceContext ; if ( field . declaringClass != methodDecl . binding . declaringClass ) { return true ; } } else if ( referenceContext instanceof TypeDeclaration ) { TypeDeclaration type = ( TypeDeclaration ) referenceContext ; if ( field . declaringClass != type . binding ) { return true ; } } } } } else if ( this instanceof MessageSend ) { if ( ! CharOperation . equals ( ( ( MessageSend ) this ) . binding . declaringClass . getFileName ( ) , referenceContext . compilationResult ( ) . getFileName ( ) ) ) { return true ; } } else if ( this instanceof FieldReference ) { FieldBinding field = ( ( FieldReference ) this ) . binding ; if ( ! CharOperation . equals ( field . declaringClass . getFileName ( ) , referenceContext . compilationResult ( ) . getFileName ( ) ) ) { return true ; } if ( field . type . isRawType ( ) ) { if ( referenceContext instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration methodDecl = ( AbstractMethodDeclaration ) referenceContext ; if ( field . declaringClass != methodDecl . binding . declaringClass ) { return true ; } } else if ( referenceContext instanceof TypeDeclaration ) { TypeDeclaration type = ( TypeDeclaration ) referenceContext ; if ( field . declaringClass != type . binding ) { return true ; } } } } else if ( this instanceof ConditionalExpression ) { ConditionalExpression ternary = ( ConditionalExpression ) this ; if ( ternary . valueIfTrue . forcedToBeRaw ( referenceContext ) || ternary . valueIfFalse . forcedToBeRaw ( referenceContext ) ) { return true ; } } return false ; } public Object reusableJSRTarget ( ) { if ( this . constant != Constant . NotAConstant ) return this . constant ; return null ; } public void setExpectedType ( TypeBinding expectedType ) { } public void tagAsNeedCheckCast ( ) { } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { } public Expression toTypeReference ( ) { return this ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class QualifiedThisReference extends ThisReference { public TypeReference qualification ; ReferenceBinding currentCompatibleType ; public QualifiedThisReference ( TypeReference name , int sourceStart , int sourceEnd ) { super ( sourceStart , sourceEnd ) ; this . qualification = name ; name . bits |= IgnoreRawTypeCheck ; this . sourceStart = name . sourceStart ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { return flowInfo ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { if ( ( this . bits & DepthMASK ) != <NUM_LIT:0> ) { Object [ ] emulationPath = currentScope . getEmulationPath ( this . currentCompatibleType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , this . currentCompatibleType , currentScope ) ; } else { codeStream . aload_0 ( ) ; } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; TypeBinding type = this . qualification . resolveType ( scope , true ) ; if ( type == null || ! type . isValidBinding ( ) ) return null ; type = type . erasure ( ) ; if ( type instanceof ReferenceBinding ) { this . resolvedType = scope . environment ( ) . convertToParameterizedType ( ( ReferenceBinding ) type ) ; } else { this . resolvedType = type ; } int depth = <NUM_LIT:0> ; this . currentCompatibleType = scope . referenceType ( ) . binding ; while ( this . currentCompatibleType != null && this . currentCompatibleType != type ) { depth ++ ; this . currentCompatibleType = this . currentCompatibleType . isStatic ( ) ? null : this . currentCompatibleType . enclosingType ( ) ; } this . bits &= ~ DepthMASK ; this . bits |= ( depth & <NUM_LIT> ) << DepthSHIFT ; if ( this . currentCompatibleType == null ) { scope . problemReporter ( ) . noSuchEnclosingInstance ( type , this , false ) ; return this . resolvedType ; } if ( depth == <NUM_LIT:0> ) { checkAccess ( scope . methodScope ( ) ) ; } return this . resolvedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { return this . qualification . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . qualification . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } public void traverse ( ASTVisitor visitor , ClassScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . qualification . traverse ( visitor , blockScope ) ; } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; 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 . flow . LoopingFlowContext ; import org . eclipse . jdt . internal . compiler . flow . UnconditionalFlowInfo ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . ArrayBinding ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . ParameterizedTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class ForeachStatement extends Statement { public LocalDeclaration elementVariable ; public int elementVariableImplicitWidening = - <NUM_LIT:1> ; public Expression collection ; public Statement action ; private int kind ; private static final int ARRAY = <NUM_LIT:0> ; private static final int RAW_ITERABLE = <NUM_LIT:1> ; private static final int GENERIC_ITERABLE = <NUM_LIT:2> ; private TypeBinding iteratorReceiverType ; private TypeBinding collectionElementType ; private BranchLabel breakLabel ; private BranchLabel continueLabel ; public BlockScope scope ; public LocalVariableBinding indexVariable ; public LocalVariableBinding collectionVariable ; public LocalVariableBinding maxVariable ; private static final char [ ] SecretIteratorVariableName = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] SecretIndexVariableName = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] SecretCollectionVariableName = "<STR_LIT>" . toCharArray ( ) ; private static final char [ ] SecretMaxVariableName = "<STR_LIT>" . toCharArray ( ) ; int postCollectionInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; public ForeachStatement ( LocalDeclaration elementVariable , int start ) { this . elementVariable = elementVariable ; this . sourceStart = start ; this . kind = - <NUM_LIT:1> ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . breakLabel = new BranchLabel ( ) ; this . continueLabel = new BranchLabel ( ) ; int initialComplaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; this . collection . checkNPE ( currentScope , flowContext , flowInfo ) ; flowInfo = this . elementVariable . analyseCode ( this . scope , flowContext , flowInfo ) ; FlowInfo condInfo = this . collection . analyseCode ( this . scope , flowContext , flowInfo . copy ( ) ) ; LocalVariableBinding elementVarBinding = this . elementVariable . binding ; condInfo . markAsDefinitelyAssigned ( elementVarBinding ) ; this . postCollectionInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( condInfo ) ; LoopingFlowContext loopingContext = new LoopingFlowContext ( flowContext , flowInfo , this , this . breakLabel , this . continueLabel , this . scope ) ; UnconditionalFlowInfo actionInfo = condInfo . nullInfoLessUnconditionalCopy ( ) ; actionInfo . markAsDefinitelyUnknown ( elementVarBinding ) ; if ( currentScope . compilerOptions ( ) . isAnnotationBasedNullAnalysisEnabled ) { int nullStatus = this . elementVariable . checkAssignmentAgainstNullAnnotation ( currentScope , flowContext , elementVarBinding , FlowInfo . UNKNOWN , this . collection , this . collectionElementType ) ; if ( ( elementVarBinding . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { actionInfo . markNullStatus ( elementVarBinding , nullStatus ) ; } } FlowInfo exitBranch ; if ( ! ( this . action == null || ( this . action . isEmptyBlock ( ) && currentScope . compilerOptions ( ) . complianceLevel <= ClassFileConstants . JDK1_3 ) ) ) { if ( this . action . complainIfUnreachable ( actionInfo , this . scope , initialComplaintLevel , true ) < Statement . COMPLAINED_UNREACHABLE ) { actionInfo = this . action . analyseCode ( this . scope , loopingContext , actionInfo ) . unconditionalCopy ( ) ; } exitBranch = flowInfo . unconditionalCopy ( ) . addInitializationsFrom ( condInfo . initsWhenFalse ( ) ) ; if ( ( actionInfo . tagBits & loopingContext . initsOnContinue . tagBits & FlowInfo . UNREACHABLE_OR_DEAD ) != <NUM_LIT:0> ) { this . continueLabel = null ; } else { actionInfo = actionInfo . mergedWith ( loopingContext . initsOnContinue ) ; loopingContext . complainOnDeferredFinalChecks ( this . scope , actionInfo ) ; exitBranch . addPotentialInitializationsFrom ( actionInfo ) ; } } else { exitBranch = condInfo . initsWhenFalse ( ) ; } final boolean hasEmptyAction = this . action == null || this . action . isEmptyBlock ( ) || ( ( this . action . bits & IsUsefulEmptyStatement ) != <NUM_LIT:0> ) ; switch ( this . kind ) { case ARRAY : if ( ! hasEmptyAction || elementVarBinding . resolvedPosition != - <NUM_LIT:1> ) { this . collectionVariable . useFlag = LocalVariableBinding . USED ; if ( this . continueLabel != null ) { this . indexVariable . useFlag = LocalVariableBinding . USED ; this . maxVariable . useFlag = LocalVariableBinding . USED ; } } break ; case RAW_ITERABLE : case GENERIC_ITERABLE : this . indexVariable . useFlag = LocalVariableBinding . USED ; break ; } loopingContext . complainOnDeferredNullChecks ( currentScope , actionInfo ) ; FlowInfo mergedInfo = FlowInfo . mergedOptimizedBranches ( ( loopingContext . initsOnBreak . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? loopingContext . initsOnBreak : flowInfo . addInitializationsFrom ( loopingContext . initsOnBreak ) , false , exitBranch , false , true ) ; mergedInfo . resetAssignmentInfo ( this . elementVariable . binding ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; final boolean hasEmptyAction = this . action == null || this . action . isEmptyBlock ( ) || ( ( this . action . bits & IsUsefulEmptyStatement ) != <NUM_LIT:0> ) ; if ( hasEmptyAction && this . elementVariable . binding . resolvedPosition == - <NUM_LIT:1> && this . kind == ARRAY ) { this . collection . generateCode ( this . scope , codeStream , false ) ; codeStream . exitUserScope ( this . scope ) ; if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } switch ( this . kind ) { case ARRAY : this . collection . generateCode ( this . scope , codeStream , true ) ; codeStream . store ( this . collectionVariable , true ) ; codeStream . addVariable ( this . collectionVariable ) ; if ( this . continueLabel != null ) { codeStream . arraylength ( ) ; codeStream . store ( this . maxVariable , false ) ; codeStream . addVariable ( this . maxVariable ) ; codeStream . iconst_0 ( ) ; codeStream . store ( this . indexVariable , false ) ; codeStream . addVariable ( this . indexVariable ) ; } else { } break ; case RAW_ITERABLE : case GENERIC_ITERABLE : this . collection . generateCode ( this . scope , codeStream , true ) ; codeStream . invokeIterableIterator ( this . iteratorReceiverType ) ; codeStream . store ( this . indexVariable , false ) ; codeStream . addVariable ( this . indexVariable ) ; break ; } BranchLabel actionLabel = new BranchLabel ( codeStream ) ; actionLabel . tagBits |= BranchLabel . USED ; BranchLabel conditionLabel = new BranchLabel ( codeStream ) ; conditionLabel . tagBits |= BranchLabel . USED ; this . breakLabel . initialize ( codeStream ) ; if ( this . continueLabel == null ) { conditionLabel . place ( ) ; int conditionPC = codeStream . position ; switch ( this . kind ) { case ARRAY : codeStream . arraylength ( ) ; codeStream . ifeq ( this . breakLabel ) ; break ; case RAW_ITERABLE : case GENERIC_ITERABLE : codeStream . load ( this . indexVariable ) ; codeStream . invokeJavaUtilIteratorHasNext ( ) ; codeStream . ifeq ( this . breakLabel ) ; break ; } codeStream . recordPositionsFrom ( conditionPC , this . elementVariable . sourceStart ) ; } else { this . continueLabel . initialize ( codeStream ) ; this . continueLabel . tagBits |= BranchLabel . USED ; codeStream . goto_ ( conditionLabel ) ; } actionLabel . place ( ) ; switch ( this . kind ) { case ARRAY : if ( this . elementVariable . binding . resolvedPosition != - <NUM_LIT:1> ) { codeStream . load ( this . collectionVariable ) ; if ( this . continueLabel == null ) { codeStream . iconst_0 ( ) ; } else { codeStream . load ( this . indexVariable ) ; } codeStream . arrayAt ( this . collectionElementType . id ) ; if ( this . elementVariableImplicitWidening != - <NUM_LIT:1> ) { codeStream . generateImplicitConversion ( this . elementVariableImplicitWidening ) ; } codeStream . store ( this . elementVariable . binding , false ) ; codeStream . addVisibleLocalVariable ( this . elementVariable . binding ) ; if ( this . postCollectionInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . postCollectionInitStateIndex ) ; } } break ; case RAW_ITERABLE : case GENERIC_ITERABLE : codeStream . load ( this . indexVariable ) ; codeStream . invokeJavaUtilIteratorNext ( ) ; if ( this . elementVariable . binding . type . id != T_JavaLangObject ) { if ( this . elementVariableImplicitWidening != - <NUM_LIT:1> ) { codeStream . checkcast ( this . collectionElementType ) ; codeStream . generateImplicitConversion ( this . elementVariableImplicitWidening ) ; } else { codeStream . checkcast ( this . elementVariable . binding . type ) ; } } if ( this . elementVariable . binding . resolvedPosition == - <NUM_LIT:1> ) { codeStream . pop ( ) ; } else { codeStream . store ( this . elementVariable . binding , false ) ; codeStream . addVisibleLocalVariable ( this . elementVariable . binding ) ; if ( this . postCollectionInitStateIndex != - <NUM_LIT:1> ) { codeStream . addDefinitelyAssignedVariables ( currentScope , this . postCollectionInitStateIndex ) ; } } break ; } if ( ! hasEmptyAction ) { this . action . generateCode ( this . scope , codeStream ) ; } codeStream . removeVariable ( this . elementVariable . binding ) ; if ( this . postCollectionInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . postCollectionInitStateIndex ) ; } if ( this . continueLabel != null ) { this . continueLabel . place ( ) ; int continuationPC = codeStream . position ; switch ( this . kind ) { case ARRAY : if ( ! hasEmptyAction || this . elementVariable . binding . resolvedPosition >= <NUM_LIT:0> ) { codeStream . iinc ( this . indexVariable . resolvedPosition , <NUM_LIT:1> ) ; } conditionLabel . place ( ) ; codeStream . load ( this . indexVariable ) ; codeStream . load ( this . maxVariable ) ; codeStream . if_icmplt ( actionLabel ) ; break ; case RAW_ITERABLE : case GENERIC_ITERABLE : conditionLabel . place ( ) ; codeStream . load ( this . indexVariable ) ; codeStream . invokeJavaUtilIteratorHasNext ( ) ; codeStream . ifne ( actionLabel ) ; break ; } codeStream . recordPositionsFrom ( continuationPC , this . elementVariable . sourceStart ) ; } switch ( this . kind ) { case ARRAY : codeStream . removeVariable ( this . indexVariable ) ; codeStream . removeVariable ( this . maxVariable ) ; codeStream . removeVariable ( this . collectionVariable ) ; break ; case RAW_ITERABLE : case GENERIC_ITERABLE : codeStream . removeVariable ( this . indexVariable ) ; break ; } codeStream . exitUserScope ( this . scope ) ; if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } this . breakLabel . place ( ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . elementVariable . printAsExpression ( <NUM_LIT:0> , output ) ; output . append ( "<STR_LIT:U+0020:U+0020>" ) ; if ( this . collection != null ) { this . collection . print ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; } else { output . append ( '<CHAR_LIT:)>' ) ; } if ( this . action == null ) { output . append ( '<CHAR_LIT:;>' ) ; } else { output . append ( '<STR_LIT:\n>' ) ; this . action . printStatement ( indent + <NUM_LIT:1> , output ) ; } return output ; } public void resolve ( BlockScope upperScope ) { this . scope = new BlockScope ( upperScope ) ; this . elementVariable . resolve ( this . scope ) ; TypeBinding elementType = this . elementVariable . type . resolvedType ; TypeBinding collectionType = this . collection == null ? null : this . collection . resolveType ( this . scope ) ; TypeBinding expectedCollectionType = null ; if ( elementType != null && collectionType != null ) { boolean isTargetJsr14 = this . scope . compilerOptions ( ) . targetJDK == ClassFileConstants . JDK1_4 ; if ( collectionType . isArrayType ( ) ) { this . kind = ARRAY ; this . collectionElementType = ( ( ArrayBinding ) collectionType ) . elementsType ( ) ; if ( ! this . collectionElementType . isCompatibleWith ( elementType ) && ! this . scope . isBoxingCompatibleWith ( this . collectionElementType , elementType ) ) { this . scope . problemReporter ( ) . notCompatibleTypesErrorInForeach ( this . collection , this . collectionElementType , elementType ) ; } else if ( this . collectionElementType . needsUncheckedConversion ( elementType ) ) { this . scope . problemReporter ( ) . unsafeTypeConversion ( this . collection , collectionType , upperScope . createArrayType ( elementType , <NUM_LIT:1> ) ) ; } int compileTimeTypeID = this . collectionElementType . id ; if ( elementType . isBaseType ( ) ) { this . collection . computeConversion ( this . scope , collectionType , collectionType ) ; if ( ! this . collectionElementType . isBaseType ( ) ) { compileTimeTypeID = this . scope . environment ( ) . computeBoxingType ( this . collectionElementType ) . id ; this . elementVariableImplicitWidening = UNBOXING ; if ( elementType . isBaseType ( ) ) { this . elementVariableImplicitWidening |= ( elementType . id << <NUM_LIT:4> ) + compileTimeTypeID ; this . scope . problemReporter ( ) . autoboxing ( this . collection , this . collectionElementType , elementType ) ; } } else { this . elementVariableImplicitWidening = ( elementType . id << <NUM_LIT:4> ) + compileTimeTypeID ; } } else if ( this . collectionElementType . isBaseType ( ) ) { this . collection . computeConversion ( this . scope , collectionType , collectionType ) ; int boxedID = this . scope . environment ( ) . computeBoxingType ( this . collectionElementType ) . id ; this . elementVariableImplicitWidening = BOXING | ( compileTimeTypeID << <NUM_LIT:4> ) | compileTimeTypeID ; compileTimeTypeID = boxedID ; this . scope . problemReporter ( ) . autoboxing ( this . collection , this . collectionElementType , elementType ) ; } else { expectedCollectionType = upperScope . createArrayType ( elementType , <NUM_LIT:1> ) ; this . collection . computeConversion ( this . scope , expectedCollectionType , collectionType ) ; } } else if ( collectionType instanceof ReferenceBinding ) { ReferenceBinding iterableType = ( ( ReferenceBinding ) collectionType ) . findSuperTypeOriginatingFrom ( T_JavaLangIterable , false ) ; if ( iterableType == null && isTargetJsr14 ) { iterableType = ( ( ReferenceBinding ) collectionType ) . findSuperTypeOriginatingFrom ( T_JavaUtilCollection , false ) ; } checkIterable : { if ( iterableType == null ) break checkIterable ; this . iteratorReceiverType = collectionType . erasure ( ) ; if ( isTargetJsr14 ) { if ( ( ( ReferenceBinding ) this . iteratorReceiverType ) . findSuperTypeOriginatingFrom ( T_JavaUtilCollection , false ) == null ) { this . iteratorReceiverType = iterableType ; this . collection . computeConversion ( this . scope , iterableType , collectionType ) ; } else { this . collection . computeConversion ( this . scope , collectionType , collectionType ) ; } } else if ( ( ( ReferenceBinding ) this . iteratorReceiverType ) . findSuperTypeOriginatingFrom ( T_JavaLangIterable , false ) == null ) { this . iteratorReceiverType = iterableType ; this . collection . computeConversion ( this . scope , iterableType , collectionType ) ; } else { this . collection . computeConversion ( this . scope , collectionType , collectionType ) ; } TypeBinding [ ] arguments = null ; switch ( iterableType . kind ( ) ) { case Binding . RAW_TYPE : this . kind = RAW_ITERABLE ; this . collectionElementType = this . scope . getJavaLangObject ( ) ; if ( ! this . collectionElementType . isCompatibleWith ( elementType ) && ! this . scope . isBoxingCompatibleWith ( this . collectionElementType , elementType ) ) { this . scope . problemReporter ( ) . notCompatibleTypesErrorInForeach ( this . collection , this . collectionElementType , elementType ) ; } break checkIterable ; case Binding . GENERIC_TYPE : arguments = iterableType . typeVariables ( ) ; break ; case Binding . PARAMETERIZED_TYPE : arguments = ( ( ParameterizedTypeBinding ) iterableType ) . arguments ; break ; default : break checkIterable ; } if ( arguments . length != <NUM_LIT:1> ) break checkIterable ; this . kind = GENERIC_ITERABLE ; this . collectionElementType = arguments [ <NUM_LIT:0> ] ; if ( ! this . collectionElementType . isCompatibleWith ( elementType ) && ! this . scope . isBoxingCompatibleWith ( this . collectionElementType , elementType ) ) { this . scope . problemReporter ( ) . notCompatibleTypesErrorInForeach ( this . collection , this . collectionElementType , elementType ) ; } int compileTimeTypeID = this . collectionElementType . id ; if ( elementType . isBaseType ( ) ) { if ( ! this . collectionElementType . isBaseType ( ) ) { compileTimeTypeID = this . scope . environment ( ) . computeBoxingType ( this . collectionElementType ) . id ; this . elementVariableImplicitWidening = UNBOXING ; if ( elementType . isBaseType ( ) ) { this . elementVariableImplicitWidening |= ( elementType . id << <NUM_LIT:4> ) + compileTimeTypeID ; } } else { this . elementVariableImplicitWidening = ( elementType . id << <NUM_LIT:4> ) + compileTimeTypeID ; } } else { if ( this . collectionElementType . isBaseType ( ) ) { this . elementVariableImplicitWidening = BOXING | ( compileTimeTypeID << <NUM_LIT:4> ) | compileTimeTypeID ; } } } } switch ( this . kind ) { case ARRAY : this . indexVariable = new LocalVariableBinding ( SecretIndexVariableName , TypeBinding . INT , ClassFileConstants . AccDefault , false ) ; this . scope . addLocalVariable ( this . indexVariable ) ; this . indexVariable . setConstant ( Constant . NotAConstant ) ; this . maxVariable = new LocalVariableBinding ( SecretMaxVariableName , TypeBinding . INT , ClassFileConstants . AccDefault , false ) ; this . scope . addLocalVariable ( this . maxVariable ) ; this . maxVariable . setConstant ( Constant . NotAConstant ) ; if ( expectedCollectionType == null ) { this . collectionVariable = new LocalVariableBinding ( SecretCollectionVariableName , collectionType , ClassFileConstants . AccDefault , false ) ; } else { this . collectionVariable = new LocalVariableBinding ( SecretCollectionVariableName , expectedCollectionType , ClassFileConstants . AccDefault , false ) ; } this . scope . addLocalVariable ( this . collectionVariable ) ; this . collectionVariable . setConstant ( Constant . NotAConstant ) ; break ; case RAW_ITERABLE : case GENERIC_ITERABLE : this . indexVariable = new LocalVariableBinding ( SecretIteratorVariableName , this . scope . getJavaUtilIterator ( ) , ClassFileConstants . AccDefault , false ) ; this . scope . addLocalVariable ( this . indexVariable ) ; this . indexVariable . setConstant ( Constant . NotAConstant ) ; break ; default : if ( isTargetJsr14 ) { this . scope . problemReporter ( ) . invalidTypeForCollectionTarget14 ( this . collection ) ; } else { this . scope . problemReporter ( ) . invalidTypeForCollection ( this . collection ) ; } } } if ( this . action != null ) { this . action . resolve ( this . scope ) ; } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . elementVariable . traverse ( visitor , this . scope ) ; if ( this . collection != null ) { this . collection . traverse ( visitor , this . scope ) ; } if ( this . action != null ) { this . action . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . ExceptionLabel ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public abstract class SubRoutineStatement extends Statement { public static void reenterAllExceptionHandlers ( SubRoutineStatement [ ] subroutines , int max , CodeStream codeStream ) { if ( subroutines == null ) return ; if ( max < <NUM_LIT:0> ) max = subroutines . length ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { SubRoutineStatement sub = subroutines [ i ] ; sub . enterAnyExceptionHandler ( codeStream ) ; sub . enterDeclaredExceptionHandlers ( codeStream ) ; } } ExceptionLabel anyExceptionLabel ; public ExceptionLabel enterAnyExceptionHandler ( CodeStream codeStream ) { if ( this . anyExceptionLabel == null ) { this . anyExceptionLabel = new ExceptionLabel ( codeStream , null ) ; } this . anyExceptionLabel . placeStart ( ) ; return this . anyExceptionLabel ; } public void enterDeclaredExceptionHandlers ( CodeStream codeStream ) { } public void exitAnyExceptionHandler ( ) { if ( this . anyExceptionLabel != null ) { this . anyExceptionLabel . placeEnd ( ) ; } } public void exitDeclaredExceptionHandlers ( CodeStream codeStream ) { } public abstract boolean generateSubRoutineInvocation ( BlockScope currentScope , CodeStream codeStream , Object targetLocation , int stateIndex , LocalVariableBinding secretLocal ) ; public abstract boolean isSubRoutineEscaping ( ) ; public void placeAllAnyExceptionHandler ( ) { this . anyExceptionLabel . place ( ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . * ; public class Initializer extends FieldDeclaration { public Block block ; public int lastVisibleFieldID ; public int bodyStart ; public int bodyEnd ; public Initializer ( Block block , int modifiers ) { this . block = block ; this . modifiers = modifiers ; if ( block != null ) { this . declarationSourceStart = this . sourceStart = block . sourceStart ; } } public FlowInfo analyseCode ( MethodScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( this . block != null ) { return this . block . analyseCode ( currentScope , flowContext , flowInfo ) ; } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; if ( this . block != null ) this . block . generateCode ( currentScope , codeStream ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public int getKind ( ) { return INITIALIZER ; } public boolean isStatic ( ) { return ( this . modifiers & ClassFileConstants . AccStatic ) != <NUM_LIT:0> ; } public void parseStatements ( Parser parser , TypeDeclaration typeDeclaration , CompilationUnitDeclaration unit ) { parser . parse ( this , typeDeclaration , unit ) ; } public StringBuffer printStatement ( int indent , StringBuffer output ) { if ( this . modifiers != <NUM_LIT:0> ) { printIndent ( indent , output ) ; printModifiers ( this . modifiers , output ) ; if ( this . annotations != null ) printAnnotations ( this . annotations , output ) ; output . append ( "<STR_LIT>" ) ; if ( this . block != null ) { this . block . printBody ( indent , output ) ; } printIndent ( indent , output ) . append ( '<CHAR_LIT:}>' ) ; return output ; } else if ( this . block != null ) { this . block . printStatement ( indent , output ) ; } else { printIndent ( indent , output ) . append ( "<STR_LIT:{}>" ) ; } return output ; } public void resolve ( MethodScope scope ) { FieldBinding previousField = scope . initializedField ; int previousFieldID = scope . lastVisibleFieldID ; try { scope . initializedField = null ; scope . lastVisibleFieldID = this . lastVisibleFieldID ; if ( isStatic ( ) ) { ReferenceBinding declaringType = scope . enclosingSourceType ( ) ; if ( declaringType . isNestedType ( ) && ! declaringType . isStatic ( ) ) scope . problemReporter ( ) . innerTypesCannotDeclareStaticInitializers ( declaringType , this ) ; } if ( this . block != null ) this . block . resolve ( scope ) ; } finally { scope . initializedField = previousField ; scope . lastVisibleFieldID = previousFieldID ; } } public void traverse ( ASTVisitor visitor , MethodScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . block != null ) this . block . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class PrefixExpression extends CompoundAssignment { public PrefixExpression ( Expression lhs , Expression expression , int operator , int pos ) { super ( lhs , expression , operator , lhs . sourceEnd ) ; this . sourceStart = pos ; this . sourceEnd = lhs . sourceEnd ; } public boolean checkCastCompatibility ( ) { return false ; } public String operatorToString ( ) { switch ( this . operator ) { case PLUS : return "<STR_LIT>" ; case MINUS : return "<STR_LIT:-->" ; } return "<STR_LIT>" ; } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { output . append ( operatorToString ( ) ) . append ( '<CHAR_LIT:U+0020>' ) ; return this . lhs . printExpression ( <NUM_LIT:0> , output ) ; } public boolean restrainUsageToNumericTypes ( ) { return true ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . lhs . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . codegen . * ; 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 . lookup . * ; public class ThisReference extends Reference { public static ThisReference implicitThis ( ) { ThisReference implicitThis = new ThisReference ( <NUM_LIT:0> , <NUM_LIT:0> ) ; implicitThis . bits |= IsImplicitThis ; return implicitThis ; } public ThisReference ( int sourceStart , int sourceEnd ) { this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { return flowInfo ; } public boolean checkAccess ( MethodScope methodScope ) { if ( methodScope . isConstructorCall ) { methodScope . problemReporter ( ) . fieldsOrThisBeforeConstructorInvocation ( this ) ; return false ; } if ( methodScope . isStatic ) { methodScope . problemReporter ( ) . errorThisSuperInStatic ( this ) ; return false ; } return true ; } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) codeStream . aload_0 ( ) ; if ( ( this . bits & IsImplicitThis ) == <NUM_LIT:0> ) codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public boolean isImplicitThis ( ) { return ( this . bits & IsImplicitThis ) != <NUM_LIT:0> ; } public boolean isThis ( ) { return true ; } public int nullStatus ( FlowInfo flowInfo ) { return FlowInfo . NON_NULL ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { if ( isImplicitThis ( ) ) return output ; return output . append ( "<STR_LIT>" ) ; } public TypeBinding resolveType ( BlockScope scope ) { this . constant = Constant . NotAConstant ; if ( ! isImplicitThis ( ) && ! checkAccess ( scope . methodScope ( ) ) ) { return null ; } return this . resolvedType = scope . enclosingReceiverType ( ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { visitor . visit ( this , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } public void traverse ( ASTVisitor visitor , ClassScope blockScope ) { visitor . visit ( this , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( ! isImplicitThis ( ) ) { currentScope . resetEnclosingMethodStaticFlag ( ) ; } return super . analyseCode ( currentScope , flowContext , flowInfo ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import java . util . Arrays ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; public class SwitchStatement extends Statement { public Expression expression ; public Statement [ ] statements ; public BlockScope scope ; public int explicitDeclarations ; public BranchLabel breakLabel ; public CaseStatement [ ] cases ; public CaseStatement defaultCase ; public int blockStart ; public int caseCount ; int [ ] constants ; String [ ] stringConstants ; public final static int CASE = <NUM_LIT:0> ; public final static int FALLTHROUGH = <NUM_LIT:1> ; public final static int ESCAPING = <NUM_LIT:2> ; private static final char [ ] SecretStringVariableName = "<STR_LIT>" . toCharArray ( ) ; public SyntheticMethodBinding synthetic ; int preSwitchInitStateIndex = - <NUM_LIT:1> ; int mergedInitStateIndex = - <NUM_LIT:1> ; CaseStatement [ ] duplicateCaseStatements = null ; int duplicateCaseStatementsCounter = <NUM_LIT:0> ; private LocalVariableBinding dispatchStringCopy = null ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { try { flowInfo = this . expression . analyseCode ( currentScope , flowContext , flowInfo ) ; if ( ( this . expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> || ( this . expression . resolvedType != null && this . expression . resolvedType . id == T_JavaLangString ) ) { this . expression . checkNPE ( currentScope , flowContext , flowInfo ) ; } SwitchFlowContext switchContext = new SwitchFlowContext ( flowContext , this , ( this . breakLabel = new BranchLabel ( ) ) ) ; FlowInfo caseInits = FlowInfo . DEAD_END ; this . preSwitchInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; int caseIndex = <NUM_LIT:0> ; if ( this . statements != null ) { int initialComplaintLevel = ( flowInfo . reachMode ( ) & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> ? Statement . COMPLAINED_FAKE_REACHABLE : Statement . NOT_COMPLAINED ; int complaintLevel = initialComplaintLevel ; int fallThroughState = CASE ; for ( int i = <NUM_LIT:0> , max = this . statements . length ; i < max ; i ++ ) { Statement statement = this . statements [ i ] ; if ( ( caseIndex < this . caseCount ) && ( statement == this . cases [ caseIndex ] ) ) { this . scope . enclosingCase = this . cases [ caseIndex ] ; caseIndex ++ ; if ( fallThroughState == FALLTHROUGH && ( statement . bits & ASTNode . DocumentedFallthrough ) == <NUM_LIT:0> ) { this . scope . problemReporter ( ) . possibleFallThroughCase ( this . scope . enclosingCase ) ; } caseInits = caseInits . mergedWith ( flowInfo . unconditionalInits ( ) ) ; complaintLevel = initialComplaintLevel ; fallThroughState = CASE ; } else if ( statement == this . defaultCase ) { this . scope . enclosingCase = this . defaultCase ; if ( fallThroughState == FALLTHROUGH && ( statement . bits & ASTNode . DocumentedFallthrough ) == <NUM_LIT:0> ) { this . scope . problemReporter ( ) . possibleFallThroughCase ( this . scope . enclosingCase ) ; } caseInits = caseInits . mergedWith ( flowInfo . unconditionalInits ( ) ) ; complaintLevel = initialComplaintLevel ; fallThroughState = CASE ; } else { fallThroughState = FALLTHROUGH ; } if ( ( complaintLevel = statement . complainIfUnreachable ( caseInits , this . scope , complaintLevel , true ) ) < Statement . COMPLAINED_UNREACHABLE ) { caseInits = statement . analyseCode ( this . scope , switchContext , caseInits ) ; if ( caseInits == FlowInfo . DEAD_END ) { fallThroughState = ESCAPING ; } } } } final TypeBinding resolvedTypeBinding = this . expression . resolvedType ; if ( resolvedTypeBinding . isEnum ( ) ) { final SourceTypeBinding sourceTypeBinding = currentScope . classScope ( ) . referenceContext . binding ; this . synthetic = sourceTypeBinding . addSyntheticMethodForSwitchEnum ( resolvedTypeBinding ) ; } if ( this . defaultCase == null ) { flowInfo . addPotentialInitializationsFrom ( caseInits . mergedWith ( switchContext . initsOnBreak ) ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; return flowInfo ; } FlowInfo mergedInfo = caseInits . mergedWith ( switchContext . initsOnBreak ) ; this . mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } finally { if ( this . scope != null ) this . scope . enclosingCase = null ; } } public void generateCodeForStringSwitch ( BlockScope currentScope , CodeStream codeStream ) { try { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; class StringSwitchCase implements Comparable { int hashCode ; String string ; BranchLabel label ; public StringSwitchCase ( int hashCode , String string , BranchLabel label ) { this . hashCode = hashCode ; this . string = string ; this . label = label ; } public int compareTo ( Object o ) { StringSwitchCase that = ( StringSwitchCase ) o ; if ( this . hashCode == that . hashCode ) { return <NUM_LIT:0> ; } if ( this . hashCode > that . hashCode ) { return <NUM_LIT:1> ; } return - <NUM_LIT:1> ; } public String toString ( ) { return "<STR_LIT>" + "<STR_LIT>" + this . hashCode + "<STR_LIT>" + this . string + "<STR_LIT>" ; } } final boolean hasCases = this . caseCount != <NUM_LIT:0> ; StringSwitchCase [ ] stringCases = new StringSwitchCase [ this . caseCount ] ; BranchLabel [ ] sourceCaseLabels = new BranchLabel [ this . caseCount ] ; CaseLabel [ ] hashCodeCaseLabels = new CaseLabel [ this . caseCount ] ; this . constants = new int [ this . caseCount ] ; for ( int i = <NUM_LIT:0> , max = this . caseCount ; i < max ; i ++ ) { this . cases [ i ] . targetLabel = ( sourceCaseLabels [ i ] = new BranchLabel ( codeStream ) ) ; sourceCaseLabels [ i ] . tagBits |= BranchLabel . USED ; stringCases [ i ] = new StringSwitchCase ( this . stringConstants [ i ] . hashCode ( ) , this . stringConstants [ i ] , sourceCaseLabels [ i ] ) ; hashCodeCaseLabels [ i ] = new CaseLabel ( codeStream ) ; hashCodeCaseLabels [ i ] . tagBits |= BranchLabel . USED ; } Arrays . sort ( stringCases ) ; int uniqHashCount = <NUM_LIT:0> ; int lastHashCode = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . caseCount ; i < length ; ++ i ) { int hashCode = stringCases [ i ] . hashCode ; if ( i == <NUM_LIT:0> || hashCode != lastHashCode ) { lastHashCode = this . constants [ uniqHashCount ++ ] = hashCode ; } } if ( uniqHashCount != this . caseCount ) { System . arraycopy ( this . constants , <NUM_LIT:0> , this . constants = new int [ uniqHashCount ] , <NUM_LIT:0> , uniqHashCount ) ; System . arraycopy ( hashCodeCaseLabels , <NUM_LIT:0> , hashCodeCaseLabels = new CaseLabel [ uniqHashCount ] , <NUM_LIT:0> , uniqHashCount ) ; } int [ ] sortedIndexes = new int [ uniqHashCount ] ; for ( int i = <NUM_LIT:0> ; i < uniqHashCount ; i ++ ) { sortedIndexes [ i ] = i ; } CaseLabel defaultCaseLabel = new CaseLabel ( codeStream ) ; defaultCaseLabel . tagBits |= BranchLabel . USED ; this . breakLabel . initialize ( codeStream ) ; BranchLabel defaultBranchLabel = new BranchLabel ( codeStream ) ; if ( hasCases ) defaultBranchLabel . tagBits |= BranchLabel . USED ; if ( this . defaultCase != null ) { this . defaultCase . targetLabel = defaultBranchLabel ; } this . expression . generateCode ( currentScope , codeStream , true ) ; codeStream . store ( this . dispatchStringCopy , true ) ; codeStream . addVariable ( this . dispatchStringCopy ) ; codeStream . invokeStringHashCode ( ) ; if ( hasCases ) { codeStream . lookupswitch ( defaultCaseLabel , this . constants , sortedIndexes , hashCodeCaseLabels ) ; for ( int i = <NUM_LIT:0> , j = <NUM_LIT:0> , max = this . caseCount ; i < max ; i ++ ) { int hashCode = stringCases [ i ] . hashCode ; if ( i == <NUM_LIT:0> || hashCode != lastHashCode ) { lastHashCode = hashCode ; if ( i != <NUM_LIT:0> ) { codeStream . goto_ ( defaultBranchLabel ) ; } hashCodeCaseLabels [ j ++ ] . place ( ) ; } codeStream . load ( this . dispatchStringCopy ) ; codeStream . ldc ( stringCases [ i ] . string ) ; codeStream . invokeStringEquals ( ) ; codeStream . ifne ( stringCases [ i ] . label ) ; } codeStream . goto_ ( defaultBranchLabel ) ; } else { codeStream . pop ( ) ; } int caseIndex = <NUM_LIT:0> ; if ( this . statements != null ) { for ( int i = <NUM_LIT:0> , maxCases = this . statements . length ; i < maxCases ; i ++ ) { Statement statement = this . statements [ i ] ; if ( ( caseIndex < this . caseCount ) && ( statement == this . cases [ caseIndex ] ) ) { this . scope . enclosingCase = this . cases [ caseIndex ] ; if ( this . preSwitchInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preSwitchInitStateIndex ) ; } caseIndex ++ ; } else { if ( statement == this . defaultCase ) { defaultCaseLabel . place ( ) ; this . scope . enclosingCase = this . defaultCase ; if ( this . preSwitchInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preSwitchInitStateIndex ) ; } } } statement . generateCode ( this . scope , codeStream ) ; } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } codeStream . removeVariable ( this . dispatchStringCopy ) ; if ( this . scope != currentScope ) { codeStream . exitUserScope ( this . scope ) ; } this . breakLabel . place ( ) ; if ( this . defaultCase == null ) { codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd , true ) ; defaultCaseLabel . place ( ) ; defaultBranchLabel . place ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } catch ( Throwable e ) { e . printStackTrace ( ) ; } finally { if ( this . scope != null ) this . scope . enclosingCase = null ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( this . expression . resolvedType . id == TypeIds . T_JavaLangString ) { generateCodeForStringSwitch ( currentScope , codeStream ) ; return ; } try { if ( ( this . bits & IsReachable ) == <NUM_LIT:0> ) { return ; } int pc = codeStream . position ; this . breakLabel . initialize ( codeStream ) ; CaseLabel [ ] caseLabels = new CaseLabel [ this . caseCount ] ; for ( int i = <NUM_LIT:0> , max = this . caseCount ; i < max ; i ++ ) { this . cases [ i ] . targetLabel = ( caseLabels [ i ] = new CaseLabel ( codeStream ) ) ; caseLabels [ i ] . tagBits |= BranchLabel . USED ; } CaseLabel defaultLabel = new CaseLabel ( codeStream ) ; final boolean hasCases = this . caseCount != <NUM_LIT:0> ; if ( hasCases ) defaultLabel . tagBits |= BranchLabel . USED ; if ( this . defaultCase != null ) { this . defaultCase . targetLabel = defaultLabel ; } final TypeBinding resolvedType = this . expression . resolvedType ; boolean valueRequired = false ; if ( resolvedType . isEnum ( ) ) { codeStream . invoke ( Opcodes . OPC_invokestatic , this . synthetic , null ) ; this . expression . generateCode ( currentScope , codeStream , true ) ; codeStream . invokeEnumOrdinal ( resolvedType . constantPoolName ( ) ) ; codeStream . iaload ( ) ; if ( ! hasCases ) { codeStream . pop ( ) ; } } else { valueRequired = this . expression . constant == Constant . NotAConstant || hasCases ; this . expression . generateCode ( currentScope , codeStream , valueRequired ) ; } if ( hasCases ) { int [ ] sortedIndexes = new int [ this . caseCount ] ; for ( int i = <NUM_LIT:0> ; i < this . caseCount ; i ++ ) { sortedIndexes [ i ] = i ; } int [ ] localKeysCopy ; System . arraycopy ( this . constants , <NUM_LIT:0> , ( localKeysCopy = new int [ this . caseCount ] ) , <NUM_LIT:0> , this . caseCount ) ; CodeStream . sort ( localKeysCopy , <NUM_LIT:0> , this . caseCount - <NUM_LIT:1> , sortedIndexes ) ; int max = localKeysCopy [ this . caseCount - <NUM_LIT:1> ] ; int min = localKeysCopy [ <NUM_LIT:0> ] ; if ( ( long ) ( this . caseCount * <NUM_LIT> ) > ( ( long ) max - ( long ) min ) ) { if ( max > <NUM_LIT> && currentScope . compilerOptions ( ) . complianceLevel < ClassFileConstants . JDK1_4 ) { codeStream . lookupswitch ( defaultLabel , this . constants , sortedIndexes , caseLabels ) ; } else { codeStream . tableswitch ( defaultLabel , min , max , this . constants , sortedIndexes , caseLabels ) ; } } else { codeStream . lookupswitch ( defaultLabel , this . constants , sortedIndexes , caseLabels ) ; } codeStream . recordPositionsFrom ( codeStream . position , this . expression . sourceEnd ) ; } else if ( valueRequired ) { codeStream . pop ( ) ; } int caseIndex = <NUM_LIT:0> ; if ( this . statements != null ) { for ( int i = <NUM_LIT:0> , maxCases = this . statements . length ; i < maxCases ; i ++ ) { Statement statement = this . statements [ i ] ; if ( ( caseIndex < this . caseCount ) && ( statement == this . cases [ caseIndex ] ) ) { this . scope . enclosingCase = this . cases [ caseIndex ] ; if ( this . preSwitchInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preSwitchInitStateIndex ) ; } caseIndex ++ ; } else { if ( statement == this . defaultCase ) { this . scope . enclosingCase = this . defaultCase ; if ( this . preSwitchInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . preSwitchInitStateIndex ) ; } } } statement . generateCode ( this . scope , codeStream ) ; } } if ( this . mergedInitStateIndex != - <NUM_LIT:1> ) { codeStream . removeNotDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; codeStream . addDefinitelyAssignedVariables ( currentScope , this . mergedInitStateIndex ) ; } if ( this . scope != currentScope ) { codeStream . exitUserScope ( this . scope ) ; } this . breakLabel . place ( ) ; if ( this . defaultCase == null ) { codeStream . recordPositionsFrom ( codeStream . position , this . sourceEnd , true ) ; defaultLabel . place ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } finally { if ( this . scope != null ) this . scope . enclosingCase = null ; } } public StringBuffer printStatement ( int indent , StringBuffer output ) { printIndent ( indent , output ) . append ( "<STR_LIT>" ) ; this . expression . printExpression ( <NUM_LIT:0> , output ) . append ( "<STR_LIT>" ) ; if ( this . statements != null ) { for ( int i = <NUM_LIT:0> ; i < this . statements . length ; i ++ ) { output . append ( '<STR_LIT:\n>' ) ; if ( this . statements [ i ] instanceof CaseStatement ) { this . statements [ i ] . printStatement ( indent , output ) ; } else { this . statements [ i ] . printStatement ( indent + <NUM_LIT:2> , output ) ; } } } output . append ( "<STR_LIT:n>" ) ; return printIndent ( indent , output ) . append ( '<CHAR_LIT:}>' ) ; } public void resolve ( BlockScope upperScope ) { try { boolean isEnumSwitch = false ; boolean isStringSwitch = false ; TypeBinding expressionType = this . expression . resolveType ( upperScope ) ; CompilerOptions compilerOptions = upperScope . compilerOptions ( ) ; if ( expressionType != null ) { this . expression . computeConversion ( upperScope , expressionType , expressionType ) ; checkType : { if ( ! expressionType . isValidBinding ( ) ) { expressionType = null ; break checkType ; } else if ( expressionType . isBaseType ( ) ) { if ( this . expression . isConstantValueOfTypeAssignableToType ( expressionType , TypeBinding . INT ) ) break checkType ; if ( expressionType . isCompatibleWith ( TypeBinding . INT ) ) break checkType ; } else if ( expressionType . isEnum ( ) ) { isEnumSwitch = true ; if ( compilerOptions . complianceLevel < ClassFileConstants . JDK1_5 ) { upperScope . problemReporter ( ) . incorrectSwitchType ( this . expression , expressionType ) ; } break checkType ; } else if ( upperScope . isBoxingCompatibleWith ( expressionType , TypeBinding . INT ) ) { this . expression . computeConversion ( upperScope , TypeBinding . INT , expressionType ) ; break checkType ; } else if ( compilerOptions . complianceLevel >= ClassFileConstants . JDK1_7 && expressionType . id == TypeIds . T_JavaLangString ) { isStringSwitch = true ; break checkType ; } upperScope . problemReporter ( ) . incorrectSwitchType ( this . expression , expressionType ) ; expressionType = null ; } } if ( isStringSwitch ) { this . dispatchStringCopy = new LocalVariableBinding ( SecretStringVariableName , upperScope . getJavaLangString ( ) , ClassFileConstants . AccDefault , false ) ; upperScope . addLocalVariable ( this . dispatchStringCopy ) ; this . dispatchStringCopy . setConstant ( Constant . NotAConstant ) ; this . dispatchStringCopy . useFlag = LocalVariableBinding . USED ; } if ( this . statements != null ) { this . scope = new BlockScope ( upperScope ) ; int length ; this . cases = new CaseStatement [ length = this . statements . length ] ; if ( ! isStringSwitch ) { this . constants = new int [ length ] ; } else { this . stringConstants = new String [ length ] ; } int counter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Constant constant ; final Statement statement = this . statements [ i ] ; if ( ( constant = statement . resolveCase ( this . scope , expressionType , this ) ) != Constant . NotAConstant ) { if ( ! isStringSwitch ) { int key = constant . intValue ( ) ; for ( int j = <NUM_LIT:0> ; j < counter ; j ++ ) { if ( this . constants [ j ] == key ) { reportDuplicateCase ( ( CaseStatement ) statement , this . cases [ j ] , length ) ; } } this . constants [ counter ++ ] = key ; } else { String key = constant . stringValue ( ) ; for ( int j = <NUM_LIT:0> ; j < counter ; j ++ ) { if ( this . stringConstants [ j ] . equals ( key ) ) { reportDuplicateCase ( ( CaseStatement ) statement , this . cases [ j ] , length ) ; } } this . stringConstants [ counter ++ ] = key ; } } } if ( length != counter ) { if ( ! isStringSwitch ) { System . arraycopy ( this . constants , <NUM_LIT:0> , this . constants = new int [ counter ] , <NUM_LIT:0> , counter ) ; } else { System . arraycopy ( this . stringConstants , <NUM_LIT:0> , this . stringConstants = new String [ counter ] , <NUM_LIT:0> , counter ) ; } } } else { if ( ( this . bits & UndocumentedEmptyBlock ) != <NUM_LIT:0> ) { upperScope . problemReporter ( ) . undocumentedEmptyBlock ( this . blockStart , this . sourceEnd ) ; } } if ( this . defaultCase == null ) { if ( compilerOptions . getSeverity ( CompilerOptions . MissingDefaultCase ) == ProblemSeverities . Ignore ) { if ( isEnumSwitch ) { upperScope . methodScope ( ) . hasMissingSwitchDefault = true ; } } else { upperScope . problemReporter ( ) . missingDefaultCase ( this , isEnumSwitch , expressionType ) ; } } if ( isEnumSwitch && compilerOptions . complianceLevel >= ClassFileConstants . JDK1_5 ) { if ( this . defaultCase == null || compilerOptions . reportMissingEnumCaseDespiteDefault ) { int constantCount = this . constants == null ? <NUM_LIT:0> : this . constants . length ; if ( constantCount == this . caseCount && this . caseCount != ( ( ReferenceBinding ) expressionType ) . enumConstantCount ( ) ) { FieldBinding [ ] enumFields = ( ( ReferenceBinding ) expressionType . erasure ( ) ) . fields ( ) ; for ( int i = <NUM_LIT:0> , max = enumFields . length ; i < max ; i ++ ) { FieldBinding enumConstant = enumFields [ i ] ; if ( ( enumConstant . modifiers & ClassFileConstants . AccEnum ) == <NUM_LIT:0> ) continue ; findConstant : { for ( int j = <NUM_LIT:0> ; j < this . caseCount ; j ++ ) { if ( ( enumConstant . id + <NUM_LIT:1> ) == this . constants [ j ] ) break findConstant ; } boolean suppress = ( this . defaultCase != null && ( this . defaultCase . bits & DocumentedCasesOmitted ) != <NUM_LIT:0> ) ; if ( ! suppress ) { upperScope . problemReporter ( ) . missingEnumConstantCase ( this , enumConstant ) ; } } } } } } } finally { if ( this . scope != null ) this . scope . enclosingCase = null ; } } private void reportDuplicateCase ( final CaseStatement duplicate , final CaseStatement original , int length ) { if ( this . duplicateCaseStatements == null ) { this . scope . problemReporter ( ) . duplicateCase ( original ) ; this . scope . problemReporter ( ) . duplicateCase ( duplicate ) ; this . duplicateCaseStatements = new CaseStatement [ length ] ; this . duplicateCaseStatements [ this . duplicateCaseStatementsCounter ++ ] = original ; this . duplicateCaseStatements [ this . duplicateCaseStatementsCounter ++ ] = duplicate ; } else { boolean found = false ; searchReportedDuplicate : for ( int k = <NUM_LIT:2> ; k < this . duplicateCaseStatementsCounter ; k ++ ) { if ( this . duplicateCaseStatements [ k ] == duplicate ) { found = true ; break searchReportedDuplicate ; } } if ( ! found ) { this . scope . problemReporter ( ) . duplicateCase ( duplicate ) ; this . duplicateCaseStatements [ this . duplicateCaseStatementsCounter ++ ] = duplicate ; } } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { this . expression . traverse ( visitor , blockScope ) ; if ( this . statements != null ) { int statementsLength = this . statements . length ; for ( int i = <NUM_LIT:0> ; i < statementsLength ; i ++ ) this . statements [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , blockScope ) ; } public void branchChainTo ( BranchLabel label ) { if ( this . breakLabel . forwardReferenceCount ( ) > <NUM_LIT:0> ) { label . becomeDelegateFor ( this . breakLabel ) ; } } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class NormalAnnotation extends Annotation { public MemberValuePair [ ] memberValuePairs ; public NormalAnnotation ( TypeReference type , int sourceStart ) { this . type = type ; this . sourceStart = sourceStart ; this . sourceEnd = type . sourceEnd ; } public ElementValuePair [ ] computeElementValuePairs ( ) { int numberOfPairs = this . memberValuePairs == null ? <NUM_LIT:0> : this . memberValuePairs . length ; if ( numberOfPairs == <NUM_LIT:0> ) return Binding . NO_ELEMENT_VALUE_PAIRS ; ElementValuePair [ ] pairs = new ElementValuePair [ numberOfPairs ] ; for ( int i = <NUM_LIT:0> ; i < numberOfPairs ; i ++ ) pairs [ i ] = this . memberValuePairs [ i ] . compilerElementPair ; return pairs ; } public MemberValuePair [ ] memberValuePairs ( ) { return this . memberValuePairs == null ? NoValuePairs : this . memberValuePairs ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { super . printExpression ( indent , output ) ; output . append ( '<CHAR_LIT:(>' ) ; if ( this . memberValuePairs != null ) { for ( int i = <NUM_LIT:0> , max = this . memberValuePairs . length ; i < max ; i ++ ) { if ( i > <NUM_LIT:0> ) { output . append ( '<CHAR_LIT:U+002C>' ) ; } this . memberValuePairs [ i ] . print ( indent , output ) ; } } output . append ( '<CHAR_LIT:)>' ) ; return output ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . type != null ) { this . type . traverse ( visitor , scope ) ; } if ( this . memberValuePairs != null ) { int memberValuePairsLength = this . memberValuePairs . length ; for ( int i = <NUM_LIT:0> ; i < memberValuePairsLength ; i ++ ) this . memberValuePairs [ i ] . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class JavadocQualifiedTypeReference extends QualifiedTypeReference { public int tagSourceStart , tagSourceEnd ; public PackageBinding packageBinding ; public JavadocQualifiedTypeReference ( char [ ] [ ] sources , long [ ] pos , int tagStart , int tagEnd ) { super ( sources , pos ) ; this . tagSourceStart = tagStart ; this . tagSourceEnd = tagEnd ; this . bits |= ASTNode . InsideJavadoc ; } private TypeBinding internalResolveType ( Scope scope , boolean checkBounds ) { this . constant = Constant . NotAConstant ; if ( this . resolvedType != null ) return this . resolvedType . isValidBinding ( ) ? this . resolvedType : this . resolvedType . closestMatch ( ) ; TypeBinding type = this . resolvedType = getTypeBinding ( scope ) ; if ( type == null ) return null ; if ( ! type . isValidBinding ( ) ) { Binding binding = scope . getTypeOrPackage ( this . tokens ) ; if ( binding instanceof PackageBinding ) { this . packageBinding = ( PackageBinding ) binding ; } else { reportInvalidType ( scope ) ; } return null ; } if ( type . isGenericType ( ) || type . isParameterizedType ( ) ) { this . resolvedType = scope . environment ( ) . convertToRawType ( type , true ) ; } return this . resolvedType ; } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { scope . problemReporter ( ) . javadocDeprecatedType ( type , this , scope . getDeclarationModifiers ( ) ) ; } protected void reportDeprecatedType ( TypeBinding type , Scope scope , int index ) { scope . problemReporter ( ) . javadocDeprecatedType ( type , this , scope . getDeclarationModifiers ( ) , index ) ; } protected void reportInvalidType ( Scope scope ) { scope . problemReporter ( ) . javadocInvalidType ( this , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; } public TypeBinding resolveType ( BlockScope blockScope , boolean checkBounds ) { return internalResolveType ( blockScope , checkBounds ) ; } public TypeBinding resolveType ( ClassScope classScope ) { return internalResolveType ( classScope , false ) ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class ContinueStatement extends BranchStatement { public ContinueStatement ( char [ ] label , int sourceStart , int sourceEnd ) { super ( label , sourceStart , sourceEnd ) ; } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowContext targetContext = ( this . label == null ) ? flowContext . getTargetContextForDefaultContinue ( ) : flowContext . getTargetContextForContinueLabel ( this . label ) ; if ( targetContext == null ) { if ( this . label == null ) { currentScope . problemReporter ( ) . invalidContinue ( this ) ; } else { currentScope . problemReporter ( ) . undefinedLabel ( this ) ; } return flowInfo ; } if ( targetContext == FlowContext . NotContinuableContext ) { currentScope . problemReporter ( ) . invalidContinue ( this ) ; return flowInfo ; } this . initStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; this . targetLabel = targetContext . continueLabel ( ) ; FlowContext traversedContext = flowContext ; int subCount = <NUM_LIT:0> ; this . subroutines = new SubRoutineStatement [ <NUM_LIT:5> ] ; do { SubRoutineStatement sub ; if ( ( sub = traversedContext . subroutine ( ) ) != null ) { if ( subCount == this . subroutines . length ) { System . arraycopy ( this . subroutines , <NUM_LIT:0> , this . subroutines = new SubRoutineStatement [ subCount * <NUM_LIT:2> ] , <NUM_LIT:0> , subCount ) ; } this . subroutines [ subCount ++ ] = sub ; if ( sub . isSubRoutineEscaping ( ) ) { break ; } } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; if ( traversedContext instanceof InsideSubRoutineFlowContext ) { ASTNode node = traversedContext . associatedNode ; if ( node instanceof TryStatement ) { TryStatement tryStatement = ( TryStatement ) node ; flowInfo . addInitializationsFrom ( tryStatement . subRoutineInits ) ; } } else if ( traversedContext == targetContext ) { targetContext . recordContinueFrom ( flowContext , flowInfo ) ; break ; } } while ( ( traversedContext = traversedContext . getLocalParent ( ) ) != null ) ; if ( subCount != this . subroutines . length ) { System . arraycopy ( this . subroutines , <NUM_LIT:0> , this . subroutines = new SubRoutineStatement [ subCount ] , <NUM_LIT:0> , subCount ) ; } return FlowInfo . DEAD_END ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { printIndent ( tab , output ) . append ( "<STR_LIT>" ) ; if ( this . label != null ) output . append ( this . label ) ; return output . append ( '<CHAR_LIT:;>' ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { visitor . visit ( this , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . flow . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class EqualExpression extends BinaryExpression { public EqualExpression ( Expression left , Expression right , int operator ) { super ( left , right , operator ) ; } private void checkNullComparison ( BlockScope scope , FlowContext flowContext , FlowInfo flowInfo , FlowInfo initsWhenTrue , FlowInfo initsWhenFalse ) { int rightStatus = this . right . nullStatus ( flowInfo ) ; int leftStatus = this . left . nullStatus ( flowInfo ) ; if ( leftStatus == FlowInfo . NON_NULL && rightStatus == FlowInfo . NULL ) { if ( this . left instanceof MessageSend ) { scope . problemReporter ( ) . messageSendRedundantCheckOnNonNull ( ( ( MessageSend ) this . left ) . binding , this . left ) ; } } else if ( leftStatus == FlowInfo . NULL && rightStatus == FlowInfo . NON_NULL ) { if ( this . right instanceof MessageSend ) { scope . problemReporter ( ) . messageSendRedundantCheckOnNonNull ( ( ( MessageSend ) this . right ) . binding , this . right ) ; } } LocalVariableBinding local = this . left . localVariableBinding ( ) ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { checkVariableComparison ( scope , flowContext , flowInfo , initsWhenTrue , initsWhenFalse , local , rightStatus , this . left ) ; } local = this . right . localVariableBinding ( ) ; if ( local != null && ( local . type . tagBits & TagBits . IsBaseType ) == <NUM_LIT:0> ) { checkVariableComparison ( scope , flowContext , flowInfo , initsWhenTrue , initsWhenFalse , local , leftStatus , this . right ) ; } } private void checkVariableComparison ( BlockScope scope , FlowContext flowContext , FlowInfo flowInfo , FlowInfo initsWhenTrue , FlowInfo initsWhenFalse , LocalVariableBinding local , int nullStatus , Expression reference ) { switch ( nullStatus ) { case FlowInfo . NULL : if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == EQUAL_EQUAL ) { flowContext . recordUsingNullReference ( scope , local , reference , FlowContext . CAN_ONLY_NULL_NON_NULL | FlowContext . IN_COMPARISON_NULL , flowInfo ) ; initsWhenTrue . markAsComparedEqualToNull ( local ) ; initsWhenFalse . markAsComparedEqualToNonNull ( local ) ; } else { flowContext . recordUsingNullReference ( scope , local , reference , FlowContext . CAN_ONLY_NULL_NON_NULL | FlowContext . IN_COMPARISON_NON_NULL , flowInfo ) ; initsWhenTrue . markAsComparedEqualToNonNull ( local ) ; initsWhenFalse . markAsComparedEqualToNull ( local ) ; } break ; case FlowInfo . NON_NULL : if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == EQUAL_EQUAL ) { flowContext . recordUsingNullReference ( scope , local , reference , FlowContext . CAN_ONLY_NULL | FlowContext . IN_COMPARISON_NON_NULL , flowInfo ) ; initsWhenTrue . markAsComparedEqualToNonNull ( local ) ; } else { flowContext . recordUsingNullReference ( scope , local , reference , FlowContext . CAN_ONLY_NULL | FlowContext . IN_COMPARISON_NULL , flowInfo ) ; } break ; } } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowInfo result ; if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == EQUAL_EQUAL ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == T_boolean ) ) { if ( this . left . constant . booleanValue ( ) ) { result = this . right . analyseCode ( currentScope , flowContext , flowInfo ) ; } else { result = this . right . analyseCode ( currentScope , flowContext , flowInfo ) . asNegatedCondition ( ) ; } } else if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == T_boolean ) ) { if ( this . right . constant . booleanValue ( ) ) { result = this . left . analyseCode ( currentScope , flowContext , flowInfo ) ; } else { result = this . left . analyseCode ( currentScope , flowContext , flowInfo ) . asNegatedCondition ( ) ; } } else { result = this . right . analyseCode ( currentScope , flowContext , this . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ) . unconditionalInits ( ) ; } } else { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . left . constant . typeID ( ) == T_boolean ) ) { if ( ! this . left . constant . booleanValue ( ) ) { result = this . right . analyseCode ( currentScope , flowContext , flowInfo ) ; } else { result = this . right . analyseCode ( currentScope , flowContext , flowInfo ) . asNegatedCondition ( ) ; } } else if ( ( this . right . constant != Constant . NotAConstant ) && ( this . right . constant . typeID ( ) == T_boolean ) ) { if ( ! this . right . constant . booleanValue ( ) ) { result = this . left . analyseCode ( currentScope , flowContext , flowInfo ) ; } else { result = this . left . analyseCode ( currentScope , flowContext , flowInfo ) . asNegatedCondition ( ) ; } } else { result = this . right . analyseCode ( currentScope , flowContext , this . left . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ) . unconditionalInits ( ) ; } } if ( result instanceof UnconditionalFlowInfo && ( result . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { result = FlowInfo . conditional ( result . copy ( ) , result . copy ( ) ) ; } checkNullComparison ( currentScope , flowContext , result , result . initsWhenTrue ( ) , result . initsWhenFalse ( ) ) ; return result ; } public final void computeConstant ( TypeBinding leftType , TypeBinding rightType ) { if ( ( this . left . constant != Constant . NotAConstant ) && ( this . right . constant != Constant . NotAConstant ) ) { this . constant = Constant . computeConstantOperationEQUAL_EQUAL ( this . left . constant , leftType . id , this . right . constant , rightType . id ) ; if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == NOT_EQUAL ) this . constant = BooleanConstant . fromValue ( ! this . constant . booleanValue ( ) ) ; } else { this . constant = Constant . NotAConstant ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( this . constant != Constant . NotAConstant ) { if ( valueRequired ) codeStream . generateConstant ( this . constant , this . implicitConversion ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } if ( ( this . left . implicitConversion & COMPILE_TYPE_MASK ) == T_boolean ) { generateBooleanEqual ( currentScope , codeStream , valueRequired ) ; } else { generateNonBooleanEqual ( currentScope , codeStream , valueRequired ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { if ( this . constant != Constant . NotAConstant ) { super . generateOptimizedBoolean ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; return ; } if ( ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == EQUAL_EQUAL ) { if ( ( this . left . implicitConversion & COMPILE_TYPE_MASK ) == T_boolean ) { generateOptimizedBooleanEqual ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } else { generateOptimizedNonBooleanEqual ( currentScope , codeStream , trueLabel , falseLabel , valueRequired ) ; } } else { if ( ( this . left . implicitConversion & COMPILE_TYPE_MASK ) == T_boolean ) { generateOptimizedBooleanEqual ( currentScope , codeStream , falseLabel , trueLabel , valueRequired ) ; } else { generateOptimizedNonBooleanEqual ( currentScope , codeStream , falseLabel , trueLabel , valueRequired ) ; } } } public void generateBooleanEqual ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { boolean isEqualOperator = ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == EQUAL_EQUAL ; Constant cst = this . left . optimizedBooleanConstant ( ) ; if ( cst != Constant . NotAConstant ) { Constant rightCst = this . right . optimizedBooleanConstant ( ) ; if ( rightCst != Constant . NotAConstant ) { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; if ( valueRequired ) { boolean leftBool = cst . booleanValue ( ) ; boolean rightBool = rightCst . booleanValue ( ) ; if ( isEqualOperator ) { if ( leftBool == rightBool ) { codeStream . iconst_1 ( ) ; } else { codeStream . iconst_0 ( ) ; } } else { if ( leftBool != rightBool ) { codeStream . iconst_1 ( ) ; } else { codeStream . iconst_0 ( ) ; } } } } else if ( cst . booleanValue ( ) == isEqualOperator ) { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; } else { if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , valueRequired ) ; codeStream . iconst_0 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_1 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_1 ( ) ; endLabel . place ( ) ; } } else { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; } } return ; } cst = this . right . optimizedBooleanConstant ( ) ; if ( cst != Constant . NotAConstant ) { if ( cst . booleanValue ( ) == isEqualOperator ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , false ) ; } else { if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; this . left . generateOptimizedBoolean ( currentScope , codeStream , null , falseLabel , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , false ) ; codeStream . iconst_0 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_1 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_1 ( ) ; endLabel . place ( ) ; } } else { this . left . generateCode ( currentScope , codeStream , false ) ; this . right . generateCode ( currentScope , codeStream , false ) ; } } return ; } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( isEqualOperator ) { BranchLabel falseLabel ; codeStream . if_icmpne ( falseLabel = new BranchLabel ( codeStream ) ) ; codeStream . iconst_1 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } else { codeStream . ixor ( ) ; } } } public void generateOptimizedBooleanEqual ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { if ( this . left . constant != Constant . NotAConstant ) { boolean inline = this . left . constant . booleanValue ( ) ; this . right . generateOptimizedBoolean ( currentScope , codeStream , ( inline ? trueLabel : falseLabel ) , ( inline ? falseLabel : trueLabel ) , valueRequired ) ; return ; } if ( this . right . constant != Constant . NotAConstant ) { boolean inline = this . right . constant . booleanValue ( ) ; this . left . generateOptimizedBoolean ( currentScope , codeStream , ( inline ? trueLabel : falseLabel ) , ( inline ? falseLabel : trueLabel ) , valueRequired ) ; return ; } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; int pc = codeStream . position ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . if_icmpeq ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . if_icmpne ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( pc , this . sourceEnd ) ; } public void generateNonBooleanEqual ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { boolean isEqualOperator = ( ( this . bits & OperatorMASK ) > > OperatorSHIFT ) == EQUAL_EQUAL ; if ( ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) == T_int ) { Constant cst ; if ( ( cst = this . left . constant ) != Constant . NotAConstant && cst . intValue ( ) == <NUM_LIT:0> ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; if ( isEqualOperator ) { codeStream . ifne ( falseLabel ) ; } else { codeStream . ifeq ( falseLabel ) ; } codeStream . iconst_1 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } return ; } if ( ( cst = this . right . constant ) != Constant . NotAConstant && cst . intValue ( ) == <NUM_LIT:0> ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; if ( isEqualOperator ) { codeStream . ifne ( falseLabel ) ; } else { codeStream . ifeq ( falseLabel ) ; } codeStream . iconst_1 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } return ; } } if ( this . right instanceof NullLiteral ) { if ( this . left instanceof NullLiteral ) { if ( valueRequired ) { if ( isEqualOperator ) { codeStream . iconst_1 ( ) ; } else { codeStream . iconst_0 ( ) ; } } } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; if ( isEqualOperator ) { codeStream . ifnonnull ( falseLabel ) ; } else { codeStream . ifnull ( falseLabel ) ; } codeStream . iconst_1 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } } return ; } else if ( this . left instanceof NullLiteral ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; if ( isEqualOperator ) { codeStream . ifnonnull ( falseLabel ) ; } else { codeStream . ifnull ( falseLabel ) ; } codeStream . iconst_1 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } return ; } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { BranchLabel falseLabel = new BranchLabel ( codeStream ) ; if ( isEqualOperator ) { switch ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : codeStream . if_icmpne ( falseLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifne ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifne ( falseLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifne ( falseLabel ) ; break ; default : codeStream . if_acmpne ( falseLabel ) ; } } else { switch ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : codeStream . if_icmpeq ( falseLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifeq ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifeq ( falseLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifeq ( falseLabel ) ; break ; default : codeStream . if_acmpeq ( falseLabel ) ; } } codeStream . iconst_1 ( ) ; if ( ( this . bits & IsReturnedValue ) != <NUM_LIT:0> ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; codeStream . generateReturnBytecode ( this ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; } else { BranchLabel endLabel = new BranchLabel ( codeStream ) ; codeStream . goto_ ( endLabel ) ; codeStream . decrStackSize ( <NUM_LIT:1> ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; endLabel . place ( ) ; } } } public void generateOptimizedNonBooleanEqual ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { int pc = codeStream . position ; Constant inline ; if ( ( inline = this . right . constant ) != Constant . NotAConstant ) { if ( ( ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) == T_int ) && ( inline . intValue ( ) == <NUM_LIT:0> ) ) { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifeq ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifne ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } } if ( ( inline = this . left . constant ) != Constant . NotAConstant ) { if ( ( ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) == T_int ) && ( inline . intValue ( ) == <NUM_LIT:0> ) ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifeq ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifne ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } } if ( this . right instanceof NullLiteral ) { if ( this . left instanceof NullLiteral ) { if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . goto_ ( trueLabel ) ; } } } } else { this . left . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifnull ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifnonnull ( falseLabel ) ; } else { } } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } else if ( this . left instanceof NullLiteral ) { this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { codeStream . ifnull ( trueLabel ) ; } } else { if ( trueLabel == null ) { codeStream . ifnonnull ( falseLabel ) ; } else { } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; return ; } this . left . generateCode ( currentScope , codeStream , valueRequired ) ; this . right . generateCode ( currentScope , codeStream , valueRequired ) ; if ( valueRequired ) { if ( falseLabel == null ) { if ( trueLabel != null ) { switch ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : codeStream . if_icmpeq ( trueLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifeq ( trueLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifeq ( trueLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifeq ( trueLabel ) ; break ; default : codeStream . if_acmpeq ( trueLabel ) ; } } } else { if ( trueLabel == null ) { switch ( ( this . left . implicitConversion & IMPLICIT_CONVERSION_MASK ) > > <NUM_LIT:4> ) { case T_int : codeStream . if_icmpne ( falseLabel ) ; break ; case T_float : codeStream . fcmpl ( ) ; codeStream . ifne ( falseLabel ) ; break ; case T_long : codeStream . lcmp ( ) ; codeStream . ifne ( falseLabel ) ; break ; case T_double : codeStream . dcmpl ( ) ; codeStream . ifne ( falseLabel ) ; break ; default : codeStream . if_acmpne ( falseLabel ) ; } } else { } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public boolean isCompactableOperation ( ) { return false ; } public TypeBinding resolveType ( BlockScope scope ) { boolean leftIsCast , rightIsCast ; if ( ( leftIsCast = this . left instanceof CastExpression ) == true ) this . left . bits |= DisableUnnecessaryCastCheck ; TypeBinding originalLeftType = this . left . resolveType ( scope ) ; if ( ( rightIsCast = this . right instanceof CastExpression ) == true ) this . right . bits |= DisableUnnecessaryCastCheck ; TypeBinding originalRightType = this . right . resolveType ( scope ) ; if ( originalLeftType == null || originalRightType == null ) { this . constant = Constant . NotAConstant ; return null ; } boolean use15specifics = scope . compilerOptions ( ) . sourceLevel >= ClassFileConstants . JDK1_5 ; TypeBinding leftType = originalLeftType , rightType = originalRightType ; if ( use15specifics ) { if ( leftType != TypeBinding . NULL && leftType . isBaseType ( ) ) { if ( ! rightType . isBaseType ( ) ) { rightType = scope . environment ( ) . computeBoxingType ( rightType ) ; } } else { if ( rightType != TypeBinding . NULL && rightType . isBaseType ( ) ) { leftType = scope . environment ( ) . computeBoxingType ( leftType ) ; } } } if ( leftType . isBaseType ( ) && rightType . isBaseType ( ) ) { int leftTypeID = leftType . id ; int rightTypeID = rightType . id ; int operatorSignature = OperatorSignatures [ EQUAL_EQUAL ] [ ( leftTypeID << <NUM_LIT:4> ) + rightTypeID ] ; this . left . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:16> ) & <NUM_LIT> ) , originalLeftType ) ; this . right . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( operatorSignature > > > <NUM_LIT:8> ) & <NUM_LIT> ) , originalRightType ) ; this . bits |= operatorSignature & <NUM_LIT> ; if ( ( operatorSignature & <NUM_LIT> ) == T_undefined ) { this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , leftType , rightType ) ; return null ; } if ( leftIsCast || rightIsCast ) { CastExpression . checkNeedForArgumentCasts ( scope , EQUAL_EQUAL , operatorSignature , this . left , leftType . id , leftIsCast , this . right , rightType . id , rightIsCast ) ; } computeConstant ( leftType , rightType ) ; Binding leftDirect = Expression . getDirectBinding ( this . left ) ; if ( leftDirect != null && leftDirect == Expression . getDirectBinding ( this . right ) ) { if ( leftTypeID != TypeIds . T_double && leftTypeID != TypeIds . T_float && ( ! ( this . right instanceof Assignment ) ) ) scope . problemReporter ( ) . comparingIdenticalExpressions ( this ) ; } else if ( this . constant != Constant . NotAConstant ) { int operator = ( this . bits & OperatorMASK ) > > OperatorSHIFT ; if ( ( operator == EQUAL_EQUAL && this . constant == BooleanConstant . fromValue ( true ) ) || ( operator == NOT_EQUAL && this . constant == BooleanConstant . fromValue ( false ) ) ) scope . problemReporter ( ) . comparingIdenticalExpressions ( this ) ; } return this . resolvedType = TypeBinding . BOOLEAN ; } if ( ( ! leftType . isBaseType ( ) || leftType == TypeBinding . NULL ) && ( ! rightType . isBaseType ( ) || rightType == TypeBinding . NULL ) && ( checkCastTypesCompatibility ( scope , leftType , rightType , null ) || checkCastTypesCompatibility ( scope , rightType , leftType , null ) ) ) { if ( ( rightType . id == T_JavaLangString ) && ( leftType . id == T_JavaLangString ) ) { computeConstant ( leftType , rightType ) ; } else { this . constant = Constant . NotAConstant ; } TypeBinding objectType = scope . getJavaLangObject ( ) ; this . left . computeConversion ( scope , objectType , leftType ) ; this . right . computeConversion ( scope , objectType , rightType ) ; boolean unnecessaryLeftCast = ( this . left . bits & UnnecessaryCast ) != <NUM_LIT:0> ; boolean unnecessaryRightCast = ( this . right . bits & UnnecessaryCast ) != <NUM_LIT:0> ; if ( unnecessaryLeftCast || unnecessaryRightCast ) { TypeBinding alternateLeftType = unnecessaryLeftCast ? ( ( CastExpression ) this . left ) . expression . resolvedType : leftType ; TypeBinding alternateRightType = unnecessaryRightCast ? ( ( CastExpression ) this . right ) . expression . resolvedType : rightType ; if ( checkCastTypesCompatibility ( scope , alternateLeftType , alternateRightType , null ) || checkCastTypesCompatibility ( scope , alternateRightType , alternateLeftType , null ) ) { if ( unnecessaryLeftCast ) scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) this . left ) ; if ( unnecessaryRightCast ) scope . problemReporter ( ) . unnecessaryCast ( ( CastExpression ) this . right ) ; } } Binding leftDirect = Expression . getDirectBinding ( this . left ) ; if ( leftDirect != null && leftDirect == Expression . getDirectBinding ( this . right ) ) { if ( ! ( this . right instanceof Assignment ) ) { scope . problemReporter ( ) . comparingIdenticalExpressions ( this ) ; } } return this . resolvedType = TypeBinding . BOOLEAN ; } this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . notCompatibleTypesError ( this , leftType , rightType ) ; return null ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { this . left . traverse ( visitor , scope ) ; this . right . traverse ( visitor , scope ) ; } visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class ArrayTypeReference extends SingleTypeReference { public int dimensions ; public int originalSourceEnd ; public ArrayTypeReference ( char [ ] source , int dimensions , long pos ) { super ( source , pos ) ; this . originalSourceEnd = this . sourceEnd ; this . dimensions = dimensions ; } public int dimensions ( ) { return this . dimensions ; } public char [ ] [ ] getParameterizedTypeName ( ) { int dim = this . dimensions ; char [ ] dimChars = new char [ dim * <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < dim ; i ++ ) { int index = i * <NUM_LIT:2> ; dimChars [ index ] = '<CHAR_LIT:[>' ; dimChars [ index + <NUM_LIT:1> ] = '<CHAR_LIT:]>' ; } return new char [ ] [ ] { CharOperation . concat ( this . token , dimChars ) } ; } protected TypeBinding getTypeBinding ( Scope scope ) { if ( this . resolvedType != null ) { return this . resolvedType ; } if ( this . dimensions > <NUM_LIT:255> ) { scope . problemReporter ( ) . tooManyDimensions ( this ) ; } TypeBinding leafComponentType = scope . getType ( this . token ) ; return scope . createArrayType ( leafComponentType , this . dimensions ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { super . printExpression ( indent , output ) ; if ( ( this . bits & IsVarArgs ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . dimensions - <NUM_LIT:1> ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } output . append ( "<STR_LIT:...>" ) ; } else { for ( int i = <NUM_LIT:0> ; i < this . dimensions ; i ++ ) { output . append ( "<STR_LIT:[]>" ) ; } } return output ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } public void traverse ( ASTVisitor visitor , ClassScope scope ) { visitor . visit ( this , scope ) ; visitor . endVisit ( this , scope ) ; } } </s>
<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ElementValuePair ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; public class MemberValuePair extends ASTNode { public char [ ] name ; public Expression value ; public MethodBinding binding ; public ElementValuePair compilerElementPair = null ; public MemberValuePair ( char [ ] token , int sourceStart , int sourceEnd , Expression value ) { this . name = token ; this . sourceStart = sourceStart ; this . sourceEnd = sourceEnd ; this . value = value ; if ( value instanceof ArrayInitializer ) { value . bits |= IsAnnotationDefaultValue ; } } public StringBuffer print ( int indent , StringBuffer output ) { output . append ( this . name ) . append ( "<STR_LIT:U+0020=U+0020>" ) ; this . value . print ( <NUM_LIT:0> , output ) ; return output ; } public void resolveTypeExpecting ( BlockScope scope , TypeBinding requiredType ) { if ( this . value == null ) { this . compilerElementPair = new ElementValuePair ( this . name , this . value , this . binding ) ; return ; } if ( requiredType == null ) { if ( this . value instanceof ArrayInitializer ) { this . value . resolveTypeExpecting ( scope , null ) ; } else { this . value . resolveType ( scope ) ; } this . compilerElementPair = new ElementValuePair ( this . name , this . value , this . binding ) ; return ; } this . value . setExpectedType ( requiredType ) ; TypeBinding valueType ; if ( this . value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) this . value ; valueType = initializer . resolveTypeExpecting ( scope , this . binding . returnType ) ; } else if ( this . value instanceof ArrayAllocationExpression ) { scope . problemReporter ( ) . annotationValueMustBeArrayInitializer ( this . binding . declaringClass , this . name , this . value ) ; this . value . resolveType ( scope ) ; valueType = null ; } else { valueType = this . value . resolveType ( scope ) ; ASTVisitor visitor = new ASTVisitor ( ) { public boolean visit ( SingleNameReference reference , BlockScope scop ) { if ( reference . binding instanceof LocalVariableBinding ) { ( ( LocalVariableBinding ) reference . binding ) . useFlag = LocalVariableBinding . USED ; } return true ; } } ; this . value . traverse ( visitor , scope ) ; } this . compilerElementPair = new ElementValuePair ( this . name , this . value , this . binding ) ; if ( valueType == null ) return ; TypeBinding leafType = requiredType . leafComponentType ( ) ; if ( ! ( this . value . isConstantValueOfTypeAssignableToType ( valueType , requiredType ) || valueType . isCompatibleWith ( requiredType ) ) ) { if ( ! ( requiredType . isArrayType ( ) && requiredType . dimensions ( ) == <NUM_LIT:1> && ( this . value . isConstantValueOfTypeAssignableToType ( valueType , leafType ) || valueType . isCompatibleWith ( leafType ) ) ) ) { if ( leafType . isAnnotationType ( ) && ! valueType . isAnnotationType ( ) ) { scope . problemReporter ( ) . annotationValueMustBeAnnotation ( this . binding . declaringClass , this . name , this . value , leafType ) ; } else { scope . problemReporter ( ) . typeMismatchError ( valueType , requiredType , this . value , null ) ; } return ; } } else { scope . compilationUnitScope ( ) . recordTypeConversion ( requiredType . leafComponentType ( ) , valueType . leafComponentType ( ) ) ; this . value . computeConversion ( scope , requiredType , valueType ) ; } checkAnnotationMethodType : { switch ( leafType . erasure ( ) . id ) { case T_byte : case T_short : case T_char : case T_int : case T_long : case T_float : case T_double : case T_boolean : case T_JavaLangString : if ( this . value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) this . value ; final Expression [ ] expressions = initializer . expressions ; if ( expressions != null ) { for ( int i = <NUM_LIT:0> , max = expressions . length ; i < max ; i ++ ) { Expression expression = expressions [ i ] ; if ( expression . resolvedType == null ) continue ; if ( expression . constant == Constant . NotAConstant ) { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , expressions [ i ] , false ) ; } } } } else if ( this . value . constant == Constant . NotAConstant ) { if ( valueType . isArrayType ( ) ) { scope . problemReporter ( ) . annotationValueMustBeArrayInitializer ( this . binding . declaringClass , this . name , this . value ) ; } else { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , this . value , false ) ; } } break checkAnnotationMethodType ; case T_JavaLangClass : if ( this . value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) this . value ; final Expression [ ] expressions = initializer . expressions ; if ( expressions != null ) { for ( int i = <NUM_LIT:0> , max = expressions . length ; i < max ; i ++ ) { Expression currentExpression = expressions [ i ] ; if ( ! ( currentExpression instanceof ClassLiteralAccess ) ) { scope . problemReporter ( ) . annotationValueMustBeClassLiteral ( this . binding . declaringClass , this . name , currentExpression ) ; } } } } else if ( ! ( this . value instanceof ClassLiteralAccess ) ) { scope . problemReporter ( ) . annotationValueMustBeClassLiteral ( this . binding . declaringClass , this . name , this . value ) ; } break checkAnnotationMethodType ; } if ( leafType . isEnum ( ) ) { if ( this . value instanceof NullLiteral ) { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , this . value , true ) ; } else if ( this . value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) this . value ; final Expression [ ] expressions = initializer . expressions ; if ( expressions != null ) { for ( int i = <NUM_LIT:0> , max = expressions . length ; i < max ; i ++ ) { Expression currentExpression = expressions [ i ] ; if ( currentExpression instanceof NullLiteral ) { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , currentExpression , true ) ; } else if ( currentExpression instanceof NameReference ) { NameReference nameReference = ( NameReference ) currentExpression ; final Binding nameReferenceBinding = nameReference . binding ; if ( nameReferenceBinding . kind ( ) == Binding . FIELD ) { FieldBinding fieldBinding = ( FieldBinding ) nameReferenceBinding ; if ( ! fieldBinding . declaringClass . isEnum ( ) ) { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , currentExpression , true ) ; } } } } } } else if ( this . value instanceof NameReference ) { NameReference nameReference = ( NameReference ) this . value ; final Binding nameReferenceBinding = nameReference . binding ; if ( nameReferenceBinding . kind ( ) == Binding . FIELD ) { FieldBinding fieldBinding = ( FieldBinding ) nameReferenceBinding ; if ( ! fieldBinding . declaringClass . isEnum ( ) ) { if ( ! fieldBinding . type . isArrayType ( ) ) { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , this . value , true ) ; } else { scope . problemReporter ( ) . annotationValueMustBeArrayInitializer ( this . binding . declaringClass , this . name , this . value ) ; } } } } else { scope . problemReporter ( ) . annotationValueMustBeConstant ( this . binding . declaringClass , this . name , this . value , true ) ; } break checkAnnotationMethodType ; } if ( leafType . isAnnotationType ( ) ) { if ( ! valueType . leafComponentType ( ) . isAnnotationType ( ) ) { scope . problemReporter ( ) . annotationValueMustBeAnnotation ( this . binding . declaringClass , this . name , this . value , leafType ) ; } else if ( this . value instanceof ArrayInitializer ) { ArrayInitializer initializer = ( ArrayInitializer ) this . value ; final Expression [ ] expressions = initializer . expressions ; if ( expressions != null ) { for ( int i = <NUM_LIT:0> , max = expressions . length ; i < max ; i ++ ) { Expression currentExpression = expressions [ i ] ; if ( currentExpression instanceof NullLiteral || ! ( currentExpression instanceof Annotation ) ) { scope . problemReporter ( ) . annotationValueMustBeAnnotation ( this . binding . declaringClass , this . name , currentExpression , leafType ) ; } } } } else if ( ! ( this . value instanceof Annotation ) ) { scope . problemReporter ( ) . annotationValueMustBeAnnotation ( this . binding . declaringClass , this . name , this . value , leafType ) ; } break checkAnnotationMethodType ; } } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { if ( visitor . visit ( this , scope ) ) { if ( this . value != null ) { this . value . traverse ( visitor , scope ) ; } } visitor . endVisit ( this , scope ) ; } } </s>