text
stringlengths 30
1.67M
|
|---|
<s> package org . eclipse . jdt . internal . compiler . env ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ClassSignature { char [ ] className ; public ClassSignature ( final char [ ] className ) { this . className = className ; } public char [ ] getTypeName ( ) { return this . className ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . className ) ; buffer . append ( "<STR_LIT:.class>" ) ; return buffer . toString ( ) ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + CharOperation . hashCode ( this . className ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ClassSignature other = ( ClassSignature ) obj ; return Arrays . equals ( this . className , other . className ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface ISourceMethod extends IGenericMethod { int getDeclarationSourceEnd ( ) ; int getDeclarationSourceStart ( ) ; char [ ] [ ] getExceptionTypeNames ( ) ; int getNameSourceEnd ( ) ; int getNameSourceStart ( ) ; char [ ] getReturnTypeName ( ) ; char [ ] [ ] getTypeParameterNames ( ) ; char [ ] [ ] [ ] getTypeParameterBounds ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; import org . eclipse . jdt . internal . compiler . impl . Constant ; public interface IBinaryField extends IGenericField { IBinaryAnnotation [ ] getAnnotations ( ) ; Constant getConstant ( ) ; char [ ] getGenericSignature ( ) ; char [ ] getName ( ) ; long getTagBits ( ) ; char [ ] getTypeName ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IBinaryMethod extends IGenericMethod { IBinaryAnnotation [ ] getAnnotations ( ) ; Object getDefaultValue ( ) ; char [ ] [ ] getExceptionTypeNames ( ) ; char [ ] getGenericSignature ( ) ; char [ ] getMethodDescriptor ( ) ; IBinaryAnnotation [ ] getParameterAnnotations ( int index ) ; char [ ] getSelector ( ) ; long getTagBits ( ) ; boolean isClinit ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface ISourceField extends IGenericField { int getDeclarationSourceEnd ( ) ; int getDeclarationSourceStart ( ) ; char [ ] getInitializationSource ( ) ; int getNameSourceEnd ( ) ; int getNameSourceStart ( ) ; char [ ] getTypeName ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; import org . eclipse . jdt . core . compiler . CharOperation ; public interface IBinaryType extends IGenericType { char [ ] [ ] NoInterface = CharOperation . NO_CHAR_CHAR ; IBinaryNestedType [ ] NoNestedType = new IBinaryNestedType [ <NUM_LIT:0> ] ; IBinaryField [ ] NoField = new IBinaryField [ <NUM_LIT:0> ] ; IBinaryMethod [ ] NoMethod = new IBinaryMethod [ <NUM_LIT:0> ] ; IBinaryAnnotation [ ] getAnnotations ( ) ; char [ ] getEnclosingMethod ( ) ; char [ ] getEnclosingTypeName ( ) ; IBinaryField [ ] getFields ( ) ; char [ ] getGenericSignature ( ) ; char [ ] [ ] getInterfaceNames ( ) ; IBinaryNestedType [ ] getMemberTypes ( ) ; IBinaryMethod [ ] getMethods ( ) ; char [ ] [ ] [ ] getMissingTypeNames ( ) ; char [ ] getName ( ) ; char [ ] getSourceName ( ) ; char [ ] getSuperclassName ( ) ; long getTagBits ( ) ; boolean isAnonymous ( ) ; boolean isLocal ( ) ; boolean isMember ( ) ; char [ ] sourceFileName ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IBinaryNestedType { char [ ] getEnclosingTypeName ( ) ; int getModifiers ( ) ; char [ ] getName ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public class NameEnvironmentAnswer { IBinaryType binaryType ; ICompilationUnit compilationUnit ; ISourceType [ ] sourceTypes ; AccessRestriction accessRestriction ; public NameEnvironmentAnswer ( IBinaryType binaryType , AccessRestriction accessRestriction ) { this . binaryType = binaryType ; this . accessRestriction = accessRestriction ; } public NameEnvironmentAnswer ( ICompilationUnit compilationUnit , AccessRestriction accessRestriction ) { this . compilationUnit = compilationUnit ; this . accessRestriction = accessRestriction ; } public NameEnvironmentAnswer ( ISourceType [ ] sourceTypes , AccessRestriction accessRestriction ) { this . sourceTypes = sourceTypes ; this . accessRestriction = accessRestriction ; } public AccessRestriction getAccessRestriction ( ) { return this . accessRestriction ; } public IBinaryType getBinaryType ( ) { return this . binaryType ; } public ICompilationUnit getCompilationUnit ( ) { return this . compilationUnit ; } public ISourceType [ ] getSourceTypes ( ) { return this . sourceTypes ; } public boolean isBinaryType ( ) { return this . binaryType != null ; } public boolean isCompilationUnit ( ) { return this . compilationUnit != null ; } public boolean isSourceType ( ) { return this . sourceTypes != null ; } public boolean ignoreIfBetter ( ) { return this . accessRestriction != null && this . accessRestriction . ignoreIfBetter ( ) ; } public boolean isBetter ( NameEnvironmentAnswer otherAnswer ) { if ( otherAnswer == null ) return true ; if ( this . accessRestriction == null ) return true ; return otherAnswer . accessRestriction != null && this . accessRestriction . getProblemId ( ) < otherAnswer . accessRestriction . getProblemId ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface ICompilationUnit extends IDependent { char [ ] getContents ( ) ; char [ ] getMainTypeName ( ) ; char [ ] [ ] getPackageName ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface INameEnvironment { NameEnvironmentAnswer findType ( char [ ] [ ] compoundTypeName ) ; NameEnvironmentAnswer findType ( char [ ] typeName , char [ ] [ ] packageName ) ; boolean isPackage ( char [ ] [ ] parentPackageName , char [ ] packageName ) ; void cleanup ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IGenericField { int getModifiers ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public class AccessRestriction { private AccessRule accessRule ; public byte classpathEntryType ; public static final byte COMMAND_LINE = <NUM_LIT:0> , PROJECT = <NUM_LIT:1> , LIBRARY = <NUM_LIT:2> ; public String classpathEntryName ; public AccessRestriction ( AccessRule accessRule , byte classpathEntryType , String classpathEntryName ) { this . accessRule = accessRule ; this . classpathEntryName = classpathEntryName ; this . classpathEntryType = classpathEntryType ; } public int getProblemId ( ) { return this . accessRule . getProblemId ( ) ; } public boolean ignoreIfBetter ( ) { return this . accessRule . ignoreIfBetter ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IBinaryAnnotation { char [ ] getTypeName ( ) ; IBinaryElementValuePair [ ] getElementValuePairs ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface ISourceImport { int getDeclarationSourceEnd ( ) ; int getDeclarationSourceStart ( ) ; int getModifiers ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IGenericType extends IDependent { int getModifiers ( ) ; boolean isBinaryType ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; public class AccessRuleSet { private AccessRule [ ] accessRules ; public byte classpathEntryType ; public String classpathEntryName ; public AccessRuleSet ( AccessRule [ ] accessRules , byte classpathEntryType , String classpathEntryName ) { this . accessRules = accessRules ; this . classpathEntryType = classpathEntryType ; this . classpathEntryName = classpathEntryName ; } public boolean equals ( Object object ) { if ( this == object ) return true ; if ( ! ( object instanceof AccessRuleSet ) ) return false ; AccessRuleSet otherRuleSet = ( AccessRuleSet ) object ; if ( this . classpathEntryType != otherRuleSet . classpathEntryType || this . classpathEntryName == null && otherRuleSet . classpathEntryName != null || ! this . classpathEntryName . equals ( otherRuleSet . classpathEntryName ) ) { return false ; } int rulesLength = this . accessRules . length ; if ( rulesLength != otherRuleSet . accessRules . length ) return false ; for ( int i = <NUM_LIT:0> ; i < rulesLength ; i ++ ) if ( ! this . accessRules [ i ] . equals ( otherRuleSet . accessRules [ i ] ) ) return false ; return true ; } public AccessRule [ ] getAccessRules ( ) { return this . accessRules ; } public AccessRestriction getViolatedRestriction ( char [ ] targetTypeFilePath ) { for ( int i = <NUM_LIT:0> , length = this . accessRules . length ; i < length ; i ++ ) { AccessRule accessRule = this . accessRules [ i ] ; if ( CharOperation . pathMatch ( accessRule . pattern , targetTypeFilePath , true , '<CHAR_LIT:/>' ) ) { switch ( accessRule . getProblemId ( ) ) { case IProblem . ForbiddenReference : case IProblem . DiscouragedReference : return new AccessRestriction ( accessRule , this . classpathEntryType , this . classpathEntryName ) ; default : return null ; } } } return null ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + hashCode ( this . accessRules ) ; result = prime * result + ( ( this . classpathEntryName == null ) ? <NUM_LIT:0> : this . classpathEntryName . hashCode ( ) ) ; result = prime * result + this . classpathEntryType ; return result ; } private int hashCode ( AccessRule [ ] rules ) { final int prime = <NUM_LIT:31> ; if ( rules == null ) return <NUM_LIT:0> ; int result = <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> , length = rules . length ; i < length ; i ++ ) { result = prime * result + ( rules [ i ] == null ? <NUM_LIT:0> : rules [ i ] . hashCode ( ) ) ; } return result ; } public String toString ( ) { return toString ( true ) ; } public String toString ( boolean wrap ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; buffer . append ( "<STR_LIT>" ) ; if ( wrap ) buffer . append ( '<STR_LIT:\n>' ) ; for ( int i = <NUM_LIT:0> , length = this . accessRules . length ; i < length ; i ++ ) { if ( wrap ) buffer . append ( '<STR_LIT:\t>' ) ; AccessRule accessRule = this . accessRules [ i ] ; buffer . append ( accessRule ) ; if ( wrap ) buffer . append ( '<STR_LIT:\n>' ) ; else if ( i < length - <NUM_LIT:1> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; } buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . classpathEntryName ) ; buffer . append ( "<STR_LIT:]>" ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IBinaryElementValuePair { char [ ] getName ( ) ; Object getValue ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface ISourceType extends IGenericType { int getDeclarationSourceEnd ( ) ; int getDeclarationSourceStart ( ) ; ISourceType getEnclosingType ( ) ; ISourceField [ ] getFields ( ) ; char [ ] [ ] getInterfaceNames ( ) ; ISourceType [ ] getMemberTypes ( ) ; ISourceMethod [ ] getMethods ( ) ; char [ ] getName ( ) ; int getNameSourceEnd ( ) ; int getNameSourceStart ( ) ; char [ ] getSuperclassName ( ) ; char [ ] [ ] [ ] getTypeParameterBounds ( ) ; char [ ] [ ] getTypeParameterNames ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IDependent { char JAR_FILE_ENTRY_SEPARATOR = '<CHAR_LIT>' ; char [ ] getFileName ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . env ; public interface IGenericMethod { int getModifiers ( ) ; boolean isConstructor ( ) ; char [ ] [ ] getArgumentNames ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public class ConditionalFlowInfo extends FlowInfo { public FlowInfo initsWhenTrue ; public FlowInfo initsWhenFalse ; ConditionalFlowInfo ( FlowInfo initsWhenTrue , FlowInfo initsWhenFalse ) { this . initsWhenTrue = initsWhenTrue ; this . initsWhenFalse = initsWhenFalse ; } public FlowInfo addInitializationsFrom ( FlowInfo otherInits ) { this . initsWhenTrue . addInitializationsFrom ( otherInits ) ; this . initsWhenFalse . addInitializationsFrom ( otherInits ) ; return this ; } public FlowInfo addNullInfoFrom ( FlowInfo otherInits ) { this . initsWhenTrue . addNullInfoFrom ( otherInits ) ; this . initsWhenFalse . addNullInfoFrom ( otherInits ) ; return this ; } public FlowInfo addPotentialInitializationsFrom ( FlowInfo otherInits ) { this . initsWhenTrue . addPotentialInitializationsFrom ( otherInits ) ; this . initsWhenFalse . addPotentialInitializationsFrom ( otherInits ) ; return this ; } public FlowInfo asNegatedCondition ( ) { FlowInfo extra = this . initsWhenTrue ; this . initsWhenTrue = this . initsWhenFalse ; this . initsWhenFalse = extra ; return this ; } public FlowInfo copy ( ) { return new ConditionalFlowInfo ( this . initsWhenTrue . copy ( ) , this . initsWhenFalse . copy ( ) ) ; } public FlowInfo initsWhenFalse ( ) { return this . initsWhenFalse ; } public FlowInfo initsWhenTrue ( ) { return this . initsWhenTrue ; } public boolean isDefinitelyAssigned ( FieldBinding field ) { return this . initsWhenTrue . isDefinitelyAssigned ( field ) && this . initsWhenFalse . isDefinitelyAssigned ( field ) ; } public boolean isDefinitelyAssigned ( LocalVariableBinding local ) { return this . initsWhenTrue . isDefinitelyAssigned ( local ) && this . initsWhenFalse . isDefinitelyAssigned ( local ) ; } public boolean isDefinitelyNonNull ( LocalVariableBinding local ) { return this . initsWhenTrue . isDefinitelyNonNull ( local ) && this . initsWhenFalse . isDefinitelyNonNull ( local ) ; } public boolean isDefinitelyNull ( LocalVariableBinding local ) { return this . initsWhenTrue . isDefinitelyNull ( local ) && this . initsWhenFalse . isDefinitelyNull ( local ) ; } public boolean isDefinitelyUnknown ( LocalVariableBinding local ) { return this . initsWhenTrue . isDefinitelyUnknown ( local ) && this . initsWhenFalse . isDefinitelyUnknown ( local ) ; } public boolean isPotentiallyAssigned ( FieldBinding field ) { return this . initsWhenTrue . isPotentiallyAssigned ( field ) || this . initsWhenFalse . isPotentiallyAssigned ( field ) ; } public boolean isPotentiallyAssigned ( LocalVariableBinding local ) { return this . initsWhenTrue . isPotentiallyAssigned ( local ) || this . initsWhenFalse . isPotentiallyAssigned ( local ) ; } public boolean isPotentiallyNonNull ( LocalVariableBinding local ) { return this . initsWhenTrue . isPotentiallyNonNull ( local ) || this . initsWhenFalse . isPotentiallyNonNull ( local ) ; } public boolean isPotentiallyNull ( LocalVariableBinding local ) { return this . initsWhenTrue . isPotentiallyNull ( local ) || this . initsWhenFalse . isPotentiallyNull ( local ) ; } public boolean isPotentiallyUnknown ( LocalVariableBinding local ) { return this . initsWhenTrue . isPotentiallyUnknown ( local ) || this . initsWhenFalse . isPotentiallyUnknown ( local ) ; } public boolean isProtectedNonNull ( LocalVariableBinding local ) { return this . initsWhenTrue . isProtectedNonNull ( local ) && this . initsWhenFalse . isProtectedNonNull ( local ) ; } public boolean isProtectedNull ( LocalVariableBinding local ) { return this . initsWhenTrue . isProtectedNull ( local ) && this . initsWhenFalse . isProtectedNull ( local ) ; } public void markAsComparedEqualToNonNull ( LocalVariableBinding local ) { this . initsWhenTrue . markAsComparedEqualToNonNull ( local ) ; this . initsWhenFalse . markAsComparedEqualToNonNull ( local ) ; } public void markAsComparedEqualToNull ( LocalVariableBinding local ) { this . initsWhenTrue . markAsComparedEqualToNull ( local ) ; this . initsWhenFalse . markAsComparedEqualToNull ( local ) ; } public void markAsDefinitelyAssigned ( FieldBinding field ) { this . initsWhenTrue . markAsDefinitelyAssigned ( field ) ; this . initsWhenFalse . markAsDefinitelyAssigned ( field ) ; } public void markAsDefinitelyAssigned ( LocalVariableBinding local ) { this . initsWhenTrue . markAsDefinitelyAssigned ( local ) ; this . initsWhenFalse . markAsDefinitelyAssigned ( local ) ; } public void markAsDefinitelyNonNull ( LocalVariableBinding local ) { this . initsWhenTrue . markAsDefinitelyNonNull ( local ) ; this . initsWhenFalse . markAsDefinitelyNonNull ( local ) ; } public void markAsDefinitelyNull ( LocalVariableBinding local ) { this . initsWhenTrue . markAsDefinitelyNull ( local ) ; this . initsWhenFalse . markAsDefinitelyNull ( local ) ; } public void markAsDefinitelyUnknown ( LocalVariableBinding local ) { this . initsWhenTrue . markAsDefinitelyUnknown ( local ) ; this . initsWhenFalse . markAsDefinitelyUnknown ( local ) ; } public FlowInfo setReachMode ( int reachMode ) { if ( reachMode == REACHABLE ) { this . tagBits &= ~ UNREACHABLE ; } else { this . tagBits |= UNREACHABLE ; } this . initsWhenTrue . setReachMode ( reachMode ) ; this . initsWhenFalse . setReachMode ( reachMode ) ; return this ; } public UnconditionalFlowInfo mergedWith ( UnconditionalFlowInfo otherInits ) { return unconditionalInits ( ) . mergedWith ( otherInits ) ; } public UnconditionalFlowInfo nullInfoLessUnconditionalCopy ( ) { return unconditionalInitsWithoutSideEffect ( ) . nullInfoLessUnconditionalCopy ( ) ; } public String toString ( ) { return "<STR_LIT>" + this . initsWhenTrue . toString ( ) + "<STR_LIT>" + this . initsWhenFalse . toString ( ) + "<STR_LIT:>>" ; } public FlowInfo safeInitsWhenTrue ( ) { return this . initsWhenTrue ; } public UnconditionalFlowInfo unconditionalCopy ( ) { return this . initsWhenTrue . unconditionalCopy ( ) . mergedWith ( this . initsWhenFalse . unconditionalInits ( ) ) ; } public UnconditionalFlowInfo unconditionalFieldLessCopy ( ) { return this . initsWhenTrue . unconditionalFieldLessCopy ( ) . mergedWith ( this . initsWhenFalse . unconditionalFieldLessCopy ( ) ) ; } public UnconditionalFlowInfo unconditionalInits ( ) { return this . initsWhenTrue . unconditionalInits ( ) . mergedWith ( this . initsWhenFalse . unconditionalInits ( ) ) ; } public UnconditionalFlowInfo unconditionalInitsWithoutSideEffect ( ) { return this . initsWhenTrue . unconditionalCopy ( ) . mergedWith ( this . initsWhenFalse . unconditionalInits ( ) ) ; } public void markedAsNullOrNonNullInAssertExpression ( LocalVariableBinding local ) { this . initsWhenTrue . markedAsNullOrNonNullInAssertExpression ( local ) ; this . initsWhenFalse . markedAsNullOrNonNullInAssertExpression ( local ) ; } public boolean isMarkedAsNullOrNonNullInAssertExpression ( LocalVariableBinding local ) { return ( this . initsWhenTrue . isMarkedAsNullOrNonNullInAssertExpression ( local ) || this . initsWhenFalse . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import java . util . ArrayList ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . LabeledStatement ; import org . eclipse . jdt . internal . compiler . ast . Reference ; import org . eclipse . jdt . internal . compiler . ast . SubRoutineStatement ; import org . eclipse . jdt . internal . compiler . ast . TryStatement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; 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 . 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 . lookup . VariableBinding ; public class FlowContext implements TypeConstants { public final static FlowContext NotContinuableContext = new FlowContext ( null , null ) ; public ASTNode associatedNode ; public FlowContext parent ; public NullInfoRegistry initsOnFinally ; public int tagBits ; public static final int DEFER_NULL_DIAGNOSTIC = <NUM_LIT> ; public static final int PREEMPT_NULL_DIAGNOSTIC = <NUM_LIT> ; public static final int HIDE_NULL_COMPARISON_WARNING = <NUM_LIT> ; public static final int CAN_ONLY_NULL_NON_NULL = <NUM_LIT> ; public static final int CAN_ONLY_NULL = <NUM_LIT> ; public static final int CAN_ONLY_NON_NULL = <NUM_LIT> ; public static final int MAY_NULL = <NUM_LIT> ; public static final int CHECK_MASK = <NUM_LIT> ; public static final int IN_COMPARISON_NULL = <NUM_LIT> ; public static final int IN_COMPARISON_NON_NULL = <NUM_LIT> ; public static final int IN_ASSIGNMENT = <NUM_LIT> ; public static final int IN_INSTANCEOF = <NUM_LIT> ; public static final int CONTEXT_MASK = ~ CHECK_MASK ; public FlowContext ( FlowContext parent , ASTNode associatedNode ) { this . parent = parent ; this . associatedNode = associatedNode ; if ( parent != null ) { if ( ( parent . tagBits & ( FlowContext . DEFER_NULL_DIAGNOSTIC | FlowContext . PREEMPT_NULL_DIAGNOSTIC ) ) != <NUM_LIT:0> ) { this . tagBits |= FlowContext . DEFER_NULL_DIAGNOSTIC ; } this . initsOnFinally = parent . initsOnFinally ; } } public BranchLabel breakLabel ( ) { return null ; } public void checkExceptionHandlers ( TypeBinding raisedException , ASTNode location , FlowInfo flowInfo , BlockScope scope ) { FlowContext traversedContext = this ; ArrayList abruptlyExitedLoops = null ; while ( traversedContext != null ) { SubRoutineStatement sub ; if ( ( ( sub = traversedContext . subroutine ( ) ) != null ) && sub . isSubRoutineEscaping ( ) ) { return ; } if ( traversedContext instanceof ExceptionHandlingFlowContext ) { ExceptionHandlingFlowContext exceptionContext = ( ExceptionHandlingFlowContext ) traversedContext ; ReferenceBinding [ ] caughtExceptions ; if ( ( caughtExceptions = exceptionContext . handledExceptions ) != Binding . NO_EXCEPTIONS ) { boolean definitelyCaught = false ; for ( int caughtIndex = <NUM_LIT:0> , caughtCount = caughtExceptions . length ; caughtIndex < caughtCount ; caughtIndex ++ ) { ReferenceBinding caughtException = caughtExceptions [ caughtIndex ] ; int state = caughtException == null ? Scope . EQUAL_OR_MORE_SPECIFIC : Scope . compareTypes ( raisedException , caughtException ) ; if ( abruptlyExitedLoops != null && caughtException != null && state != Scope . NOT_RELATED ) { for ( int i = <NUM_LIT:0> , abruptlyExitedLoopsCount = abruptlyExitedLoops . size ( ) ; i < abruptlyExitedLoopsCount ; i ++ ) { LoopingFlowContext loop = ( LoopingFlowContext ) abruptlyExitedLoops . get ( i ) ; loop . recordCatchContextOfEscapingException ( exceptionContext , caughtException ) ; } } switch ( state ) { case Scope . EQUAL_OR_MORE_SPECIFIC : exceptionContext . recordHandlingException ( caughtException , flowInfo . unconditionalInits ( ) , raisedException , location , definitelyCaught ) ; definitelyCaught = true ; break ; case Scope . MORE_GENERIC : exceptionContext . recordHandlingException ( caughtException , flowInfo . unconditionalInits ( ) , raisedException , location , false ) ; } } if ( definitelyCaught ) return ; } if ( exceptionContext . isMethodContext ) { if ( raisedException . isUncheckedException ( false ) ) return ; if ( exceptionContext . associatedNode instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) exceptionContext . associatedNode ; if ( method . isConstructor ( ) && method . binding . declaringClass . isAnonymousType ( ) ) { exceptionContext . mergeUnhandledException ( raisedException ) ; return ; } } break ; } } else if ( traversedContext instanceof LoopingFlowContext ) { if ( abruptlyExitedLoops == null ) { abruptlyExitedLoops = new ArrayList ( <NUM_LIT:5> ) ; } abruptlyExitedLoops . add ( traversedContext ) ; } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; if ( traversedContext instanceof InsideSubRoutineFlowContext ) { ASTNode node = traversedContext . associatedNode ; if ( node instanceof TryStatement ) { TryStatement tryStatement = ( TryStatement ) node ; flowInfo . addInitializationsFrom ( tryStatement . subRoutineInits ) ; } } traversedContext = traversedContext . parent ; } scope . problemReporter ( ) . unhandledException ( raisedException , location ) ; } public void checkExceptionHandlers ( TypeBinding [ ] raisedExceptions , ASTNode location , FlowInfo flowInfo , BlockScope scope ) { int remainingCount ; int raisedCount ; if ( ( raisedExceptions == null ) || ( ( raisedCount = raisedExceptions . length ) == <NUM_LIT:0> ) ) return ; remainingCount = raisedCount ; System . arraycopy ( raisedExceptions , <NUM_LIT:0> , ( raisedExceptions = new TypeBinding [ raisedCount ] ) , <NUM_LIT:0> , raisedCount ) ; FlowContext traversedContext = this ; ArrayList abruptlyExitedLoops = null ; while ( traversedContext != null ) { SubRoutineStatement sub ; if ( ( ( sub = traversedContext . subroutine ( ) ) != null ) && sub . isSubRoutineEscaping ( ) ) { return ; } if ( traversedContext instanceof ExceptionHandlingFlowContext ) { ExceptionHandlingFlowContext exceptionContext = ( ExceptionHandlingFlowContext ) traversedContext ; ReferenceBinding [ ] caughtExceptions ; if ( ( caughtExceptions = exceptionContext . handledExceptions ) != Binding . NO_EXCEPTIONS ) { int caughtCount = caughtExceptions . length ; boolean [ ] locallyCaught = new boolean [ raisedCount ] ; for ( int caughtIndex = <NUM_LIT:0> ; caughtIndex < caughtCount ; caughtIndex ++ ) { ReferenceBinding caughtException = caughtExceptions [ caughtIndex ] ; for ( int raisedIndex = <NUM_LIT:0> ; raisedIndex < raisedCount ; raisedIndex ++ ) { TypeBinding raisedException ; if ( ( raisedException = raisedExceptions [ raisedIndex ] ) != null ) { int state = caughtException == null ? Scope . EQUAL_OR_MORE_SPECIFIC : Scope . compareTypes ( raisedException , caughtException ) ; if ( abruptlyExitedLoops != null && caughtException != null && state != Scope . NOT_RELATED ) { for ( int i = <NUM_LIT:0> , abruptlyExitedLoopsCount = abruptlyExitedLoops . size ( ) ; i < abruptlyExitedLoopsCount ; i ++ ) { LoopingFlowContext loop = ( LoopingFlowContext ) abruptlyExitedLoops . get ( i ) ; loop . recordCatchContextOfEscapingException ( exceptionContext , caughtException ) ; } } switch ( state ) { case Scope . EQUAL_OR_MORE_SPECIFIC : exceptionContext . recordHandlingException ( caughtException , flowInfo . unconditionalInits ( ) , raisedException , location , locallyCaught [ raisedIndex ] ) ; if ( ! locallyCaught [ raisedIndex ] ) { locallyCaught [ raisedIndex ] = true ; remainingCount -- ; } break ; case Scope . MORE_GENERIC : exceptionContext . recordHandlingException ( caughtException , flowInfo . unconditionalInits ( ) , raisedException , location , false ) ; } } } } for ( int i = <NUM_LIT:0> ; i < raisedCount ; i ++ ) { if ( locallyCaught [ i ] ) { raisedExceptions [ i ] = null ; } } } if ( exceptionContext . isMethodContext ) { for ( int i = <NUM_LIT:0> ; i < raisedCount ; i ++ ) { TypeBinding raisedException ; if ( ( raisedException = raisedExceptions [ i ] ) != null ) { if ( raisedException . isUncheckedException ( false ) ) { remainingCount -- ; raisedExceptions [ i ] = null ; } } } if ( exceptionContext . associatedNode instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) exceptionContext . associatedNode ; if ( method . isConstructor ( ) && method . binding . declaringClass . isAnonymousType ( ) ) { for ( int i = <NUM_LIT:0> ; i < raisedCount ; i ++ ) { TypeBinding raisedException ; if ( ( raisedException = raisedExceptions [ i ] ) != null ) { exceptionContext . mergeUnhandledException ( raisedException ) ; } } return ; } } break ; } } else if ( traversedContext instanceof LoopingFlowContext ) { if ( abruptlyExitedLoops == null ) { abruptlyExitedLoops = new ArrayList ( <NUM_LIT:5> ) ; } abruptlyExitedLoops . add ( traversedContext ) ; } if ( remainingCount == <NUM_LIT:0> ) return ; traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; if ( traversedContext instanceof InsideSubRoutineFlowContext ) { ASTNode node = traversedContext . associatedNode ; if ( node instanceof TryStatement ) { TryStatement tryStatement = ( TryStatement ) node ; flowInfo . addInitializationsFrom ( tryStatement . subRoutineInits ) ; } } traversedContext = traversedContext . parent ; } nextReport : for ( int i = <NUM_LIT:0> ; i < raisedCount ; i ++ ) { TypeBinding exception ; if ( ( exception = raisedExceptions [ i ] ) != null ) { for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { if ( raisedExceptions [ j ] == exception ) continue nextReport ; } scope . problemReporter ( ) . unhandledException ( exception , location ) ; } } } public BranchLabel continueLabel ( ) { return null ; } public FlowInfo getInitsForFinalBlankInitializationCheck ( TypeBinding declaringType , FlowInfo flowInfo ) { FlowContext current = this ; FlowInfo inits = flowInfo ; do { if ( current instanceof InitializationFlowContext ) { InitializationFlowContext initializationContext = ( InitializationFlowContext ) current ; if ( ( ( TypeDeclaration ) initializationContext . associatedNode ) . binding == declaringType ) { return inits ; } inits = initializationContext . initsBeforeContext ; current = initializationContext . initializationParent ; } else if ( current instanceof ExceptionHandlingFlowContext ) { ExceptionHandlingFlowContext exceptionContext = ( ExceptionHandlingFlowContext ) current ; current = exceptionContext . initializationParent == null ? exceptionContext . parent : exceptionContext . initializationParent ; } else { current = current . parent ; } } while ( current != null ) ; return null ; } public FlowContext getTargetContextForBreakLabel ( char [ ] labelName ) { FlowContext current = this , lastNonReturningSubRoutine = null ; while ( current != null ) { if ( current . isNonReturningContext ( ) ) { lastNonReturningSubRoutine = current ; } char [ ] currentLabelName ; if ( ( ( currentLabelName = current . labelName ( ) ) != null ) && CharOperation . equals ( currentLabelName , labelName ) ) { ( ( LabeledStatement ) current . associatedNode ) . bits |= ASTNode . LabelUsed ; if ( lastNonReturningSubRoutine == null ) return current ; return lastNonReturningSubRoutine ; } current = current . parent ; } return null ; } public FlowContext getTargetContextForContinueLabel ( char [ ] labelName ) { FlowContext current = this ; FlowContext lastContinuable = null ; FlowContext lastNonReturningSubRoutine = null ; while ( current != null ) { if ( current . isNonReturningContext ( ) ) { lastNonReturningSubRoutine = current ; } else { if ( current . isContinuable ( ) ) { lastContinuable = current ; } } char [ ] currentLabelName ; if ( ( currentLabelName = current . labelName ( ) ) != null && CharOperation . equals ( currentLabelName , labelName ) ) { ( ( LabeledStatement ) current . associatedNode ) . bits |= ASTNode . LabelUsed ; if ( ( lastContinuable != null ) && ( current . associatedNode . concreteStatement ( ) == lastContinuable . associatedNode ) ) { if ( lastNonReturningSubRoutine == null ) return lastContinuable ; return lastNonReturningSubRoutine ; } return FlowContext . NotContinuableContext ; } current = current . parent ; } return null ; } public FlowContext getTargetContextForDefaultBreak ( ) { FlowContext current = this , lastNonReturningSubRoutine = null ; while ( current != null ) { if ( current . isNonReturningContext ( ) ) { lastNonReturningSubRoutine = current ; } if ( current . isBreakable ( ) && current . labelName ( ) == null ) { if ( lastNonReturningSubRoutine == null ) return current ; return lastNonReturningSubRoutine ; } current = current . parent ; } return null ; } public FlowContext getTargetContextForDefaultContinue ( ) { FlowContext current = this , lastNonReturningSubRoutine = null ; while ( current != null ) { if ( current . isNonReturningContext ( ) ) { lastNonReturningSubRoutine = current ; } if ( current . isContinuable ( ) ) { if ( lastNonReturningSubRoutine == null ) return current ; return lastNonReturningSubRoutine ; } current = current . parent ; } return null ; } public String individualToString ( ) { return "<STR_LIT>" ; } public FlowInfo initsOnBreak ( ) { return FlowInfo . DEAD_END ; } public UnconditionalFlowInfo initsOnReturn ( ) { return FlowInfo . DEAD_END ; } public boolean isBreakable ( ) { return false ; } public boolean isContinuable ( ) { return false ; } public boolean isNonReturningContext ( ) { return false ; } public boolean isSubRoutine ( ) { return false ; } public char [ ] labelName ( ) { return null ; } public void recordBreakFrom ( FlowInfo flowInfo ) { } public void recordBreakTo ( FlowContext targetContext ) { } public void recordContinueFrom ( FlowContext innerFlowContext , FlowInfo flowInfo ) { } protected boolean recordFinalAssignment ( VariableBinding variable , Reference finalReference ) { return true ; } protected void recordNullReference ( LocalVariableBinding local , Expression expression , int status ) { } public void recordReturnFrom ( UnconditionalFlowInfo flowInfo ) { } public void recordSettingFinal ( VariableBinding variable , Reference finalReference , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { FlowContext context = this ; while ( context != null ) { if ( ! context . recordFinalAssignment ( variable , finalReference ) ) { break ; } context = context . parent ; } } } public void recordUsingNullReference ( Scope scope , LocalVariableBinding local , Expression reference , int checkType , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> || flowInfo . isDefinitelyUnknown ( local ) ) { return ; } switch ( checkType ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( checkType == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } return ; } else if ( flowInfo . cannotBeDefinitelyNullOrNonNull ( local ) ) { return ; } case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , reference ) ; return ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , reference ) ; return ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; } } else if ( flowInfo . cannotBeDefinitelyNullOrNonNull ( local ) ) { return ; } break ; case MAY_NULL : if ( flowInfo . isDefinitelyNull ( local ) ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; default : } if ( this . parent != null ) { this . parent . recordUsingNullReference ( scope , local , reference , checkType , flowInfo ) ; } } void removeFinalAssignmentIfAny ( Reference reference ) { } public SubRoutineStatement subroutine ( ) { return null ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; FlowContext current = this ; int parentsCount = <NUM_LIT:0> ; while ( ( current = current . parent ) != null ) { parentsCount ++ ; } FlowContext [ ] parents = new FlowContext [ parentsCount + <NUM_LIT:1> ] ; current = this ; int index = parentsCount ; while ( index >= <NUM_LIT:0> ) { parents [ index -- ] = current ; current = current . parent ; } for ( int i = <NUM_LIT:0> ; i < parentsCount ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) buffer . append ( '<STR_LIT:\t>' ) ; buffer . append ( parents [ i ] . individualToString ( ) ) . append ( '<STR_LIT:\n>' ) ; } buffer . append ( '<CHAR_LIT>' ) ; for ( int j = <NUM_LIT:0> ; j < parentsCount + <NUM_LIT:1> ; j ++ ) buffer . append ( '<STR_LIT:\t>' ) ; buffer . append ( individualToString ( ) ) . append ( '<STR_LIT:\n>' ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; public class SwitchFlowContext extends FlowContext { public BranchLabel breakLabel ; public UnconditionalFlowInfo initsOnBreak = FlowInfo . DEAD_END ; public SwitchFlowContext ( FlowContext parent , ASTNode associatedNode , BranchLabel breakLabel ) { super ( parent , associatedNode ) ; this . breakLabel = breakLabel ; } public BranchLabel breakLabel ( ) { return this . breakLabel ; } public String individualToString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) . append ( this . initsOnBreak . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } public boolean isBreakable ( ) { return true ; } public void recordBreakFrom ( FlowInfo flowInfo ) { if ( ( this . initsOnBreak . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { this . initsOnBreak = this . initsOnBreak . mergedWith ( flowInfo . unconditionalInits ( ) ) ; } else { this . initsOnBreak = flowInfo . unconditionalCopy ( ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; public class UnconditionalFlowInfo extends FlowInfo { public static class AssertionFailedException extends RuntimeException { private static final long serialVersionUID = <NUM_LIT> ; public AssertionFailedException ( String message ) { super ( message ) ; } } public final static boolean COVERAGE_TEST_FLAG = false ; public static int CoverageTestId ; public long definiteInits ; public long potentialInits ; public long nullBit1 , nullBit2 , nullBit3 , nullBit4 ; public static final int extraLength = <NUM_LIT:6> ; public long extra [ ] [ ] ; public int maxFieldCount ; public static final int BitCacheSize = <NUM_LIT> ; public int [ ] nullStatusChangedInAssert ; public FlowInfo addInitializationsFrom ( FlowInfo inits ) { return addInfoFrom ( inits , true ) ; } public FlowInfo addNullInfoFrom ( FlowInfo inits ) { return addInfoFrom ( inits , false ) ; } private FlowInfo addInfoFrom ( FlowInfo inits , boolean handleInits ) { if ( this == DEAD_END ) return this ; if ( inits == DEAD_END ) return this ; UnconditionalFlowInfo otherInits = inits . unconditionalInits ( ) ; if ( handleInits ) { this . definiteInits |= otherInits . definiteInits ; this . potentialInits |= otherInits . potentialInits ; } boolean thisHadNulls = ( this . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> , otherHasNulls = ( otherInits . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> ; long a1 , a2 , a3 , a4 , na1 , na2 , na3 , na4 , b1 , b2 , b3 , b4 , nb1 , nb2 , nb3 , nb4 ; if ( otherHasNulls ) { if ( ! thisHadNulls ) { this . nullBit1 = otherInits . nullBit1 ; this . nullBit2 = otherInits . nullBit2 ; this . nullBit3 = otherInits . nullBit3 ; this . nullBit4 = otherInits . nullBit4 ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:1> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } else { this . nullBit1 = ( b1 = otherInits . nullBit1 ) | ( a1 = this . nullBit1 ) & ( ( a3 = this . nullBit3 ) & ( a4 = this . nullBit4 ) & ( nb2 = ~ ( b2 = otherInits . nullBit2 ) ) & ( nb4 = ~ ( b4 = otherInits . nullBit4 ) ) | ( ( na4 = ~ a4 ) | ( na3 = ~ a3 ) ) & ( ( na2 = ~ ( a2 = this . nullBit2 ) ) & nb2 | a2 & ( nb3 = ~ ( b3 = otherInits . nullBit3 ) ) & nb4 ) ) ; this . nullBit2 = b2 & ( nb4 | nb3 ) | na3 & na4 & b2 | a2 & ( nb3 & nb4 | ( nb1 = ~ b1 ) & ( na3 | ( na1 = ~ a1 ) ) | a1 & b2 ) ; this . nullBit3 = b3 & ( nb1 & ( b2 | a2 | na1 ) | b1 & ( b4 | nb2 | a1 & a3 ) | na1 & na2 & na4 ) | a3 & nb2 & nb4 | nb1 & ( ( na2 & a4 | na1 ) & a3 | a1 & na2 & na4 & b2 ) ; this . nullBit4 = nb1 & ( a4 & ( na3 & nb3 | ( a3 | na2 ) & nb2 ) | a1 & ( a3 & nb2 & b4 | a2 & b2 & ( b4 | a3 & na4 & nb3 ) ) ) | b1 & ( a3 & a4 & b4 | na2 & na4 & nb3 & b4 | a2 & ( ( b3 | a4 ) & b4 | na3 & a4 & b2 & b3 ) | na1 & ( b4 | ( a4 | a2 ) & b2 & b3 ) ) | ( na1 & ( na3 & nb3 | na2 & nb2 ) | a1 & ( nb2 & nb3 | a2 & a3 ) ) & b4 ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:2> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } this . tagBits |= NULL_FLAG_MASK ; } if ( this . extra != null || otherInits . extra != null ) { int mergeLimit = <NUM_LIT:0> , copyLimit = <NUM_LIT:0> ; if ( this . extra != null ) { if ( otherInits . extra != null ) { int length , otherLength ; if ( ( length = this . extra [ <NUM_LIT:0> ] . length ) < ( otherLength = otherInits . extra [ <NUM_LIT:0> ] . length ) ) { for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ otherLength ] ) , <NUM_LIT:0> , length ) ; } mergeLimit = length ; copyLimit = otherLength ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:3> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } else { mergeLimit = otherLength ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:4> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } } else if ( otherInits . extra != null ) { int otherLength ; this . extra = new long [ extraLength ] [ ] ; System . arraycopy ( otherInits . extra [ <NUM_LIT:0> ] , <NUM_LIT:0> , ( this . extra [ <NUM_LIT:0> ] = new long [ otherLength = otherInits . extra [ <NUM_LIT:0> ] . length ] ) , <NUM_LIT:0> , otherLength ) ; System . arraycopy ( otherInits . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , ( this . extra [ <NUM_LIT:1> ] = new long [ otherLength ] ) , <NUM_LIT:0> , otherLength ) ; if ( otherHasNulls ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { System . arraycopy ( otherInits . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ otherLength ] ) , <NUM_LIT:0> , otherLength ) ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:5> ) { this . extra [ <NUM_LIT:5> ] [ otherLength - <NUM_LIT:1> ] = ~ <NUM_LIT:0> ; } } } else { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ otherLength ] ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:6> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } int i ; if ( handleInits ) { for ( i = <NUM_LIT:0> ; i < mergeLimit ; i ++ ) { this . extra [ <NUM_LIT:0> ] [ i ] |= otherInits . extra [ <NUM_LIT:0> ] [ i ] ; this . extra [ <NUM_LIT:1> ] [ i ] |= otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } for ( ; i < copyLimit ; i ++ ) { this . extra [ <NUM_LIT:0> ] [ i ] = otherInits . extra [ <NUM_LIT:0> ] [ i ] ; this . extra [ <NUM_LIT:1> ] [ i ] = otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } } if ( ! thisHadNulls ) { if ( copyLimit < mergeLimit ) { copyLimit = mergeLimit ; } mergeLimit = <NUM_LIT:0> ; } if ( ! otherHasNulls ) { copyLimit = <NUM_LIT:0> ; mergeLimit = <NUM_LIT:0> ; } for ( i = <NUM_LIT:0> ; i < mergeLimit ; i ++ ) { this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] = ( b1 = otherInits . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) | ( a1 = this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( ( a3 = this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) & ( a4 = this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) & ( nb2 = ~ ( b2 = otherInits . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) ) & ( nb4 = ~ ( b4 = otherInits . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) ) | ( ( na4 = ~ a4 ) | ( na3 = ~ a3 ) ) & ( ( na2 = ~ ( a2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) ) & nb2 | a2 & ( nb3 = ~ ( b3 = otherInits . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) ) & nb4 ) ) ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = b2 & ( nb4 | nb3 ) | na3 & na4 & b2 | a2 & ( nb3 & nb4 | ( nb1 = ~ b1 ) & ( na3 | ( na1 = ~ a1 ) ) | a1 & b2 ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = b3 & ( nb1 & ( b2 | a2 | na1 ) | b1 & ( b4 | nb2 | a1 & a3 ) | na1 & na2 & na4 ) | a3 & nb2 & nb4 | nb1 & ( ( na2 & a4 | na1 ) & a3 | a1 & na2 & na4 & b2 ) ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = nb1 & ( a4 & ( na3 & nb3 | ( a3 | na2 ) & nb2 ) | a1 & ( a3 & nb2 & b4 | a2 & b2 & ( b4 | a3 & na4 & nb3 ) ) ) | b1 & ( a3 & a4 & b4 | na2 & na4 & nb3 & b4 | a2 & ( ( b3 | a4 ) & b4 | na3 & a4 & b2 & b3 ) | na1 & ( b4 | ( a4 | a2 ) & b2 & b3 ) ) | ( na1 & ( na3 & nb3 | na2 & nb2 ) | a1 & ( nb2 & nb3 | a2 & a3 ) ) & b4 ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:7> ) { this . extra [ <NUM_LIT:5> ] [ i ] = ~ <NUM_LIT:0> ; } } } for ( ; i < copyLimit ; i ++ ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { this . extra [ j ] [ i ] = otherInits . extra [ j ] [ i ] ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:8> ) { this . extra [ <NUM_LIT:5> ] [ i ] = ~ <NUM_LIT:0> ; } } } } combineNullStatusChangeInAssertInfo ( otherInits ) ; return this ; } public FlowInfo addPotentialInitializationsFrom ( FlowInfo inits ) { if ( this == DEAD_END ) { return this ; } if ( inits == DEAD_END ) { return this ; } UnconditionalFlowInfo otherInits = inits . unconditionalInits ( ) ; this . potentialInits |= otherInits . potentialInits ; if ( this . extra != null ) { if ( otherInits . extra != null ) { int i = <NUM_LIT:0> , length , otherLength ; if ( ( length = this . extra [ <NUM_LIT:0> ] . length ) < ( otherLength = otherInits . extra [ <NUM_LIT:0> ] . length ) ) { for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ otherLength ] ) , <NUM_LIT:0> , length ) ; } for ( ; i < length ; i ++ ) { this . extra [ <NUM_LIT:1> ] [ i ] |= otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } for ( ; i < otherLength ; i ++ ) { this . extra [ <NUM_LIT:1> ] [ i ] = otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } } else { for ( ; i < otherLength ; i ++ ) { this . extra [ <NUM_LIT:1> ] [ i ] |= otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } } } } else if ( otherInits . extra != null ) { int otherLength = otherInits . extra [ <NUM_LIT:0> ] . length ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ otherLength ] ; } System . arraycopy ( otherInits . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , this . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , otherLength ) ; } addPotentialNullInfoFrom ( otherInits ) ; return this ; } public UnconditionalFlowInfo addPotentialNullInfoFrom ( UnconditionalFlowInfo otherInits ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> || ( otherInits . tagBits & UNREACHABLE ) != <NUM_LIT:0> || ( otherInits . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> ) { return this ; } boolean thisHadNulls = ( this . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> , thisHasNulls = false ; long a1 , a2 , a3 , a4 , na1 , na2 , na3 , na4 , b1 , b2 , b3 , b4 , nb1 , nb2 , nb3 , nb4 ; if ( thisHadNulls ) { this . nullBit1 = ( a1 = this . nullBit1 ) & ( ( a3 = this . nullBit3 ) & ( a4 = this . nullBit4 ) & ( ( nb2 = ~ ( b2 = otherInits . nullBit2 ) ) & ( nb4 = ~ ( b4 = otherInits . nullBit4 ) ) | ( b1 = otherInits . nullBit1 ) & ( b3 = otherInits . nullBit3 ) ) | ( na2 = ~ ( a2 = this . nullBit2 ) ) & ( b1 & b3 | ( ( na4 = ~ a4 ) | ( na3 = ~ a3 ) ) & nb2 ) | a2 & ( ( na4 | na3 ) & ( ( nb3 = ~ b3 ) & nb4 | b1 & b2 ) ) ) ; this . nullBit2 = b2 & ( nb3 | ( nb1 = ~ b1 ) ) | a2 & ( nb3 & nb4 | b2 | na3 | ( na1 = ~ a1 ) ) ; this . nullBit3 = b3 & ( nb1 & b2 | a2 & ( nb2 | a3 ) | na1 & nb2 | a1 & na2 & na4 & b1 ) | a3 & ( nb2 & nb4 | na2 & a4 | na1 ) | a1 & na2 & na4 & b2 ; this . nullBit4 = na3 & ( nb1 & nb3 & b4 | a4 & ( nb3 | b1 & b2 ) ) | nb2 & ( na3 & b1 & nb3 | na2 & ( nb1 & b4 | b1 & nb3 | a4 ) ) | a3 & ( a4 & ( nb2 | b1 & b3 ) | a1 & a2 & ( nb1 & b4 | na4 & ( b2 | b1 ) & nb3 ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:9> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } if ( ( this . nullBit2 | this . nullBit3 | this . nullBit4 ) != <NUM_LIT:0> ) { thisHasNulls = true ; } } else { this . nullBit1 = <NUM_LIT:0> ; this . nullBit2 = ( b2 = otherInits . nullBit2 ) & ( ( nb3 = ~ ( b3 = otherInits . nullBit3 ) ) | ( nb1 = ~ ( b1 = otherInits . nullBit1 ) ) ) ; this . nullBit3 = b3 & ( nb1 | ( nb2 = ~ b2 ) ) ; this . nullBit4 = ~ b1 & ~ b3 & ( b4 = otherInits . nullBit4 ) | ~ b2 & ( b1 & ~ b3 | ~ b1 & b4 ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:10> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } if ( ( this . nullBit2 | this . nullBit3 | this . nullBit4 ) != <NUM_LIT:0> ) { thisHasNulls = true ; } } if ( otherInits . extra != null ) { int mergeLimit = <NUM_LIT:0> , copyLimit = otherInits . extra [ <NUM_LIT:0> ] . length ; if ( this . extra == null ) { this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ copyLimit ] ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:11> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } else { mergeLimit = copyLimit ; if ( mergeLimit > this . extra [ <NUM_LIT:0> ] . length ) { mergeLimit = this . extra [ <NUM_LIT:0> ] . length ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , this . extra [ j ] = new long [ copyLimit ] , <NUM_LIT:0> , mergeLimit ) ; } if ( ! thisHadNulls ) { mergeLimit = <NUM_LIT:0> ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:12> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } } int i ; for ( i = <NUM_LIT:0> ; i < mergeLimit ; i ++ ) { this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] = ( a1 = this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( ( a3 = this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) & ( a4 = this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) & ( ( nb2 = ~ ( b2 = otherInits . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) ) & ( nb4 = ~ ( b4 = otherInits . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) ) | ( b1 = otherInits . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( b3 = otherInits . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) ) | ( na2 = ~ ( a2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) ) & ( b1 & b3 | ( ( na4 = ~ a4 ) | ( na3 = ~ a3 ) ) & nb2 ) | a2 & ( ( na4 | na3 ) & ( ( nb3 = ~ b3 ) & nb4 | b1 & b2 ) ) ) ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = b2 & ( nb3 | ( nb1 = ~ b1 ) ) | a2 & ( nb3 & nb4 | b2 | na3 | ( na1 = ~ a1 ) ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = b3 & ( nb1 & b2 | a2 & ( nb2 | a3 ) | na1 & nb2 | a1 & na2 & na4 & b1 ) | a3 & ( nb2 & nb4 | na2 & a4 | na1 ) | a1 & na2 & na4 & b2 ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = na3 & ( nb1 & nb3 & b4 | a4 & ( nb3 | b1 & b2 ) ) | nb2 & ( na3 & b1 & nb3 | na2 & ( nb1 & b4 | b1 & nb3 | a4 ) ) | a3 & ( a4 & ( nb2 | b1 & b3 ) | a1 & a2 & ( nb1 & b4 | na4 & ( b2 | b1 ) & nb3 ) ) ; if ( ( this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] | this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] | this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) != <NUM_LIT:0> ) { thisHasNulls = true ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } for ( ; i < copyLimit ; i ++ ) { this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] = <NUM_LIT:0> ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = ( b2 = otherInits . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) & ( ( nb3 = ~ ( b3 = otherInits . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) ) | ( nb1 = ~ ( b1 = otherInits . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) ) ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = b3 & ( nb1 | ( nb2 = ~ b2 ) ) ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = ~ b1 & ~ b3 & ( b4 = otherInits . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) | ~ b2 & ( b1 & ~ b3 | ~ b1 & b4 ) ; if ( ( this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] | this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] | this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) != <NUM_LIT:0> ) { thisHasNulls = true ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ i ] = ~ <NUM_LIT:0> ; } } } } combineNullStatusChangeInAssertInfo ( otherInits ) ; if ( thisHasNulls ) { this . tagBits |= NULL_FLAG_MASK ; } else { this . tagBits &= NULL_FLAG_MASK ; } return this ; } final public boolean cannotBeDefinitelyNullOrNonNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( ( ~ this . nullBit1 & ( this . nullBit2 & this . nullBit3 | this . nullBit4 ) | ~ this . nullBit2 & ~ this . nullBit3 & this . nullBit4 ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } long a2 , a3 , a4 ; return ( ( ~ this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & ( ( a2 = this . extra [ <NUM_LIT:3> ] [ vectorIndex ] ) & ( a3 = this . extra [ <NUM_LIT:4> ] [ vectorIndex ] ) | ( a4 = this . extra [ <NUM_LIT:5> ] [ vectorIndex ] ) ) | ~ a2 & ~ a3 & a4 ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean cannotBeNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( this . nullBit1 & this . nullBit3 & ( ( this . nullBit2 & this . nullBit4 ) | ~ this . nullBit2 ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:4> ] [ vectorIndex ] & ( ( this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & this . extra [ <NUM_LIT:5> ] [ vectorIndex ] ) | ~ this . extra [ <NUM_LIT:3> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean canOnlyBeNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( this . nullBit1 & this . nullBit2 & ( ~ this . nullBit3 | ~ this . nullBit4 ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & ( ~ this . extra [ <NUM_LIT:4> ] [ vectorIndex ] | ~ this . extra [ <NUM_LIT:5> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } public FlowInfo copy ( ) { if ( this == DEAD_END ) { return this ; } UnconditionalFlowInfo copy = new UnconditionalFlowInfo ( ) ; copy . definiteInits = this . definiteInits ; copy . potentialInits = this . potentialInits ; boolean hasNullInfo = ( this . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> ; if ( hasNullInfo ) { copy . nullBit1 = this . nullBit1 ; copy . nullBit2 = this . nullBit2 ; copy . nullBit3 = this . nullBit3 ; copy . nullBit4 = this . nullBit4 ; } copy . tagBits = this . tagBits ; copy . maxFieldCount = this . maxFieldCount ; if ( this . extra != null ) { int length ; copy . extra = new long [ extraLength ] [ ] ; System . arraycopy ( this . extra [ <NUM_LIT:0> ] , <NUM_LIT:0> , ( copy . extra [ <NUM_LIT:0> ] = new long [ length = this . extra [ <NUM_LIT:0> ] . length ] ) , <NUM_LIT:0> , length ) ; System . arraycopy ( this . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , ( copy . extra [ <NUM_LIT:1> ] = new long [ length ] ) , <NUM_LIT:0> , length ) ; if ( hasNullInfo ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( copy . extra [ j ] = new long [ length ] ) , <NUM_LIT:0> , length ) ; } } else { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { copy . extra [ j ] = new long [ length ] ; } } } copy . nullStatusChangedInAssert = this . nullStatusChangedInAssert ; return copy ; } public UnconditionalFlowInfo discardInitializationInfo ( ) { if ( this == DEAD_END ) { return this ; } this . definiteInits = this . potentialInits = <NUM_LIT:0> ; if ( this . extra != null ) { for ( int i = <NUM_LIT:0> , length = this . extra [ <NUM_LIT:0> ] . length ; i < length ; i ++ ) { this . extra [ <NUM_LIT:0> ] [ i ] = this . extra [ <NUM_LIT:1> ] [ i ] = <NUM_LIT:0> ; } } return this ; } public UnconditionalFlowInfo discardNonFieldInitializations ( ) { int limit = this . maxFieldCount ; if ( limit < BitCacheSize ) { long mask = ( <NUM_LIT:1L> << limit ) - <NUM_LIT:1> ; this . definiteInits &= mask ; this . potentialInits &= mask ; this . nullBit1 &= mask ; this . nullBit2 &= mask ; this . nullBit3 &= mask ; this . nullBit4 &= mask ; } if ( this . extra == null ) { return this ; } int vectorIndex , length = this . extra [ <NUM_LIT:0> ] . length ; if ( ( vectorIndex = ( limit / BitCacheSize ) - <NUM_LIT:1> ) >= length ) { return this ; } if ( vectorIndex >= <NUM_LIT:0> ) { long mask = ( <NUM_LIT:1L> << ( limit % BitCacheSize ) ) - <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] [ vectorIndex ] &= mask ; } } for ( int i = vectorIndex + <NUM_LIT:1> ; i < length ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] [ i ] = <NUM_LIT:0> ; } } return this ; } public FlowInfo initsWhenFalse ( ) { return this ; } public FlowInfo initsWhenTrue ( ) { return this ; } final private boolean isDefinitelyAssigned ( int position ) { if ( position < BitCacheSize ) { return ( this . definiteInits & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) return false ; int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:0> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isDefinitelyAssigned ( FieldBinding field ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> ) { return true ; } return isDefinitelyAssigned ( field . id ) ; } final public boolean isDefinitelyAssigned ( LocalVariableBinding local ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> && ( local . declaration . bits & ASTNode . IsLocalDeclarationReachable ) != <NUM_LIT:0> ) { return true ; } return isDefinitelyAssigned ( local . id + this . maxFieldCount ) ; } final public boolean isDefinitelyNonNull ( LocalVariableBinding local ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> || ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> ) { return false ; } if ( ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> || local . constant ( ) != Constant . NotAConstant ) { return true ; } int position = local . id + this . maxFieldCount ; if ( position < BitCacheSize ) { return ( ( this . nullBit1 & this . nullBit3 & ( ~ this . nullBit2 | this . nullBit4 ) ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:4> ] [ vectorIndex ] & ( ~ this . extra [ <NUM_LIT:3> ] [ vectorIndex ] | this . extra [ <NUM_LIT:5> ] [ vectorIndex ] ) ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isDefinitelyNull ( LocalVariableBinding local ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> || ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position = local . id + this . maxFieldCount ; if ( position < BitCacheSize ) { return ( ( this . nullBit1 & this . nullBit2 & ( ~ this . nullBit3 | ~ this . nullBit4 ) ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & ( ~ this . extra [ <NUM_LIT:4> ] [ vectorIndex ] | ~ this . extra [ <NUM_LIT:5> ] [ vectorIndex ] ) ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isDefinitelyUnknown ( LocalVariableBinding local ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> || ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> ) { return false ; } int position = local . id + this . maxFieldCount ; if ( position < BitCacheSize ) { return ( ( this . nullBit1 & this . nullBit4 & ~ this . nullBit2 & ~ this . nullBit3 ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:5> ] [ vectorIndex ] & ~ this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & ~ this . extra [ <NUM_LIT:4> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final private boolean isPotentiallyAssigned ( int position ) { if ( position < BitCacheSize ) { return ( this . potentialInits & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:1> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isPotentiallyAssigned ( FieldBinding field ) { return isPotentiallyAssigned ( field . id ) ; } final public boolean isPotentiallyAssigned ( LocalVariableBinding local ) { if ( local . constant ( ) != Constant . NotAConstant ) { return true ; } return isPotentiallyAssigned ( local . id + this . maxFieldCount ) ; } final public boolean isPotentiallyNonNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( ( this . nullBit3 & ( ~ this . nullBit1 | ~ this . nullBit2 ) ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:4> ] [ vectorIndex ] & ( ~ this . extra [ <NUM_LIT:2> ] [ vectorIndex ] | ~ this . extra [ <NUM_LIT:3> ] [ vectorIndex ] ) ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isPotentiallyNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( ( this . nullBit2 & ( ~ this . nullBit1 | ~ this . nullBit3 ) ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( ( this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & ( ~ this . extra [ <NUM_LIT:2> ] [ vectorIndex ] | ~ this . extra [ <NUM_LIT:4> ] [ vectorIndex ] ) ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isPotentiallyUnknown ( LocalVariableBinding local ) { if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> || ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> ) { return false ; } int position = local . id + this . maxFieldCount ; if ( position < BitCacheSize ) { return ( this . nullBit4 & ( ~ this . nullBit1 | ~ this . nullBit2 & ~ this . nullBit3 ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( this . extra [ <NUM_LIT:5> ] [ vectorIndex ] & ( ~ this . extra [ <NUM_LIT:2> ] [ vectorIndex ] | ~ this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & ~ this . extra [ <NUM_LIT:4> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isProtectedNonNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( this . nullBit1 & this . nullBit3 & this . nullBit4 & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:4> ] [ vectorIndex ] & this . extra [ <NUM_LIT:5> ] [ vectorIndex ] & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } final public boolean isProtectedNull ( LocalVariableBinding local ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> || ( local . type . tagBits & TagBits . IsBaseType ) != <NUM_LIT:0> ) { return false ; } int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { return ( this . nullBit1 & this . nullBit2 & ( this . nullBit3 ^ this . nullBit4 ) & ( <NUM_LIT:1L> << position ) ) != <NUM_LIT:0> ; } if ( this . extra == null ) { return false ; } int vectorIndex ; if ( ( vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ) >= this . extra [ <NUM_LIT:0> ] . length ) { return false ; } return ( this . extra [ <NUM_LIT:2> ] [ vectorIndex ] & this . extra [ <NUM_LIT:3> ] [ vectorIndex ] & ( this . extra [ <NUM_LIT:4> ] [ vectorIndex ] ^ this . extra [ <NUM_LIT:5> ] [ vectorIndex ] ) & ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ) != <NUM_LIT:0> ; } public void markAsComparedEqualToNonNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; long a1 , a2 , a3 , a4 , na2 ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { if ( ( ( mask = <NUM_LIT:1L> << position ) & ( a1 = this . nullBit1 ) & ( na2 = ~ ( a2 = this . nullBit2 ) ) & ~ ( a3 = this . nullBit3 ) & ( a4 = this . nullBit4 ) ) != <NUM_LIT:0> ) { this . nullBit4 &= ~ mask ; } else if ( ( mask & a1 & na2 & a3 ) == <NUM_LIT:0> ) { this . nullBit4 |= mask ; if ( ( mask & a1 ) == <NUM_LIT:0> ) { if ( ( mask & a2 & ( a3 ^ a4 ) ) != <NUM_LIT:0> ) { this . nullBit2 &= ~ mask ; } else if ( ( mask & ( a2 | a3 | a4 ) ) == <NUM_LIT:0> ) { this . nullBit2 |= mask ; } } } this . nullBit1 |= mask ; this . nullBit3 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:15> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:16> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:0> ] . length ) ) { int newLength = vectorIndex + <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ newLength ] ) , <NUM_LIT:0> , oldLength ) ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } if ( ( ( mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ) & ( a1 = this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ vectorIndex ] ) & ( na2 = ~ ( a2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ vectorIndex ] ) ) & ~ ( a3 = this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ vectorIndex ] ) & ( a4 = this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] ) ) != <NUM_LIT:0> ) { this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] &= ~ mask ; } else if ( ( mask & a1 & na2 & a3 ) == <NUM_LIT:0> ) { this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; if ( ( mask & a1 ) == <NUM_LIT:0> ) { if ( ( mask & a2 & ( a3 ^ a4 ) ) != <NUM_LIT:0> ) { this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ vectorIndex ] &= ~ mask ; } else if ( ( mask & ( a2 | a3 | a4 ) ) == <NUM_LIT:0> ) { this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; } } } this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markAsComparedEqualToNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { if ( ( ( mask = <NUM_LIT:1L> << position ) & this . nullBit1 ) != <NUM_LIT:0> ) { if ( ( mask & ( ~ this . nullBit2 | this . nullBit3 | ~ this . nullBit4 ) ) != <NUM_LIT:0> ) { this . nullBit4 &= ~ mask ; } } else if ( ( mask & this . nullBit4 ) != <NUM_LIT:0> ) { this . nullBit3 &= ~ mask ; } else { if ( ( mask & this . nullBit2 ) != <NUM_LIT:0> ) { this . nullBit3 &= ~ mask ; this . nullBit4 |= mask ; } else { this . nullBit3 |= mask ; } } this . nullBit1 |= mask ; this . nullBit2 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:20> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:0> ] . length ) ) { int newLength = vectorIndex + <NUM_LIT:1> ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ newLength ] ) , <NUM_LIT:0> , oldLength ) ; } if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } if ( ( mask & this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ vectorIndex ] ) != <NUM_LIT:0> ) { if ( ( mask & ( ~ this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ vectorIndex ] | this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ vectorIndex ] | ~ this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] ) ) != <NUM_LIT:0> ) { this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] &= ~ mask ; } } else if ( ( mask & this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] ) != <NUM_LIT:0> ) { this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ vectorIndex ] &= ~ mask ; } else { if ( ( mask & this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ vectorIndex ] ) != <NUM_LIT:0> ) { this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ vectorIndex ] &= ~ mask ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; } else { this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; } } this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ vectorIndex ] |= mask ; } } } final private void markAsDefinitelyAssigned ( int position ) { if ( this != DEAD_END ) { if ( position < BitCacheSize ) { long mask ; this . definiteInits |= ( mask = <NUM_LIT:1L> << position ) ; this . potentialInits |= mask ; } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:0> ] . length ) ) { for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ vectorIndex + <NUM_LIT:1> ] ) , <NUM_LIT:0> , oldLength ) ; } } } long mask ; this . extra [ <NUM_LIT:0> ] [ vectorIndex ] |= ( mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; this . extra [ <NUM_LIT:1> ] [ vectorIndex ] |= mask ; } } } public void markAsDefinitelyAssigned ( FieldBinding field ) { if ( this != DEAD_END ) markAsDefinitelyAssigned ( field . id ) ; } public void markAsDefinitelyAssigned ( LocalVariableBinding local ) { if ( this != DEAD_END ) markAsDefinitelyAssigned ( local . id + this . maxFieldCount ) ; } public void markAsDefinitelyNonNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; long mask ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit1 |= ( mask = <NUM_LIT:1L> << position ) ; this . nullBit3 |= mask ; this . nullBit2 &= ( mask = ~ mask ) ; this . nullBit4 &= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit1 = <NUM_LIT:0> ; } } } else { int vectorIndex ; this . extra [ <NUM_LIT:2> ] [ vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ] |= ( mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; this . extra [ <NUM_LIT:4> ] [ vectorIndex ] |= mask ; this . extra [ <NUM_LIT:3> ] [ vectorIndex ] &= ( mask = ~ mask ) ; this . extra [ <NUM_LIT:5> ] [ vectorIndex ] &= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:2> ] [ vectorIndex ] = <NUM_LIT:0> ; } } } } } public void markAsDefinitelyNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; long mask ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit1 |= ( mask = <NUM_LIT:1L> << position ) ; this . nullBit2 |= mask ; this . nullBit3 &= ( mask = ~ mask ) ; this . nullBit4 &= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:24> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } else { int vectorIndex ; this . extra [ <NUM_LIT:2> ] [ vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ] |= ( mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; this . extra [ <NUM_LIT:3> ] [ vectorIndex ] |= mask ; this . extra [ <NUM_LIT:4> ] [ vectorIndex ] &= ( mask = ~ mask ) ; this . extra [ <NUM_LIT:5> ] [ vectorIndex ] &= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markAsDefinitelyUnknown ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; long mask ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit1 |= ( mask = <NUM_LIT:1L> << position ) ; this . nullBit4 |= mask ; this . nullBit2 &= ( mask = ~ mask ) ; this . nullBit3 &= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit4 = <NUM_LIT:0> ; } } } else { int vectorIndex ; this . extra [ <NUM_LIT:2> ] [ vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ] |= ( mask = <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; this . extra [ <NUM_LIT:5> ] [ vectorIndex ] |= mask ; this . extra [ <NUM_LIT:3> ] [ vectorIndex ] &= ( mask = ~ mask ) ; this . extra [ <NUM_LIT:4> ] [ vectorIndex ] &= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = <NUM_LIT:0> ; } } } } } public UnconditionalFlowInfo mergedWith ( UnconditionalFlowInfo otherInits ) { if ( ( otherInits . tagBits & UNREACHABLE ) != <NUM_LIT:0> && this != DEAD_END ) { if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } return this ; } if ( ( this . tagBits & UNREACHABLE ) != <NUM_LIT:0> ) { if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } return ( UnconditionalFlowInfo ) otherInits . copy ( ) ; } this . definiteInits &= otherInits . definiteInits ; this . potentialInits |= otherInits . potentialInits ; boolean thisHasNulls = ( this . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> , otherHasNulls = ( otherInits . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> , thisHadNulls = thisHasNulls ; long a1 , a2 , a3 , a4 , na1 , na2 , na3 , na4 , nb1 , nb2 , nb3 , nb4 , b1 , b2 , b3 , b4 ; if ( thisHadNulls ) { if ( otherHasNulls ) { this . nullBit1 = ( a2 = this . nullBit2 ) & ( a3 = this . nullBit3 ) & ( a4 = this . nullBit4 ) & ( b1 = otherInits . nullBit1 ) & ( nb2 = ~ ( b2 = otherInits . nullBit2 ) ) | ( a1 = this . nullBit1 ) & ( b1 & ( a3 & a4 & ( b3 = otherInits . nullBit3 ) & ( b4 = otherInits . nullBit4 ) | ( na2 = ~ a2 ) & nb2 & ( ( nb4 = ~ b4 ) | ( na4 = ~ a4 ) | ( na3 = ~ a3 ) & ( nb3 = ~ b3 ) ) | a2 & b2 & ( ( na4 | na3 ) & ( nb4 | nb3 ) ) ) | na2 & b2 & b3 & b4 ) ; this . nullBit2 = b2 & ( nb3 | ( nb1 = ~ b1 ) | a3 & ( a4 | ( na1 = ~ a1 ) ) & nb4 ) | a2 & ( b2 | na4 & b3 & ( b4 | nb1 ) | na3 | na1 ) ; this . nullBit3 = b3 & ( nb2 & b4 | nb1 | a3 & ( na4 & nb4 | a4 & b4 ) ) | a3 & ( na2 & a4 | na1 ) | ( a2 | na1 ) & b1 & nb2 & nb4 | a1 & na2 & na4 & ( b2 | nb1 ) ; this . nullBit4 = na3 & ( nb1 & nb3 & b4 | b1 & ( nb2 & nb3 | a4 & b2 & nb4 ) | na1 & a4 & ( nb3 | b1 & b2 ) ) | a3 & a4 & ( b3 & b4 | b1 & nb2 ) | na2 & ( nb1 & b4 | b1 & nb3 | na1 & a4 ) & nb2 | a1 & ( na3 & ( nb3 & b4 | b1 & b2 & b3 & nb4 | na2 & ( nb3 | nb2 ) ) | na2 & b3 & b4 | a2 & ( nb1 & b4 | a3 & na4 & b1 ) & nb3 ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:30> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } else { a1 = this . nullBit1 ; this . nullBit1 = <NUM_LIT:0> ; this . nullBit2 = ( a2 = this . nullBit2 ) & ( na3 = ~ ( a3 = this . nullBit3 ) | ( na1 = ~ a1 ) ) ; this . nullBit3 = a3 & ( ( na2 = ~ a2 ) & ( a4 = this . nullBit4 ) | na1 ) | a1 & na2 & ~ a4 ; this . nullBit4 = ( na3 | na2 ) & na1 & a4 | a1 & na3 & na2 ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:31> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } } } else if ( otherHasNulls ) { this . nullBit1 = <NUM_LIT:0> ; this . nullBit2 = ( b2 = otherInits . nullBit2 ) & ( nb3 = ~ ( b3 = otherInits . nullBit3 ) | ( nb1 = ~ ( b1 = otherInits . nullBit1 ) ) ) ; this . nullBit3 = b3 & ( ( nb2 = ~ b2 ) & ( b4 = otherInits . nullBit4 ) | nb1 ) | b1 & nb2 & ~ b4 ; this . nullBit4 = ( nb3 | nb2 ) & nb1 & b4 | b1 & nb3 & nb2 ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT:32> ) { this . nullBit4 = ~ <NUM_LIT:0> ; } } thisHasNulls = this . nullBit2 != <NUM_LIT:0> || this . nullBit3 != <NUM_LIT:0> || this . nullBit4 != <NUM_LIT:0> ; } if ( this . extra != null || otherInits . extra != null ) { int mergeLimit = <NUM_LIT:0> , copyLimit = <NUM_LIT:0> , resetLimit = <NUM_LIT:0> ; int i ; if ( this . extra != null ) { if ( otherInits . extra != null ) { int length , otherLength ; if ( ( length = this . extra [ <NUM_LIT:0> ] . length ) < ( otherLength = otherInits . extra [ <NUM_LIT:0> ] . length ) ) { for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ otherLength ] ) , <NUM_LIT:0> , length ) ; } mergeLimit = length ; copyLimit = otherLength ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } else { mergeLimit = otherLength ; resetLimit = length ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } else { resetLimit = this . extra [ <NUM_LIT:0> ] . length ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } } else if ( otherInits . extra != null ) { int otherLength = otherInits . extra [ <NUM_LIT:0> ] . length ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ otherLength ] ; } System . arraycopy ( otherInits . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , this . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , otherLength ) ; copyLimit = otherLength ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { throw new AssertionFailedException ( "<STR_LIT>" ) ; } } } for ( i = <NUM_LIT:0> ; i < mergeLimit ; i ++ ) { this . extra [ <NUM_LIT:0> ] [ i ] &= otherInits . extra [ <NUM_LIT:0> ] [ i ] ; this . extra [ <NUM_LIT:1> ] [ i ] |= otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } for ( ; i < copyLimit ; i ++ ) { this . extra [ <NUM_LIT:1> ] [ i ] = otherInits . extra [ <NUM_LIT:1> ] [ i ] ; } for ( ; i < resetLimit ; i ++ ) { this . extra [ <NUM_LIT:0> ] [ i ] = <NUM_LIT:0> ; } if ( ! otherHasNulls ) { if ( resetLimit < mergeLimit ) { resetLimit = mergeLimit ; } copyLimit = <NUM_LIT:0> ; mergeLimit = <NUM_LIT:0> ; } if ( ! thisHadNulls ) { resetLimit = <NUM_LIT:0> ; } for ( i = <NUM_LIT:0> ; i < mergeLimit ; i ++ ) { this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] = ( a2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) & ( a3 = this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) & ( a4 = this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) & ( b1 = otherInits . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( nb2 = ~ ( b2 = otherInits . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) ) | ( a1 = this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( b1 & ( a3 & a4 & ( b3 = otherInits . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) & ( b4 = otherInits . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) | ( na2 = ~ a2 ) & nb2 & ( ( nb4 = ~ b4 ) | ( na4 = ~ a4 ) | ( na3 = ~ a3 ) & ( nb3 = ~ b3 ) ) | a2 & b2 & ( ( na4 | na3 ) & ( nb4 | nb3 ) ) ) | na2 & b2 & b3 & b4 ) ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = b2 & ( nb3 | ( nb1 = ~ b1 ) | a3 & ( a4 | ( na1 = ~ a1 ) ) & nb4 ) | a2 & ( b2 | na4 & b3 & ( b4 | nb1 ) | na3 | na1 ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = b3 & ( nb2 & b4 | nb1 | a3 & ( na4 & nb4 | a4 & b4 ) ) | a3 & ( na2 & a4 | na1 ) | ( a2 | na1 ) & b1 & nb2 & nb4 | a1 & na2 & na4 & ( b2 | nb1 ) ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = na3 & ( nb1 & nb3 & b4 | b1 & ( nb2 & nb3 | a4 & b2 & nb4 ) | na1 & a4 & ( nb3 | b1 & b2 ) ) | a3 & a4 & ( b3 & b4 | b1 & nb2 ) | na2 & ( nb1 & b4 | b1 & nb3 | na1 & a4 ) & nb2 | a1 & ( na3 & ( nb3 & b4 | b1 & b2 & b3 & nb4 | na2 & ( nb3 | nb2 ) ) | na2 & b3 & b4 | a2 & ( nb1 & b4 | a3 & na4 & b1 ) & nb3 ) ; thisHasNulls = thisHasNulls || this . extra [ <NUM_LIT:3> ] [ i ] != <NUM_LIT:0> || this . extra [ <NUM_LIT:4> ] [ i ] != <NUM_LIT:0> || this . extra [ <NUM_LIT:5> ] [ i ] != <NUM_LIT:0> ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ i ] = ~ <NUM_LIT:0> ; } } } for ( ; i < copyLimit ; i ++ ) { this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] = <NUM_LIT:0> ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = ( b2 = otherInits . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) & ( nb3 = ~ ( b3 = otherInits . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) | ( nb1 = ~ ( b1 = otherInits . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) ) ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = b3 & ( ( nb2 = ~ b2 ) & ( b4 = otherInits . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) | nb1 ) | b1 & nb2 & ~ b4 ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = ( nb3 | nb2 ) & nb1 & b4 | b1 & nb3 & nb2 ; thisHasNulls = thisHasNulls || this . extra [ <NUM_LIT:3> ] [ i ] != <NUM_LIT:0> || this . extra [ <NUM_LIT:4> ] [ i ] != <NUM_LIT:0> || this . extra [ <NUM_LIT:5> ] [ i ] != <NUM_LIT:0> ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ i ] = ~ <NUM_LIT:0> ; } } } for ( ; i < resetLimit ; i ++ ) { a1 = this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ; this . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] = <NUM_LIT:0> ; this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = ( a2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) & ( na3 = ~ ( a3 = this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) | ( na1 = ~ a1 ) ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = a3 & ( ( na2 = ~ a2 ) & ( a4 = this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) | na1 ) | a1 & na2 & ~ a4 ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = ( na3 | na2 ) & na1 & a4 | a1 & na3 & na2 ; thisHasNulls = thisHasNulls || this . extra [ <NUM_LIT:3> ] [ i ] != <NUM_LIT:0> || this . extra [ <NUM_LIT:4> ] [ i ] != <NUM_LIT:0> || this . extra [ <NUM_LIT:5> ] [ i ] != <NUM_LIT:0> ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ i ] = ~ <NUM_LIT:0> ; } } } } combineNullStatusChangeInAssertInfo ( otherInits ) ; if ( thisHasNulls ) { this . tagBits |= NULL_FLAG_MASK ; } else { this . tagBits &= ~ NULL_FLAG_MASK ; } return this ; } static int numberOfEnclosingFields ( ReferenceBinding type ) { int count = <NUM_LIT:0> ; type = type . enclosingType ( ) ; while ( type != null ) { count += type . fieldCount ( ) ; type = type . enclosingType ( ) ; } return count ; } public UnconditionalFlowInfo nullInfoLessUnconditionalCopy ( ) { if ( this == DEAD_END ) { return this ; } UnconditionalFlowInfo copy = new UnconditionalFlowInfo ( ) ; copy . definiteInits = this . definiteInits ; copy . potentialInits = this . potentialInits ; copy . tagBits = this . tagBits & ~ NULL_FLAG_MASK ; copy . maxFieldCount = this . maxFieldCount ; if ( this . extra != null ) { int length ; copy . extra = new long [ extraLength ] [ ] ; System . arraycopy ( this . extra [ <NUM_LIT:0> ] , <NUM_LIT:0> , ( copy . extra [ <NUM_LIT:0> ] = new long [ length = this . extra [ <NUM_LIT:0> ] . length ] ) , <NUM_LIT:0> , length ) ; System . arraycopy ( this . extra [ <NUM_LIT:1> ] , <NUM_LIT:0> , ( copy . extra [ <NUM_LIT:1> ] = new long [ length ] ) , <NUM_LIT:0> , length ) ; for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { copy . extra [ j ] = new long [ length ] ; } } return copy ; } public FlowInfo safeInitsWhenTrue ( ) { return copy ( ) ; } public FlowInfo setReachMode ( int reachMode ) { if ( this == DEAD_END ) { return this ; } if ( reachMode == REACHABLE ) { this . tagBits &= ~ UNREACHABLE ; } else { if ( ( this . tagBits & UNREACHABLE ) == <NUM_LIT:0> ) { this . potentialInits = <NUM_LIT:0> ; if ( this . extra != null ) { for ( int i = <NUM_LIT:0> , length = this . extra [ <NUM_LIT:0> ] . length ; i < length ; i ++ ) { this . extra [ <NUM_LIT:1> ] [ i ] = <NUM_LIT:0> ; } } } this . tagBits |= UNREACHABLE ; } return this ; } public String toString ( ) { if ( this == DEAD_END ) { return "<STR_LIT>" ; } if ( ( this . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> ) { if ( this . extra == null ) { return "<STR_LIT>" + this . definiteInits + "<STR_LIT>" + this . potentialInits + "<STR_LIT>" + ( ( this . tagBits & UNREACHABLE ) == <NUM_LIT:0> ) + "<STR_LIT>" + this . nullBit1 + this . nullBit2 + this . nullBit3 + this . nullBit4 + "<STR_LIT:>>" ; } else { String def = "<STR_LIT>" + this . definiteInits , pot = "<STR_LIT>" + this . potentialInits , nullS = "<STR_LIT>" + this . nullBit1 + this . nullBit2 + this . nullBit3 + this . nullBit4 ; int i , ceil ; for ( i = <NUM_LIT:0> , ceil = this . extra [ <NUM_LIT:0> ] . length > <NUM_LIT:3> ? <NUM_LIT:3> : this . extra [ <NUM_LIT:0> ] . length ; i < ceil ; i ++ ) { def += "<STR_LIT:U+002C>" + this . extra [ <NUM_LIT:0> ] [ i ] ; pot += "<STR_LIT:U+002C>" + this . extra [ <NUM_LIT:1> ] [ i ] ; nullS += "<STR_LIT:U+002C>" + this . extra [ <NUM_LIT:2> ] [ i ] + this . extra [ <NUM_LIT:3> ] [ i ] + this . extra [ <NUM_LIT:4> ] [ i ] + this . extra [ <NUM_LIT:5> ] [ i ] ; } if ( ceil < this . extra [ <NUM_LIT:0> ] . length ) { def += "<STR_LIT>" ; pot += "<STR_LIT>" ; nullS += "<STR_LIT>" ; } return def + pot + "<STR_LIT>" + ( ( this . tagBits & UNREACHABLE ) == <NUM_LIT:0> ) + nullS + "<STR_LIT>" ; } } else { if ( this . extra == null ) { return "<STR_LIT>" + this . definiteInits + "<STR_LIT>" + this . potentialInits + "<STR_LIT>" + ( ( this . tagBits & UNREACHABLE ) == <NUM_LIT:0> ) + "<STR_LIT>" ; } else { String def = "<STR_LIT>" + this . definiteInits , pot = "<STR_LIT>" + this . potentialInits ; int i , ceil ; for ( i = <NUM_LIT:0> , ceil = this . extra [ <NUM_LIT:0> ] . length > <NUM_LIT:3> ? <NUM_LIT:3> : this . extra [ <NUM_LIT:0> ] . length ; i < ceil ; i ++ ) { def += "<STR_LIT:U+002C>" + this . extra [ <NUM_LIT:0> ] [ i ] ; pot += "<STR_LIT:U+002C>" + this . extra [ <NUM_LIT:1> ] [ i ] ; } if ( ceil < this . extra [ <NUM_LIT:0> ] . length ) { def += "<STR_LIT>" ; pot += "<STR_LIT>" ; } return def + pot + "<STR_LIT>" + ( ( this . tagBits & UNREACHABLE ) == <NUM_LIT:0> ) + "<STR_LIT>" ; } } } public UnconditionalFlowInfo unconditionalCopy ( ) { return ( UnconditionalFlowInfo ) copy ( ) ; } public UnconditionalFlowInfo unconditionalFieldLessCopy ( ) { UnconditionalFlowInfo copy = new UnconditionalFlowInfo ( ) ; copy . tagBits = this . tagBits ; copy . maxFieldCount = this . maxFieldCount ; int limit = this . maxFieldCount ; if ( limit < BitCacheSize ) { long mask ; copy . definiteInits = this . definiteInits & ( mask = ~ ( ( <NUM_LIT:1L> << limit ) - <NUM_LIT:1> ) ) ; copy . potentialInits = this . potentialInits & mask ; copy . nullBit1 = this . nullBit1 & mask ; copy . nullBit2 = this . nullBit2 & mask ; copy . nullBit3 = this . nullBit3 & mask ; copy . nullBit4 = this . nullBit4 & mask ; } copy . nullStatusChangedInAssert = this . nullStatusChangedInAssert ; if ( this . extra == null ) { return copy ; } int vectorIndex , length , copyStart ; if ( ( vectorIndex = ( limit / BitCacheSize ) - <NUM_LIT:1> ) >= ( length = this . extra [ <NUM_LIT:0> ] . length ) ) { return copy ; } long mask ; copy . extra = new long [ extraLength ] [ ] ; if ( ( copyStart = vectorIndex + <NUM_LIT:1> ) < length ) { int copyLength = length - copyStart ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , copyStart , ( copy . extra [ j ] = new long [ length ] ) , copyStart , copyLength ) ; } } else if ( vectorIndex >= <NUM_LIT:0> ) { for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { copy . extra [ j ] = new long [ length ] ; } } if ( vectorIndex >= <NUM_LIT:0> ) { mask = ~ ( ( <NUM_LIT:1L> << ( limit % BitCacheSize ) ) - <NUM_LIT:1> ) ; for ( int j = <NUM_LIT:0> ; j < extraLength ; j ++ ) { copy . extra [ j ] [ vectorIndex ] = this . extra [ j ] [ vectorIndex ] & mask ; } } return copy ; } public UnconditionalFlowInfo unconditionalInits ( ) { return this ; } public UnconditionalFlowInfo unconditionalInitsWithoutSideEffect ( ) { return this ; } public void markedAsNullOrNonNullInAssertExpression ( LocalVariableBinding local ) { int position = local . id + this . maxFieldCount ; int oldLength ; if ( this . nullStatusChangedInAssert == null ) { this . nullStatusChangedInAssert = new int [ position + <NUM_LIT:1> ] ; } else { if ( position >= ( oldLength = this . nullStatusChangedInAssert . length ) ) { System . arraycopy ( this . nullStatusChangedInAssert , <NUM_LIT:0> , ( this . nullStatusChangedInAssert = new int [ position + <NUM_LIT:1> ] ) , <NUM_LIT:0> , oldLength ) ; } } this . nullStatusChangedInAssert [ position ] = <NUM_LIT:1> ; } public boolean isMarkedAsNullOrNonNullInAssertExpression ( LocalVariableBinding local ) { int position = local . id + this . maxFieldCount ; if ( this . nullStatusChangedInAssert == null || position >= this . nullStatusChangedInAssert . length ) { return false ; } if ( this . nullStatusChangedInAssert [ position ] == <NUM_LIT:1> ) { return true ; } return false ; } private void combineNullStatusChangeInAssertInfo ( UnconditionalFlowInfo otherInits ) { if ( this . nullStatusChangedInAssert != null || otherInits . nullStatusChangedInAssert != null ) { int mergedLength , length ; if ( this . nullStatusChangedInAssert != null ) { if ( otherInits . nullStatusChangedInAssert != null ) { if ( otherInits . nullStatusChangedInAssert . length > this . nullStatusChangedInAssert . length ) { mergedLength = otherInits . nullStatusChangedInAssert . length ; length = this . nullStatusChangedInAssert . length ; System . arraycopy ( this . nullStatusChangedInAssert , <NUM_LIT:0> , ( this . nullStatusChangedInAssert = new int [ mergedLength ] ) , <NUM_LIT:0> , length ) ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . nullStatusChangedInAssert [ i ] |= otherInits . nullStatusChangedInAssert [ i ] ; } System . arraycopy ( otherInits . nullStatusChangedInAssert , length , this . nullStatusChangedInAssert , length , mergedLength - length ) ; } else { for ( int i = <NUM_LIT:0> ; i < otherInits . nullStatusChangedInAssert . length ; i ++ ) { this . nullStatusChangedInAssert [ i ] |= otherInits . nullStatusChangedInAssert [ i ] ; } } } } else if ( otherInits . nullStatusChangedInAssert != null ) { this . nullStatusChangedInAssert = otherInits . nullStatusChangedInAssert ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import java . util . ArrayList ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . SubRoutineStatement ; import org . eclipse . jdt . internal . compiler . ast . TryStatement ; import org . eclipse . jdt . internal . compiler . codegen . ObjectCache ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; 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 . TypeIds ; public class ExceptionHandlingFlowContext extends FlowContext { public final static int BitCacheSize = <NUM_LIT:32> ; public ReferenceBinding [ ] handledExceptions ; int [ ] isReached ; int [ ] isNeeded ; UnconditionalFlowInfo [ ] initsOnExceptions ; ObjectCache indexes = new ObjectCache ( ) ; boolean isMethodContext ; public UnconditionalFlowInfo initsOnReturn ; public FlowContext initializationParent ; public ArrayList extendedExceptions ; public ExceptionHandlingFlowContext ( FlowContext parent , ASTNode associatedNode , ReferenceBinding [ ] handledExceptions , FlowContext initializationParent , BlockScope scope , UnconditionalFlowInfo flowInfo ) { super ( parent , associatedNode ) ; this . isMethodContext = scope == scope . methodScope ( ) ; this . handledExceptions = handledExceptions ; int count = handledExceptions . length , cacheSize = ( count / ExceptionHandlingFlowContext . BitCacheSize ) + <NUM_LIT:1> ; this . isReached = new int [ cacheSize ] ; this . isNeeded = new int [ cacheSize ] ; this . initsOnExceptions = new UnconditionalFlowInfo [ count ] ; boolean markExceptionsAndThrowableAsReached = ! this . isMethodContext || scope . compilerOptions ( ) . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ; for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { ReferenceBinding handledException = handledExceptions [ i ] ; this . indexes . put ( handledException , i ) ; if ( handledException . isUncheckedException ( true ) ) { if ( markExceptionsAndThrowableAsReached || handledException . id != TypeIds . T_JavaLangThrowable && handledException . id != TypeIds . T_JavaLangException ) { this . isReached [ i / ExceptionHandlingFlowContext . BitCacheSize ] |= <NUM_LIT:1> << ( i % ExceptionHandlingFlowContext . BitCacheSize ) ; } this . initsOnExceptions [ i ] = flowInfo . unconditionalCopy ( ) ; } else { this . initsOnExceptions [ i ] = FlowInfo . DEAD_END ; } } if ( ! this . isMethodContext ) { System . arraycopy ( this . isReached , <NUM_LIT:0> , this . isNeeded , <NUM_LIT:0> , cacheSize ) ; } this . initsOnReturn = FlowInfo . DEAD_END ; this . initializationParent = initializationParent ; } public void complainIfUnusedExceptionHandlers ( AbstractMethodDeclaration method ) { MethodScope scope = method . scope ; if ( ( method . binding . modifiers & ( ExtraCompilerModifiers . AccOverriding | ExtraCompilerModifiers . AccImplementing ) ) != <NUM_LIT:0> && ! scope . compilerOptions ( ) . reportUnusedDeclaredThrownExceptionWhenOverriding ) { return ; } TypeBinding [ ] docCommentReferences = null ; int docCommentReferencesLength = <NUM_LIT:0> ; if ( scope . compilerOptions ( ) . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference && method . javadoc != null && method . javadoc . exceptionReferences != null && ( docCommentReferencesLength = method . javadoc . exceptionReferences . length ) > <NUM_LIT:0> ) { docCommentReferences = new TypeBinding [ docCommentReferencesLength ] ; for ( int i = <NUM_LIT:0> ; i < docCommentReferencesLength ; i ++ ) { docCommentReferences [ i ] = method . javadoc . exceptionReferences [ i ] . resolvedType ; } } nextHandledException : for ( int i = <NUM_LIT:0> , count = this . handledExceptions . length ; i < count ; i ++ ) { int index = this . indexes . get ( this . handledExceptions [ i ] ) ; if ( ( this . isReached [ index / ExceptionHandlingFlowContext . BitCacheSize ] & <NUM_LIT:1> << ( index % ExceptionHandlingFlowContext . BitCacheSize ) ) == <NUM_LIT:0> ) { for ( int j = <NUM_LIT:0> ; j < docCommentReferencesLength ; j ++ ) { if ( docCommentReferences [ j ] == this . handledExceptions [ i ] ) { continue nextHandledException ; } } scope . problemReporter ( ) . unusedDeclaredThrownException ( this . handledExceptions [ index ] , method , method . thrownExceptions [ index ] ) ; } } } public void complainIfUnusedExceptionHandlers ( BlockScope scope , TryStatement tryStatement ) { for ( int i = <NUM_LIT:0> , count = this . handledExceptions . length ; i < count ; i ++ ) { int index = this . indexes . get ( this . handledExceptions [ i ] ) ; int cacheIndex = index / ExceptionHandlingFlowContext . BitCacheSize ; int bitMask = <NUM_LIT:1> << ( index % ExceptionHandlingFlowContext . BitCacheSize ) ; if ( ( this . isReached [ cacheIndex ] & bitMask ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . unreachableCatchBlock ( this . handledExceptions [ index ] , tryStatement . catchArguments [ index ] . type ) ; } else { if ( ( this . isNeeded [ cacheIndex ] & bitMask ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . hiddenCatchBlock ( this . handledExceptions [ index ] , tryStatement . catchArguments [ index ] . type ) ; } } } } public String individualToString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; int length = this . handledExceptions . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { int cacheIndex = i / ExceptionHandlingFlowContext . BitCacheSize ; int bitMask = <NUM_LIT:1> << ( i % ExceptionHandlingFlowContext . BitCacheSize ) ; buffer . append ( '<CHAR_LIT:[>' ) . append ( this . handledExceptions [ i ] . readableName ( ) ) ; if ( ( this . isReached [ cacheIndex ] & bitMask ) != <NUM_LIT:0> ) { if ( ( this . isNeeded [ cacheIndex ] & bitMask ) == <NUM_LIT:0> ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( "<STR_LIT>" ) ; } } else { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( '<CHAR_LIT:->' ) . append ( this . initsOnExceptions [ i ] . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; } buffer . append ( "<STR_LIT>" ) . append ( this . initsOnReturn . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } public UnconditionalFlowInfo initsOnException ( ReferenceBinding exceptionType ) { int index ; if ( ( index = this . indexes . get ( exceptionType ) ) < <NUM_LIT:0> ) { return FlowInfo . DEAD_END ; } return this . initsOnExceptions [ index ] ; } public UnconditionalFlowInfo initsOnReturn ( ) { return this . initsOnReturn ; } public void mergeUnhandledException ( TypeBinding newException ) { if ( this . extendedExceptions == null ) { this . extendedExceptions = new ArrayList ( <NUM_LIT:5> ) ; for ( int i = <NUM_LIT:0> ; i < this . handledExceptions . length ; i ++ ) { this . extendedExceptions . add ( this . handledExceptions [ i ] ) ; } } boolean isRedundant = false ; for ( int i = this . extendedExceptions . size ( ) - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { switch ( Scope . compareTypes ( newException , ( TypeBinding ) this . extendedExceptions . get ( i ) ) ) { case Scope . MORE_GENERIC : this . extendedExceptions . remove ( i ) ; break ; case Scope . EQUAL_OR_MORE_SPECIFIC : isRedundant = true ; break ; case Scope . NOT_RELATED : break ; } } if ( ! isRedundant ) { this . extendedExceptions . add ( newException ) ; } } public void recordHandlingException ( ReferenceBinding exceptionType , UnconditionalFlowInfo flowInfo , TypeBinding raisedException , ASTNode invocationSite , boolean wasAlreadyDefinitelyCaught ) { int index = this . indexes . get ( exceptionType ) ; int cacheIndex = index / ExceptionHandlingFlowContext . BitCacheSize ; int bitMask = <NUM_LIT:1> << ( index % ExceptionHandlingFlowContext . BitCacheSize ) ; if ( ! wasAlreadyDefinitelyCaught ) { this . isNeeded [ cacheIndex ] |= bitMask ; } this . isReached [ cacheIndex ] |= bitMask ; this . initsOnExceptions [ index ] = ( this . initsOnExceptions [ index ] . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ? this . initsOnExceptions [ index ] . mergedWith ( flowInfo ) : flowInfo . unconditionalCopy ( ) ; } public void recordReturnFrom ( UnconditionalFlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { if ( ( this . initsOnReturn . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { this . initsOnReturn = this . initsOnReturn . mergedWith ( flowInfo ) ; } else { this . initsOnReturn = ( UnconditionalFlowInfo ) flowInfo . copy ( ) ; } } } public SubRoutineStatement subroutine ( ) { if ( this . associatedNode instanceof SubRoutineStatement ) { if ( this . parent . subroutine ( ) == this . associatedNode ) return null ; return ( SubRoutineStatement ) this . associatedNode ; } return null ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . Reference ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . VariableBinding ; public class FinallyFlowContext extends FlowContext { Reference [ ] finalAssignments ; VariableBinding [ ] finalVariables ; int assignCount ; LocalVariableBinding [ ] nullLocals ; Expression [ ] nullReferences ; int [ ] nullCheckTypes ; int nullCount ; public FinallyFlowContext ( FlowContext parent , ASTNode associatedNode ) { super ( parent , associatedNode ) ; } public void complainOnDeferredChecks ( FlowInfo flowInfo , BlockScope scope ) { for ( int i = <NUM_LIT:0> ; i < this . assignCount ; i ++ ) { VariableBinding variable = this . finalVariables [ i ] ; if ( variable == null ) continue ; boolean complained = false ; if ( variable instanceof FieldBinding ) { if ( flowInfo . isPotentiallyAssigned ( ( FieldBinding ) variable ) ) { complained = true ; scope . problemReporter ( ) . duplicateInitializationOfBlankFinalField ( ( FieldBinding ) variable , this . finalAssignments [ i ] ) ; } } else { if ( flowInfo . isPotentiallyAssigned ( ( LocalVariableBinding ) variable ) ) { complained = true ; scope . problemReporter ( ) . duplicateInitializationOfFinalLocal ( ( LocalVariableBinding ) variable , this . finalAssignments [ i ] ) ; } } if ( complained ) { FlowContext currentContext = this . parent ; while ( currentContext != null ) { currentContext . removeFinalAssignmentIfAny ( this . finalAssignments [ i ] ) ; currentContext = currentContext . parent ; } } } if ( ( this . tagBits & FlowContext . DEFER_NULL_DIAGNOSTIC ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . nullCount ; i ++ ) { this . parent . recordUsingNullReference ( scope , this . nullLocals [ i ] , this . nullReferences [ i ] , this . nullCheckTypes [ i ] , flowInfo ) ; } } else { for ( int i = <NUM_LIT:0> ; i < this . nullCount ; i ++ ) { Expression expression = this . nullReferences [ i ] ; LocalVariableBinding local = this . nullLocals [ i ] ; switch ( this . nullCheckTypes [ i ] ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( this . nullCheckTypes [ i ] == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , expression ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , expression ) ; } } continue ; } case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , expression ) ; } continue ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , expression ) ; } continue ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , expression ) ; continue ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , expression ) ; continue ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : this . nullReferences [ i ] = null ; if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : this . nullReferences [ i ] = null ; if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; } } break ; case MAY_NULL : if ( flowInfo . isDefinitelyNull ( local ) ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; } break ; default : } } } } public String individualToString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) . append ( this . assignCount ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) . append ( this . nullCount ) . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } public boolean isSubRoutine ( ) { return true ; } protected boolean recordFinalAssignment ( VariableBinding binding , Reference finalAssignment ) { if ( this . assignCount == <NUM_LIT:0> ) { this . finalAssignments = new Reference [ <NUM_LIT:5> ] ; this . finalVariables = new VariableBinding [ <NUM_LIT:5> ] ; } else { if ( this . assignCount == this . finalAssignments . length ) System . arraycopy ( this . finalAssignments , <NUM_LIT:0> , ( this . finalAssignments = new Reference [ this . assignCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . assignCount ) ; System . arraycopy ( this . finalVariables , <NUM_LIT:0> , ( this . finalVariables = new VariableBinding [ this . assignCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . assignCount ) ; } this . finalAssignments [ this . assignCount ] = finalAssignment ; this . finalVariables [ this . assignCount ++ ] = binding ; return true ; } public void recordUsingNullReference ( Scope scope , LocalVariableBinding local , Expression reference , int checkType , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> && ! flowInfo . isDefinitelyUnknown ( local ) ) { if ( ( this . tagBits & FlowContext . DEFER_NULL_DIAGNOSTIC ) != <NUM_LIT:0> ) { switch ( checkType ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . cannotBeNull ( local ) ) { if ( checkType == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } else if ( checkType == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } return ; } if ( flowInfo . canOnlyBeNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , reference ) ; return ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , reference ) ; return ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; } } break ; case MAY_NULL : if ( flowInfo . cannotBeNull ( local ) ) { return ; } if ( flowInfo . canOnlyBeNull ( local ) ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } break ; default : } } else { switch ( checkType ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( checkType == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } return ; } case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , reference ) ; return ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , reference ) ; return ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; } } break ; case MAY_NULL : if ( flowInfo . isDefinitelyNull ( local ) ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } if ( flowInfo . isDefinitelyNonNull ( local ) ) { return ; } break ; default : } } if ( ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) || checkType == MAY_NULL || ( checkType & CONTEXT_MASK ) == FlowContext . IN_ASSIGNMENT || ( checkType & CONTEXT_MASK ) == FlowContext . IN_INSTANCEOF ) { recordNullReference ( local , reference , checkType ) ; } } } void removeFinalAssignmentIfAny ( Reference reference ) { for ( int i = <NUM_LIT:0> ; i < this . assignCount ; i ++ ) { if ( this . finalAssignments [ i ] == reference ) { this . finalAssignments [ i ] = null ; this . finalVariables [ i ] = null ; return ; } } } protected void recordNullReference ( LocalVariableBinding local , Expression expression , int status ) { if ( this . nullCount == <NUM_LIT:0> ) { this . nullLocals = new LocalVariableBinding [ <NUM_LIT:5> ] ; this . nullReferences = new Expression [ <NUM_LIT:5> ] ; this . nullCheckTypes = new int [ <NUM_LIT:5> ] ; } else if ( this . nullCount == this . nullLocals . length ) { int newLength = this . nullCount * <NUM_LIT:2> ; System . arraycopy ( this . nullLocals , <NUM_LIT:0> , this . nullLocals = new LocalVariableBinding [ newLength ] , <NUM_LIT:0> , this . nullCount ) ; System . arraycopy ( this . nullReferences , <NUM_LIT:0> , this . nullReferences = new Expression [ newLength ] , <NUM_LIT:0> , this . nullCount ) ; System . arraycopy ( this . nullCheckTypes , <NUM_LIT:0> , this . nullCheckTypes = new int [ newLength ] , <NUM_LIT:0> , this . nullCount ) ; } this . nullLocals [ this . nullCount ] = local ; this . nullReferences [ this . nullCount ] = expression ; this . nullCheckTypes [ this . nullCount ++ ] = status ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . SubRoutineStatement ; public class InsideSubRoutineFlowContext extends FlowContext { public UnconditionalFlowInfo initsOnReturn ; public InsideSubRoutineFlowContext ( FlowContext parent , ASTNode associatedNode ) { super ( parent , associatedNode ) ; this . initsOnReturn = FlowInfo . DEAD_END ; } public String individualToString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) . append ( this . initsOnReturn . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } public UnconditionalFlowInfo initsOnReturn ( ) { return this . initsOnReturn ; } public boolean isNonReturningContext ( ) { return ( ( SubRoutineStatement ) this . associatedNode ) . isSubRoutineEscaping ( ) ; } public void recordReturnFrom ( UnconditionalFlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { if ( this . initsOnReturn == FlowInfo . DEAD_END ) { this . initsOnReturn = ( UnconditionalFlowInfo ) flowInfo . copy ( ) ; } else { this . initsOnReturn = this . initsOnReturn . mergedWith ( flowInfo ) ; } } } public SubRoutineStatement subroutine ( ) { return ( SubRoutineStatement ) this . associatedNode ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public class NullInfoRegistry extends UnconditionalFlowInfo { public NullInfoRegistry ( UnconditionalFlowInfo upstream ) { this . maxFieldCount = upstream . maxFieldCount ; if ( ( upstream . tagBits & NULL_FLAG_MASK ) != <NUM_LIT:0> ) { long u1 , u2 , u3 , u4 , nu2 , nu3 , nu4 ; this . nullBit2 = ( u1 = upstream . nullBit1 ) & ( u2 = upstream . nullBit2 ) & ( nu3 = ~ ( u3 = upstream . nullBit3 ) ) & ( nu4 = ~ ( u4 = upstream . nullBit4 ) ) ; this . nullBit3 = u1 & ( nu2 = ~ u2 ) & u3 & nu4 ; this . nullBit4 = u1 & nu2 & nu3 & u4 ; if ( ( this . nullBit2 | this . nullBit3 | this . nullBit4 ) != <NUM_LIT:0> ) { this . tagBits |= NULL_FLAG_MASK ; } if ( upstream . extra != null ) { this . extra = new long [ extraLength ] [ ] ; int length = upstream . extra [ <NUM_LIT:2> ] . length ; for ( int i = <NUM_LIT:2> ; i < extraLength ; i ++ ) { this . extra [ i ] = new long [ length ] ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] = ( u1 = upstream . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( u2 = upstream . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) & ( nu3 = ~ ( u3 = upstream . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) ) & ( nu4 = ~ ( u4 = upstream . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) ) ; this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] = u1 & ( nu2 = ~ u2 ) & u3 & nu4 ; this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] = u1 & nu2 & nu3 & u4 ; if ( ( this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] | this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] | this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) != <NUM_LIT:0> ) { this . tagBits |= NULL_FLAG_MASK ; } } } } } public NullInfoRegistry add ( NullInfoRegistry other ) { if ( ( other . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> ) { return this ; } this . tagBits |= NULL_FLAG_MASK ; this . nullBit1 |= other . nullBit1 ; this . nullBit2 |= other . nullBit2 ; this . nullBit3 |= other . nullBit3 ; this . nullBit4 |= other . nullBit4 ; if ( other . extra != null ) { if ( this . extra == null ) { this . extra = new long [ extraLength ] [ ] ; for ( int i = <NUM_LIT:2> , length = other . extra [ <NUM_LIT:2> ] . length ; i < extraLength ; i ++ ) { System . arraycopy ( other . extra [ i ] , <NUM_LIT:0> , ( this . extra [ i ] = new long [ length ] ) , <NUM_LIT:0> , length ) ; } } else { int length = this . extra [ <NUM_LIT:2> ] . length , otherLength = other . extra [ <NUM_LIT:2> ] . length ; if ( otherLength > length ) { for ( int i = <NUM_LIT:2> ; i < extraLength ; i ++ ) { System . arraycopy ( this . extra [ i ] , <NUM_LIT:0> , ( this . extra [ i ] = new long [ otherLength ] ) , <NUM_LIT:0> , length ) ; System . arraycopy ( other . extra [ i ] , length , this . extra [ i ] , length , otherLength - length ) ; } } else if ( otherLength < length ) { length = otherLength ; } for ( int i = <NUM_LIT:2> ; i < extraLength ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < length ; j ++ ) { this . extra [ i ] [ j ] |= other . extra [ i ] [ j ] ; } } } } return this ; } public void markAsComparedEqualToNonNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit1 |= ( <NUM_LIT:1L> << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit1 = <NUM_LIT:0> ; } } } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:2> ] . length ) ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ vectorIndex + <NUM_LIT:1> ] ) , <NUM_LIT:0> , oldLength ) ; } } } this . extra [ <NUM_LIT:2> ] [ vectorIndex ] |= ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markAsDefinitelyNonNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit3 |= ( <NUM_LIT:1L> << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit1 = <NUM_LIT:0> ; } } } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:2> ] . length ) ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ vectorIndex + <NUM_LIT:1> ] ) , <NUM_LIT:0> , oldLength ) ; } } } this . extra [ <NUM_LIT:4> ] [ vectorIndex ] |= ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markAsDefinitelyNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit2 |= ( <NUM_LIT:1L> << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit1 = <NUM_LIT:0> ; } } } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:2> ] . length ) ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ vectorIndex + <NUM_LIT:1> ] ) , <NUM_LIT:0> , oldLength ) ; } } } this . extra [ <NUM_LIT:3> ] [ vectorIndex ] |= ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public void markAsDefinitelyUnknown ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit4 |= ( <NUM_LIT:1L> << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . nullBit1 = <NUM_LIT:0> ; } } } else { int vectorIndex = ( position / BitCacheSize ) - <NUM_LIT:1> ; if ( this . extra == null ) { int length = vectorIndex + <NUM_LIT:1> ; this . extra = new long [ extraLength ] [ ] ; for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ <NUM_LIT:2> ] . length ) ) { for ( int j = <NUM_LIT:2> ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , <NUM_LIT:0> , ( this . extra [ j ] = new long [ vectorIndex + <NUM_LIT:1> ] ) , <NUM_LIT:0> , oldLength ) ; } } } this . extra [ <NUM_LIT:5> ] [ vectorIndex ] |= ( <NUM_LIT:1L> << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == <NUM_LIT> ) { this . extra [ <NUM_LIT:5> ] [ vectorIndex ] = ~ <NUM_LIT:0> ; } } } } } public UnconditionalFlowInfo mitigateNullInfoOf ( FlowInfo flowInfo ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == <NUM_LIT:0> ) { return flowInfo . unconditionalInits ( ) ; } long m , m1 , nm1 , m2 , nm2 , m3 , a2 , a3 , a4 , s1 , s2 , ns2 , s3 , ns3 , s4 , ns4 ; boolean newCopy = false ; UnconditionalFlowInfo source = flowInfo . unconditionalInits ( ) ; m1 = ( s1 = source . nullBit1 ) & ( s3 = source . nullBit3 ) & ( s4 = source . nullBit4 ) & ( ( a2 = this . nullBit2 ) | ( a4 = this . nullBit4 ) ) ; m2 = s1 & ( s2 = this . nullBit2 ) & ( s3 ^ s4 ) & ( ( a3 = this . nullBit3 ) | a4 ) ; m3 = s1 & ( s2 & ( ns3 = ~ s3 ) & ( ns4 = ~ s4 ) & ( a3 | a4 ) | ( ns2 = ~ s2 ) & s3 & ns4 & ( a2 | a4 ) | ns2 & ns3 & s4 & ( a2 | a3 ) ) ; if ( ( m = ( m1 | m2 | m3 ) ) != <NUM_LIT:0> ) { newCopy = true ; source = source . unconditionalCopy ( ) ; source . nullBit1 &= ~ m ; source . nullBit2 &= ( nm1 = ~ m1 ) & ( ( nm2 = ~ m2 ) | a4 ) ; source . nullBit3 &= ( nm1 | a2 ) & nm2 ; source . nullBit4 &= nm1 & nm2 ; } if ( this . extra != null && source . extra != null ) { int length = this . extra [ <NUM_LIT:2> ] . length , sourceLength = source . extra [ <NUM_LIT:0> ] . length ; if ( sourceLength < length ) { length = sourceLength ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { m1 = ( s1 = source . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] ) & ( s3 = source . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) & ( s4 = source . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) & ( ( a2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) | ( a4 = this . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] ) ) ; m2 = s1 & ( s2 = this . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] ) & ( s3 ^ s4 ) & ( ( a3 = this . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] ) | a4 ) ; m3 = s1 & ( s2 & ( ns3 = ~ s3 ) & ( ns4 = ~ s4 ) & ( a3 | a4 ) | ( ns2 = ~ s2 ) & s3 & ns4 & ( a2 | a4 ) | ns2 & ns3 & s4 & ( a2 | a3 ) ) ; if ( ( m = ( m1 | m2 | m3 ) ) != <NUM_LIT:0> ) { if ( ! newCopy ) { newCopy = true ; source = source . unconditionalCopy ( ) ; } source . extra [ <NUM_LIT:1> + <NUM_LIT:1> ] [ i ] &= ~ m ; source . extra [ <NUM_LIT:2> + <NUM_LIT:1> ] [ i ] &= ( nm1 = ~ m1 ) & ( ( nm2 = ~ m2 ) | a4 ) ; source . extra [ <NUM_LIT:3> + <NUM_LIT:1> ] [ i ] &= ( nm1 | a2 ) & nm2 ; source . extra [ <NUM_LIT:4> + <NUM_LIT:1> ] [ i ] &= nm1 & nm2 ; } } } return source ; } public String toString ( ) { if ( this . extra == null ) { return "<STR_LIT>" + this . nullBit1 + this . nullBit2 + this . nullBit3 + this . nullBit4 + "<STR_LIT:>>" ; } else { String nullS = "<STR_LIT>" + this . nullBit1 + this . nullBit2 + this . nullBit3 + this . nullBit4 ; int i , ceil ; for ( i = <NUM_LIT:0> , ceil = this . extra [ <NUM_LIT:0> ] . length > <NUM_LIT:3> ? <NUM_LIT:3> : this . extra [ <NUM_LIT:0> ] . length ; i < ceil ; i ++ ) { nullS += "<STR_LIT:U+002C>" + this . extra [ <NUM_LIT:2> ] [ i ] + this . extra [ <NUM_LIT:3> ] [ i ] + this . extra [ <NUM_LIT:4> ] [ i ] + this . extra [ <NUM_LIT:5> ] [ i ] ; } if ( ceil < this . extra [ <NUM_LIT:0> ] . length ) { nullS += "<STR_LIT>" ; } return nullS + "<STR_LIT>" ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; public class LabelFlowContext extends SwitchFlowContext { public char [ ] labelName ; public LabelFlowContext ( FlowContext parent , ASTNode associatedNode , char [ ] labelName , BranchLabel breakLabel , BlockScope scope ) { super ( parent , associatedNode , breakLabel ) ; this . labelName = labelName ; checkLabelValidity ( scope ) ; } void checkLabelValidity ( BlockScope scope ) { FlowContext current = this . parent ; while ( current != null ) { char [ ] currentLabelName ; if ( ( ( currentLabelName = current . labelName ( ) ) != null ) && CharOperation . equals ( currentLabelName , this . labelName ) ) { scope . problemReporter ( ) . alreadyDefinedLabel ( this . labelName , this . associatedNode ) ; } current = current . parent ; } } public String individualToString ( ) { return "<STR_LIT>" + String . valueOf ( this . labelName ) + "<STR_LIT:]>" ; } public char [ ] labelName ( ) { return this . labelName ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; 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 InitializationFlowContext extends ExceptionHandlingFlowContext { public int exceptionCount ; public TypeBinding [ ] thrownExceptions = new TypeBinding [ <NUM_LIT:5> ] ; public ASTNode [ ] exceptionThrowers = new ASTNode [ <NUM_LIT:5> ] ; public FlowInfo [ ] exceptionThrowerFlowInfos = new FlowInfo [ <NUM_LIT:5> ] ; public FlowInfo initsBeforeContext ; public InitializationFlowContext ( FlowContext parent , ASTNode associatedNode , FlowInfo initsBeforeContext , FlowContext initializationParent , BlockScope scope ) { super ( parent , associatedNode , Binding . NO_EXCEPTIONS , initializationParent , scope , FlowInfo . DEAD_END ) ; this . initsBeforeContext = initsBeforeContext ; } public void checkInitializerExceptions ( BlockScope currentScope , FlowContext initializerContext , FlowInfo flowInfo ) { for ( int i = <NUM_LIT:0> ; i < this . exceptionCount ; i ++ ) { initializerContext . checkExceptionHandlers ( this . thrownExceptions [ i ] , this . exceptionThrowers [ i ] , this . exceptionThrowerFlowInfos [ i ] , currentScope ) ; } } public String individualToString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < this . exceptionCount ; i ++ ) { buffer . append ( '<CHAR_LIT:[>' ) . append ( this . thrownExceptions [ i ] . readableName ( ) ) ; buffer . append ( '<CHAR_LIT:->' ) . append ( this . exceptionThrowerFlowInfos [ i ] . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; } return buffer . toString ( ) ; } public void recordHandlingException ( ReferenceBinding exceptionType , UnconditionalFlowInfo flowInfo , TypeBinding raisedException , ASTNode invocationSite , boolean wasMasked ) { int size = this . thrownExceptions . length ; if ( this . exceptionCount == size ) { System . arraycopy ( this . thrownExceptions , <NUM_LIT:0> , ( this . thrownExceptions = new TypeBinding [ size * <NUM_LIT:2> ] ) , <NUM_LIT:0> , size ) ; System . arraycopy ( this . exceptionThrowers , <NUM_LIT:0> , ( this . exceptionThrowers = new ASTNode [ size * <NUM_LIT:2> ] ) , <NUM_LIT:0> , size ) ; System . arraycopy ( this . exceptionThrowerFlowInfos , <NUM_LIT:0> , ( this . exceptionThrowerFlowInfos = new FlowInfo [ size * <NUM_LIT:2> ] ) , <NUM_LIT:0> , size ) ; } this . thrownExceptions [ this . exceptionCount ] = raisedException ; this . exceptionThrowers [ this . exceptionCount ] = invocationSite ; this . exceptionThrowerFlowInfos [ this . exceptionCount ++ ] = flowInfo . copy ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . IfStatement ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public abstract class FlowInfo { public int tagBits ; public final static int REACHABLE = <NUM_LIT:0> ; public final static int UNREACHABLE = <NUM_LIT:1> ; public final static int NULL_FLAG_MASK = <NUM_LIT:2> ; public final static int UNKNOWN = <NUM_LIT:0> ; public final static int NULL = <NUM_LIT:1> ; public final static int NON_NULL = - <NUM_LIT:1> ; public static final UnconditionalFlowInfo DEAD_END ; static { DEAD_END = new UnconditionalFlowInfo ( ) ; DEAD_END . tagBits = UNREACHABLE ; } abstract public FlowInfo addInitializationsFrom ( FlowInfo otherInits ) ; abstract public FlowInfo addNullInfoFrom ( FlowInfo otherInits ) ; abstract public FlowInfo addPotentialInitializationsFrom ( FlowInfo otherInits ) ; public FlowInfo asNegatedCondition ( ) { return this ; } public static FlowInfo conditional ( FlowInfo initsWhenTrue , FlowInfo initsWhenFalse ) { if ( initsWhenTrue == initsWhenFalse ) return initsWhenTrue ; return new ConditionalFlowInfo ( initsWhenTrue , initsWhenFalse ) ; } public boolean cannotBeDefinitelyNullOrNonNull ( LocalVariableBinding local ) { return isPotentiallyUnknown ( local ) || isPotentiallyNonNull ( local ) && isPotentiallyNull ( local ) ; } public boolean cannotBeNull ( LocalVariableBinding local ) { return isDefinitelyNonNull ( local ) || isProtectedNonNull ( local ) ; } public boolean canOnlyBeNull ( LocalVariableBinding local ) { return isDefinitelyNull ( local ) || isProtectedNull ( local ) ; } abstract public FlowInfo copy ( ) ; public static UnconditionalFlowInfo initial ( int maxFieldCount ) { UnconditionalFlowInfo info = new UnconditionalFlowInfo ( ) ; info . maxFieldCount = maxFieldCount ; return info ; } abstract public FlowInfo initsWhenFalse ( ) ; abstract public FlowInfo initsWhenTrue ( ) ; abstract public boolean isDefinitelyAssigned ( FieldBinding field ) ; public abstract boolean isDefinitelyAssigned ( LocalVariableBinding local ) ; public abstract boolean isDefinitelyNonNull ( LocalVariableBinding local ) ; public abstract boolean isDefinitelyNull ( LocalVariableBinding local ) ; public abstract boolean isDefinitelyUnknown ( LocalVariableBinding local ) ; abstract public boolean isPotentiallyAssigned ( FieldBinding field ) ; abstract public boolean isPotentiallyAssigned ( LocalVariableBinding field ) ; public abstract boolean isPotentiallyNonNull ( LocalVariableBinding local ) ; public abstract boolean isPotentiallyNull ( LocalVariableBinding local ) ; public abstract boolean isPotentiallyUnknown ( LocalVariableBinding local ) ; public abstract boolean isProtectedNonNull ( LocalVariableBinding local ) ; public abstract boolean isProtectedNull ( LocalVariableBinding local ) ; abstract public void markAsComparedEqualToNonNull ( LocalVariableBinding local ) ; abstract public void markAsComparedEqualToNull ( LocalVariableBinding local ) ; abstract public void markAsDefinitelyAssigned ( FieldBinding field ) ; abstract public void markAsDefinitelyNonNull ( LocalVariableBinding local ) ; abstract public void markAsDefinitelyNull ( LocalVariableBinding local ) ; abstract public void markAsDefinitelyAssigned ( LocalVariableBinding local ) ; abstract public void markAsDefinitelyUnknown ( LocalVariableBinding local ) ; public static UnconditionalFlowInfo mergedOptimizedBranches ( FlowInfo initsWhenTrue , boolean isOptimizedTrue , FlowInfo initsWhenFalse , boolean isOptimizedFalse , boolean allowFakeDeadBranch ) { UnconditionalFlowInfo mergedInfo ; if ( isOptimizedTrue ) { if ( initsWhenTrue == FlowInfo . DEAD_END && allowFakeDeadBranch ) { mergedInfo = initsWhenFalse . setReachMode ( FlowInfo . UNREACHABLE ) . unconditionalInits ( ) ; } else { mergedInfo = initsWhenTrue . addPotentialInitializationsFrom ( initsWhenFalse . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; } } else if ( isOptimizedFalse ) { if ( initsWhenFalse == FlowInfo . DEAD_END && allowFakeDeadBranch ) { mergedInfo = initsWhenTrue . setReachMode ( FlowInfo . UNREACHABLE ) . unconditionalInits ( ) ; } else { mergedInfo = initsWhenFalse . addPotentialInitializationsFrom ( initsWhenTrue . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; } } else { mergedInfo = initsWhenTrue . mergedWith ( initsWhenFalse . unconditionalInits ( ) ) ; } return mergedInfo ; } public static UnconditionalFlowInfo mergedOptimizedBranchesIfElse ( FlowInfo initsWhenTrue , boolean isOptimizedTrue , FlowInfo initsWhenFalse , boolean isOptimizedFalse , boolean allowFakeDeadBranch , FlowInfo flowInfo , IfStatement ifStatement ) { UnconditionalFlowInfo mergedInfo ; if ( isOptimizedTrue ) { if ( initsWhenTrue == FlowInfo . DEAD_END && allowFakeDeadBranch ) { mergedInfo = initsWhenFalse . setReachMode ( FlowInfo . UNREACHABLE ) . unconditionalInits ( ) ; } else { mergedInfo = initsWhenTrue . addPotentialInitializationsFrom ( initsWhenFalse . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; } } else if ( isOptimizedFalse ) { if ( initsWhenFalse == FlowInfo . DEAD_END && allowFakeDeadBranch ) { mergedInfo = initsWhenTrue . setReachMode ( FlowInfo . UNREACHABLE ) . unconditionalInits ( ) ; } else { mergedInfo = initsWhenFalse . addPotentialInitializationsFrom ( initsWhenTrue . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; } } else if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> && ( ifStatement . bits & ASTNode . IsElseStatementUnreachable ) != <NUM_LIT:0> && initsWhenTrue != FlowInfo . DEAD_END && initsWhenFalse != FlowInfo . DEAD_END ) { mergedInfo = initsWhenTrue . addPotentialInitializationsFrom ( initsWhenFalse . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; mergedInfo . definiteInits &= initsWhenFalse . unconditionalCopy ( ) . definiteInits ; } else if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> && ( ifStatement . bits & ASTNode . IsThenStatementUnreachable ) != <NUM_LIT:0> && initsWhenTrue != FlowInfo . DEAD_END && initsWhenFalse != FlowInfo . DEAD_END ) { mergedInfo = initsWhenFalse . addPotentialInitializationsFrom ( initsWhenTrue . nullInfoLessUnconditionalCopy ( ) ) . unconditionalInits ( ) ; mergedInfo . definiteInits &= initsWhenTrue . unconditionalCopy ( ) . definiteInits ; } else { mergedInfo = initsWhenTrue . mergedWith ( initsWhenFalse . unconditionalInits ( ) ) ; } return mergedInfo ; } public int reachMode ( ) { return this . tagBits & UNREACHABLE ; } abstract public FlowInfo safeInitsWhenTrue ( ) ; abstract public FlowInfo setReachMode ( int reachMode ) ; abstract public UnconditionalFlowInfo mergedWith ( UnconditionalFlowInfo otherInits ) ; abstract public UnconditionalFlowInfo nullInfoLessUnconditionalCopy ( ) ; public String toString ( ) { if ( this == DEAD_END ) { return "<STR_LIT>" ; } return super . toString ( ) ; } abstract public UnconditionalFlowInfo unconditionalCopy ( ) ; abstract public UnconditionalFlowInfo unconditionalFieldLessCopy ( ) ; abstract public UnconditionalFlowInfo unconditionalInits ( ) ; abstract public UnconditionalFlowInfo unconditionalInitsWithoutSideEffect ( ) ; abstract public void markedAsNullOrNonNullInAssertExpression ( LocalVariableBinding local ) ; abstract public boolean isMarkedAsNullOrNonNullInAssertExpression ( LocalVariableBinding local ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . flow ; import java . util . ArrayList ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . Reference ; import org . eclipse . jdt . internal . compiler . codegen . BranchLabel ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . Scope ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . VariableBinding ; public class LoopingFlowContext extends SwitchFlowContext { public BranchLabel continueLabel ; public UnconditionalFlowInfo initsOnContinue = FlowInfo . DEAD_END ; private UnconditionalFlowInfo upstreamNullFlowInfo ; private LoopingFlowContext innerFlowContexts [ ] = null ; private UnconditionalFlowInfo innerFlowInfos [ ] = null ; private int innerFlowContextsCount = <NUM_LIT:0> ; private LabelFlowContext breakTargetContexts [ ] = null ; private int breakTargetsCount = <NUM_LIT:0> ; Reference finalAssignments [ ] ; VariableBinding finalVariables [ ] ; int assignCount = <NUM_LIT:0> ; LocalVariableBinding [ ] nullLocals ; Expression [ ] nullReferences ; int [ ] nullCheckTypes ; int nullCount ; static private class EscapingExceptionCatchSite { final ReferenceBinding caughtException ; final ExceptionHandlingFlowContext catchingContext ; public EscapingExceptionCatchSite ( ExceptionHandlingFlowContext catchingContext , ReferenceBinding caughtException ) { this . catchingContext = catchingContext ; this . caughtException = caughtException ; } void simulateThrowAfterLoopBack ( FlowInfo flowInfo ) { this . catchingContext . recordHandlingException ( this . caughtException , flowInfo . unconditionalInits ( ) , null , null , true ) ; } } private ArrayList escapingExceptionCatchSites = null ; Scope associatedScope ; public LoopingFlowContext ( FlowContext parent , FlowInfo upstreamNullFlowInfo , ASTNode associatedNode , BranchLabel breakLabel , BranchLabel continueLabel , Scope associatedScope ) { super ( parent , associatedNode , breakLabel ) ; this . tagBits |= FlowContext . PREEMPT_NULL_DIAGNOSTIC ; this . continueLabel = continueLabel ; this . associatedScope = associatedScope ; this . upstreamNullFlowInfo = upstreamNullFlowInfo . unconditionalCopy ( ) ; } public void complainOnDeferredFinalChecks ( BlockScope scope , FlowInfo flowInfo ) { for ( int i = <NUM_LIT:0> ; i < this . assignCount ; i ++ ) { VariableBinding variable = this . finalVariables [ i ] ; if ( variable == null ) continue ; boolean complained = false ; if ( variable instanceof FieldBinding ) { if ( flowInfo . isPotentiallyAssigned ( ( FieldBinding ) variable ) ) { complained = true ; scope . problemReporter ( ) . duplicateInitializationOfBlankFinalField ( ( FieldBinding ) variable , this . finalAssignments [ i ] ) ; } } else { if ( flowInfo . isPotentiallyAssigned ( ( LocalVariableBinding ) variable ) ) { complained = true ; scope . problemReporter ( ) . duplicateInitializationOfFinalLocal ( ( LocalVariableBinding ) variable , this . finalAssignments [ i ] ) ; } } if ( complained ) { FlowContext context = this . parent ; while ( context != null ) { context . removeFinalAssignmentIfAny ( this . finalAssignments [ i ] ) ; context = context . parent ; } } } } public void complainOnDeferredNullChecks ( BlockScope scope , FlowInfo callerFlowInfo ) { for ( int i = <NUM_LIT:0> ; i < this . innerFlowContextsCount ; i ++ ) { this . upstreamNullFlowInfo . addPotentialNullInfoFrom ( this . innerFlowContexts [ i ] . upstreamNullFlowInfo ) . addPotentialNullInfoFrom ( this . innerFlowInfos [ i ] ) ; } this . innerFlowContextsCount = <NUM_LIT:0> ; UnconditionalFlowInfo flowInfo = this . upstreamNullFlowInfo . addPotentialNullInfoFrom ( callerFlowInfo . unconditionalInitsWithoutSideEffect ( ) ) ; if ( ( this . tagBits & FlowContext . DEFER_NULL_DIAGNOSTIC ) != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < this . nullCount ; i ++ ) { LocalVariableBinding local = this . nullLocals [ i ] ; Expression expression = this . nullReferences [ i ] ; switch ( this . nullCheckTypes [ i ] ) { case CAN_ONLY_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { this . nullReferences [ i ] = null ; if ( this . nullCheckTypes [ i ] == ( CAN_ONLY_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , expression ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , expression ) ; } } continue ; } break ; case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { this . nullReferences [ i ] = null ; if ( this . nullCheckTypes [ i ] == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , expression ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , expression ) ; } } continue ; } if ( flowInfo . isDefinitelyNull ( local ) ) { this . nullReferences [ i ] = null ; if ( this . nullCheckTypes [ i ] == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , expression ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , expression ) ; } } continue ; } break ; case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . isDefinitelyNull ( local ) ) { this . nullReferences [ i ] = null ; switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , expression ) ; } continue ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , expression ) ; } continue ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , expression ) ; continue ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , expression ) ; continue ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : this . nullReferences [ i ] = null ; if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : this . nullReferences [ i ] = null ; if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; } } break ; case MAY_NULL : if ( flowInfo . isDefinitelyNull ( local ) ) { this . nullReferences [ i ] = null ; scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } break ; default : } this . parent . recordUsingNullReference ( scope , local , expression , this . nullCheckTypes [ i ] , flowInfo ) ; } } else { for ( int i = <NUM_LIT:0> ; i < this . nullCount ; i ++ ) { Expression expression = this . nullReferences [ i ] ; LocalVariableBinding local = this . nullLocals [ i ] ; switch ( this . nullCheckTypes [ i ] ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { this . nullReferences [ i ] = null ; if ( this . nullCheckTypes [ i ] == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , expression ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , expression ) ; } } continue ; } case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . isDefinitelyNull ( local ) ) { this . nullReferences [ i ] = null ; switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , expression ) ; } continue ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , expression ) ; } continue ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , expression ) ; continue ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , expression ) ; continue ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( this . nullCheckTypes [ i ] & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : this . nullReferences [ i ] = null ; if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : this . nullReferences [ i ] = null ; if ( ( ( this . nullCheckTypes [ i ] & CHECK_MASK ) == CAN_ONLY_NULL ) && ( expression . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; } } break ; case MAY_NULL : if ( flowInfo . isDefinitelyNull ( local ) ) { this . nullReferences [ i ] = null ; scope . problemReporter ( ) . localVariableNullReference ( local , expression ) ; continue ; } if ( flowInfo . isPotentiallyNull ( local ) ) { this . nullReferences [ i ] = null ; scope . problemReporter ( ) . localVariablePotentialNullReference ( local , expression ) ; continue ; } break ; default : } } } this . initsOnBreak . addPotentialNullInfoFrom ( flowInfo ) ; for ( int i = <NUM_LIT:0> ; i < this . breakTargetsCount ; i ++ ) { this . breakTargetContexts [ i ] . initsOnBreak . addPotentialNullInfoFrom ( flowInfo ) ; } } public BranchLabel continueLabel ( ) { return this . continueLabel ; } public String individualToString ( ) { StringBuffer buffer = new StringBuffer ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) . append ( this . initsOnBreak . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) . append ( this . initsOnContinue . toString ( ) ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) . append ( this . assignCount ) . append ( '<CHAR_LIT:]>' ) ; buffer . append ( "<STR_LIT>" ) . append ( this . nullCount ) . append ( '<CHAR_LIT:]>' ) ; return buffer . toString ( ) ; } public boolean isContinuable ( ) { return true ; } public boolean isContinuedTo ( ) { return this . initsOnContinue != FlowInfo . DEAD_END ; } public void recordBreakTo ( FlowContext targetContext ) { if ( targetContext instanceof LabelFlowContext ) { int current ; if ( ( current = this . breakTargetsCount ++ ) == <NUM_LIT:0> ) { this . breakTargetContexts = new LabelFlowContext [ <NUM_LIT:2> ] ; } else if ( current == this . breakTargetContexts . length ) { System . arraycopy ( this . breakTargetContexts , <NUM_LIT:0> , this . breakTargetContexts = new LabelFlowContext [ current + <NUM_LIT:2> ] , <NUM_LIT:0> , current ) ; } this . breakTargetContexts [ current ] = ( LabelFlowContext ) targetContext ; } } public void recordContinueFrom ( FlowContext innerFlowContext , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { if ( ( this . initsOnContinue . tagBits & FlowInfo . UNREACHABLE ) == <NUM_LIT:0> ) { this . initsOnContinue = this . initsOnContinue . mergedWith ( flowInfo . unconditionalInitsWithoutSideEffect ( ) ) ; } else { this . initsOnContinue = flowInfo . unconditionalCopy ( ) ; } FlowContext inner = innerFlowContext ; while ( inner != this && ! ( inner instanceof LoopingFlowContext ) ) { inner = inner . parent ; } if ( inner == this ) { this . upstreamNullFlowInfo . addPotentialNullInfoFrom ( flowInfo . unconditionalInitsWithoutSideEffect ( ) ) ; } else { int length = <NUM_LIT:0> ; if ( this . innerFlowContexts == null ) { this . innerFlowContexts = new LoopingFlowContext [ <NUM_LIT:5> ] ; this . innerFlowInfos = new UnconditionalFlowInfo [ <NUM_LIT:5> ] ; } else if ( this . innerFlowContextsCount == ( length = this . innerFlowContexts . length ) - <NUM_LIT:1> ) { System . arraycopy ( this . innerFlowContexts , <NUM_LIT:0> , ( this . innerFlowContexts = new LoopingFlowContext [ length + <NUM_LIT:5> ] ) , <NUM_LIT:0> , length ) ; System . arraycopy ( this . innerFlowInfos , <NUM_LIT:0> , ( this . innerFlowInfos = new UnconditionalFlowInfo [ length + <NUM_LIT:5> ] ) , <NUM_LIT:0> , length ) ; } this . innerFlowContexts [ this . innerFlowContextsCount ] = ( LoopingFlowContext ) inner ; this . innerFlowInfos [ this . innerFlowContextsCount ++ ] = flowInfo . unconditionalInitsWithoutSideEffect ( ) ; } } } protected boolean recordFinalAssignment ( VariableBinding binding , Reference finalAssignment ) { if ( binding instanceof LocalVariableBinding ) { Scope scope = ( ( LocalVariableBinding ) binding ) . declaringScope ; while ( ( scope = scope . parent ) != null ) { if ( scope == this . associatedScope ) return false ; } } if ( this . assignCount == <NUM_LIT:0> ) { this . finalAssignments = new Reference [ <NUM_LIT:5> ] ; this . finalVariables = new VariableBinding [ <NUM_LIT:5> ] ; } else { if ( this . assignCount == this . finalAssignments . length ) System . arraycopy ( this . finalAssignments , <NUM_LIT:0> , ( this . finalAssignments = new Reference [ this . assignCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . assignCount ) ; System . arraycopy ( this . finalVariables , <NUM_LIT:0> , ( this . finalVariables = new VariableBinding [ this . assignCount * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . assignCount ) ; } this . finalAssignments [ this . assignCount ] = finalAssignment ; this . finalVariables [ this . assignCount ++ ] = binding ; return true ; } protected void recordNullReference ( LocalVariableBinding local , Expression expression , int status ) { if ( this . nullCount == <NUM_LIT:0> ) { this . nullLocals = new LocalVariableBinding [ <NUM_LIT:5> ] ; this . nullReferences = new Expression [ <NUM_LIT:5> ] ; this . nullCheckTypes = new int [ <NUM_LIT:5> ] ; } else if ( this . nullCount == this . nullLocals . length ) { System . arraycopy ( this . nullLocals , <NUM_LIT:0> , this . nullLocals = new LocalVariableBinding [ this . nullCount * <NUM_LIT:2> ] , <NUM_LIT:0> , this . nullCount ) ; System . arraycopy ( this . nullReferences , <NUM_LIT:0> , this . nullReferences = new Expression [ this . nullCount * <NUM_LIT:2> ] , <NUM_LIT:0> , this . nullCount ) ; System . arraycopy ( this . nullCheckTypes , <NUM_LIT:0> , this . nullCheckTypes = new int [ this . nullCount * <NUM_LIT:2> ] , <NUM_LIT:0> , this . nullCount ) ; } this . nullLocals [ this . nullCount ] = local ; this . nullReferences [ this . nullCount ] = expression ; this . nullCheckTypes [ this . nullCount ++ ] = status ; } public void recordUsingNullReference ( Scope scope , LocalVariableBinding local , Expression reference , int checkType , FlowInfo flowInfo ) { if ( ( flowInfo . tagBits & FlowInfo . UNREACHABLE ) != <NUM_LIT:0> || flowInfo . isDefinitelyUnknown ( local ) ) { return ; } switch ( checkType ) { case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { if ( checkType == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNonNullComparedToNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } } else if ( flowInfo . isDefinitelyNull ( local ) ) { if ( checkType == ( CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL ) ) { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } } } else if ( this . upstreamNullFlowInfo . isDefinitelyNonNull ( local ) && ! flowInfo . isPotentiallyNull ( local ) ) { flowInfo . markAsDefinitelyNonNull ( local ) ; if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { recordNullReference ( local , reference , checkType ) ; } } else if ( ! flowInfo . cannotBeDefinitelyNullOrNonNull ( local ) ) { if ( flowInfo . isPotentiallyNonNull ( local ) ) { recordNullReference ( local , reference , CAN_ONLY_NON_NULL | checkType & CONTEXT_MASK ) ; } else { if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { recordNullReference ( local , reference , checkType ) ; } } } return ; case CAN_ONLY_NULL | IN_COMPARISON_NULL : case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL : case CAN_ONLY_NULL | IN_ASSIGNMENT : case CAN_ONLY_NULL | IN_INSTANCEOF : if ( flowInfo . isPotentiallyNonNull ( local ) || flowInfo . isPotentiallyUnknown ( local ) ) { return ; } if ( flowInfo . isDefinitelyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableRedundantCheckOnNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenFalse ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariableNullComparedToNonNull ( local , reference ) ; } if ( ! flowInfo . isMarkedAsNullOrNonNullInAssertExpression ( local ) ) { flowInfo . initsWhenTrue ( ) . setReachMode ( FlowInfo . UNREACHABLE ) ; } return ; case FlowContext . IN_ASSIGNMENT : scope . problemReporter ( ) . localVariableRedundantNullAssignment ( local , reference ) ; return ; case FlowContext . IN_INSTANCEOF : scope . problemReporter ( ) . localVariableNullInstanceof ( local , reference ) ; return ; } } else if ( flowInfo . isPotentiallyNull ( local ) ) { switch ( checkType & CONTEXT_MASK ) { case FlowContext . IN_COMPARISON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; case FlowContext . IN_COMPARISON_NON_NULL : if ( ( ( checkType & CHECK_MASK ) == CAN_ONLY_NULL ) && ( reference . implicitConversion & TypeIds . UNBOXING ) != <NUM_LIT:0> ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } break ; } } if ( ( this . tagBits & FlowContext . HIDE_NULL_COMPARISON_WARNING ) == <NUM_LIT:0> || ( checkType & CONTEXT_MASK ) == FlowContext . IN_ASSIGNMENT || ( checkType & CONTEXT_MASK ) == FlowContext . IN_INSTANCEOF ) { recordNullReference ( local , reference , checkType ) ; } return ; case MAY_NULL : if ( flowInfo . isDefinitelyNonNull ( local ) ) { return ; } if ( flowInfo . isDefinitelyNull ( local ) ) { scope . problemReporter ( ) . localVariableNullReference ( local , reference ) ; return ; } if ( flowInfo . isPotentiallyNull ( local ) ) { scope . problemReporter ( ) . localVariablePotentialNullReference ( local , reference ) ; return ; } recordNullReference ( local , reference , checkType ) ; return ; default : } } void removeFinalAssignmentIfAny ( Reference reference ) { for ( int i = <NUM_LIT:0> ; i < this . assignCount ; i ++ ) { if ( this . finalAssignments [ i ] == reference ) { this . finalAssignments [ i ] = null ; this . finalVariables [ i ] = null ; return ; } } } public void simulateThrowAfterLoopBack ( FlowInfo flowInfo ) { if ( this . escapingExceptionCatchSites != null ) { for ( int i = <NUM_LIT:0> , exceptionCount = this . escapingExceptionCatchSites . size ( ) ; i < exceptionCount ; i ++ ) { ( ( EscapingExceptionCatchSite ) this . escapingExceptionCatchSites . get ( i ) ) . simulateThrowAfterLoopBack ( flowInfo ) ; } this . escapingExceptionCatchSites = null ; } } public void recordCatchContextOfEscapingException ( ExceptionHandlingFlowContext catchingContext , ReferenceBinding caughtException ) { if ( this . escapingExceptionCatchSites == null ) { this . escapingExceptionCatchSites = new ArrayList ( <NUM_LIT:5> ) ; } this . escapingExceptionCatchSites . add ( new EscapingExceptionCatchSite ( catchingContext , caughtException ) ) ; } public boolean hasEscapingExceptions ( ) { return this . escapingExceptionCatchSites != null ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; public final class FieldInfoWithAnnotation extends FieldInfo { private AnnotationInfo [ ] annotations ; FieldInfoWithAnnotation ( FieldInfo info , AnnotationInfo [ ] annos ) { super ( info . reference , info . constantPoolOffsets , info . structOffset ) ; this . accessFlags = info . accessFlags ; this . attributeBytes = info . attributeBytes ; this . constant = info . constant ; this . constantPoolOffsets = info . constantPoolOffsets ; this . descriptor = info . descriptor ; this . name = info . name ; this . signature = info . signature ; this . signatureUtf8Offset = info . signatureUtf8Offset ; this . tagBits = info . tagBits ; this . wrappedConstantValue = info . wrappedConstantValue ; this . annotations = annos ; } public org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , max = this . annotations . length ; i < max ; i ++ ) this . annotations [ i ] . initialize ( ) ; super . initialize ( ) ; } protected void reset ( ) { if ( this . annotations != null ) for ( int i = <NUM_LIT:0> , max = this . annotations . length ; i < max ; i ++ ) this . annotations [ i ] . reset ( ) ; super . reset ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( getClass ( ) . getName ( ) ) ; if ( this . annotations != null ) { buffer . append ( '<STR_LIT:\n>' ) ; for ( int i = <NUM_LIT:0> ; i < this . annotations . length ; i ++ ) { buffer . append ( this . annotations [ i ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } toStringContent ( buffer ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ElementValuePairInfo implements org . eclipse . jdt . internal . compiler . env . IBinaryElementValuePair { static final ElementValuePairInfo [ ] NoMembers = new ElementValuePairInfo [ <NUM_LIT:0> ] ; private char [ ] name ; private Object value ; ElementValuePairInfo ( char [ ] name , Object value ) { this . name = name ; this . value = value ; } public char [ ] getName ( ) { return this . name ; } public Object getValue ( ) { return this . value ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( this . name ) ; buffer . append ( '<CHAR_LIT:=>' ) ; if ( this . value instanceof Object [ ] ) { final Object [ ] values = ( Object [ ] ) this . value ; buffer . append ( '<CHAR_LIT>' ) ; for ( int i = <NUM_LIT:0> , l = values . length ; i < l ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( values [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } else { buffer . append ( this . value ) ; } return buffer . toString ( ) ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + CharOperation . hashCode ( this . name ) ; result = prime * result + ( ( this . value == null ) ? <NUM_LIT:0> : this . value . hashCode ( ) ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ElementValuePairInfo other = ( ElementValuePairInfo ) obj ; if ( ! Arrays . equals ( this . name , other . name ) ) { return false ; } if ( this . value == null ) { if ( other . value != null ) { return false ; } } else if ( ! this . value . equals ( other . value ) ) { return false ; } return true ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; class MethodInfoWithParameterAnnotations extends MethodInfoWithAnnotations { private AnnotationInfo [ ] [ ] parameterAnnotations ; MethodInfoWithParameterAnnotations ( MethodInfo methodInfo , AnnotationInfo [ ] annotations , AnnotationInfo [ ] [ ] parameterAnnotations ) { super ( methodInfo , annotations ) ; this . parameterAnnotations = parameterAnnotations ; } public IBinaryAnnotation [ ] getParameterAnnotations ( int index ) { return this . parameterAnnotations [ index ] ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , l = this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; i < l ; i ++ ) { AnnotationInfo [ ] infos = this . parameterAnnotations [ i ] ; for ( int j = <NUM_LIT:0> , k = infos == null ? <NUM_LIT:0> : infos . length ; j < k ; j ++ ) infos [ j ] . initialize ( ) ; } super . initialize ( ) ; } protected void reset ( ) { for ( int i = <NUM_LIT:0> , l = this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; i < l ; i ++ ) { AnnotationInfo [ ] infos = this . parameterAnnotations [ i ] ; for ( int j = <NUM_LIT:0> , k = infos == null ? <NUM_LIT:0> : infos . length ; j < k ; j ++ ) infos [ j ] . reset ( ) ; } super . reset ( ) ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; for ( int i = <NUM_LIT:0> , l = this . parameterAnnotations == null ? <NUM_LIT:0> : this . parameterAnnotations . length ; i < l ; i ++ ) { buffer . append ( "<STR_LIT>" + ( i - <NUM_LIT:1> ) ) ; buffer . append ( '<STR_LIT:\n>' ) ; AnnotationInfo [ ] infos = this . parameterAnnotations [ i ] ; for ( int j = <NUM_LIT:0> , k = infos == null ? <NUM_LIT:0> : infos . length ; j < k ; j ++ ) { buffer . append ( infos [ j ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; public class AnnotationMethodInfoWithAnnotations extends AnnotationMethodInfo { private AnnotationInfo [ ] annotations ; AnnotationMethodInfoWithAnnotations ( MethodInfo methodInfo , Object defaultValue , AnnotationInfo [ ] annotations ) { super ( methodInfo , defaultValue ) ; this . annotations = annotations ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) if ( this . annotations [ i ] != null ) this . annotations [ i ] . initialize ( ) ; super . initialize ( ) ; } protected void reset ( ) { for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) if ( this . annotations [ i ] != null ) this . annotations [ i ] . reset ( ) ; super . reset ( ) ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) { buffer . append ( this . annotations [ i ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . env . IBinaryNestedType ; public class InnerClassInfo extends ClassFileStruct implements IBinaryNestedType { int innerClassNameIndex = - <NUM_LIT:1> ; int outerClassNameIndex = - <NUM_LIT:1> ; int innerNameIndex = - <NUM_LIT:1> ; private char [ ] innerClassName ; private char [ ] outerClassName ; private char [ ] innerName ; private int accessFlags = - <NUM_LIT:1> ; private boolean readInnerClassName = false ; private boolean readOuterClassName = false ; private boolean readInnerName = false ; public InnerClassInfo ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { super ( classFileBytes , offsets , offset ) ; this . innerClassNameIndex = u2At ( <NUM_LIT:0> ) ; this . outerClassNameIndex = u2At ( <NUM_LIT:2> ) ; this . innerNameIndex = u2At ( <NUM_LIT:4> ) ; } public char [ ] getEnclosingTypeName ( ) { if ( ! this . readOuterClassName ) { this . readOuterClassName = true ; if ( this . outerClassNameIndex != <NUM_LIT:0> ) { int utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ this . outerClassNameIndex ] - this . structOffset + <NUM_LIT:1> ) ] - this . structOffset ; this . outerClassName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } } return this . outerClassName ; } public int getModifiers ( ) { if ( this . accessFlags == - <NUM_LIT:1> ) { this . accessFlags = u2At ( <NUM_LIT:6> ) ; } return this . accessFlags ; } public char [ ] getName ( ) { if ( ! this . readInnerClassName ) { this . readInnerClassName = true ; if ( this . innerClassNameIndex != <NUM_LIT:0> ) { int classOffset = this . constantPoolOffsets [ this . innerClassNameIndex ] - this . structOffset ; int utf8Offset = this . constantPoolOffsets [ u2At ( classOffset + <NUM_LIT:1> ) ] - this . structOffset ; this . innerClassName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } } return this . innerClassName ; } public char [ ] getSourceName ( ) { if ( ! this . readInnerName ) { this . readInnerName = true ; if ( this . innerNameIndex != <NUM_LIT:0> ) { int utf8Offset = this . constantPoolOffsets [ this . innerNameIndex ] - this . structOffset ; this . innerName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } } return this . innerName ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; if ( getName ( ) != null ) { buffer . append ( getName ( ) ) ; } buffer . append ( "<STR_LIT:n>" ) ; if ( getEnclosingTypeName ( ) != null ) { buffer . append ( getEnclosingTypeName ( ) ) ; } buffer . append ( "<STR_LIT:n>" ) ; if ( getSourceName ( ) != null ) { buffer . append ( getSourceName ( ) ) ; } return buffer . toString ( ) ; } void initialize ( ) { getModifiers ( ) ; getName ( ) ; getSourceName ( ) ; getEnclosingTypeName ( ) ; reset ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryMethod ; import org . eclipse . jdt . internal . compiler . util . Util ; public class MethodInfo extends ClassFileStruct implements IBinaryMethod , Comparable { static private final char [ ] [ ] noException = CharOperation . NO_CHAR_CHAR ; static private final char [ ] [ ] noArgumentNames = CharOperation . NO_CHAR_CHAR ; protected int accessFlags ; protected int attributeBytes ; protected char [ ] descriptor ; protected char [ ] [ ] exceptionNames ; protected char [ ] name ; protected char [ ] signature ; protected int signatureUtf8Offset ; protected long tagBits ; protected char [ ] [ ] argumentNames ; protected int argumentNamesIndex ; public static MethodInfo createMethod ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { MethodInfo methodInfo = new MethodInfo ( classFileBytes , offsets , offset ) ; int attributesCount = methodInfo . u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; AnnotationInfo [ ] annotations = null ; AnnotationInfo [ ] [ ] parameterAnnotations = null ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = methodInfo . constantPoolOffsets [ methodInfo . u2At ( readOffset ) ] - methodInfo . structOffset ; char [ ] attributeName = methodInfo . utf8At ( utf8Offset + <NUM_LIT:3> , methodInfo . u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length > <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( AttributeNamesConstants . SignatureName , attributeName ) ) methodInfo . signatureUtf8Offset = methodInfo . constantPoolOffsets [ methodInfo . u2At ( readOffset + <NUM_LIT:6> ) ] - methodInfo . structOffset ; break ; case '<CHAR_LIT>' : AnnotationInfo [ ] methodAnnotations = null ; AnnotationInfo [ ] [ ] paramAnnotations = null ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { methodAnnotations = decodeMethodAnnotations ( readOffset , true , methodInfo ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { methodAnnotations = decodeMethodAnnotations ( readOffset , false , methodInfo ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleParameterAnnotationsName ) ) { paramAnnotations = decodeParamAnnotations ( readOffset , true , methodInfo ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleParameterAnnotationsName ) ) { paramAnnotations = decodeParamAnnotations ( readOffset , false , methodInfo ) ; } if ( methodAnnotations != null ) { if ( annotations == null ) { annotations = methodAnnotations ; } else { int length = annotations . length ; AnnotationInfo [ ] newAnnotations = new AnnotationInfo [ length + methodAnnotations . length ] ; System . arraycopy ( annotations , <NUM_LIT:0> , newAnnotations , <NUM_LIT:0> , length ) ; System . arraycopy ( methodAnnotations , <NUM_LIT:0> , newAnnotations , length , methodAnnotations . length ) ; annotations = newAnnotations ; } } else if ( paramAnnotations != null ) { int numberOfParameters = paramAnnotations . length ; if ( parameterAnnotations == null ) { parameterAnnotations = paramAnnotations ; } else { for ( int p = <NUM_LIT:0> ; p < numberOfParameters ; p ++ ) { int numberOfAnnotations = paramAnnotations [ p ] == null ? <NUM_LIT:0> : paramAnnotations [ p ] . length ; if ( numberOfAnnotations > <NUM_LIT:0> ) { if ( parameterAnnotations [ p ] == null ) { parameterAnnotations [ p ] = paramAnnotations [ p ] ; } else { int length = parameterAnnotations [ p ] . length ; AnnotationInfo [ ] newAnnotations = new AnnotationInfo [ length + numberOfAnnotations ] ; System . arraycopy ( parameterAnnotations [ p ] , <NUM_LIT:0> , newAnnotations , <NUM_LIT:0> , length ) ; System . arraycopy ( paramAnnotations [ p ] , <NUM_LIT:0> , newAnnotations , length , numberOfAnnotations ) ; parameterAnnotations [ p ] = newAnnotations ; } } } } } break ; } } readOffset += ( <NUM_LIT:6> + methodInfo . u4At ( readOffset + <NUM_LIT:2> ) ) ; } methodInfo . attributeBytes = readOffset ; if ( parameterAnnotations != null ) return new MethodInfoWithParameterAnnotations ( methodInfo , annotations , parameterAnnotations ) ; if ( annotations != null ) return new MethodInfoWithAnnotations ( methodInfo , annotations ) ; return methodInfo ; } static AnnotationInfo [ ] decodeAnnotations ( int offset , boolean runtimeVisible , int numberOfAnnotations , MethodInfo methodInfo ) { AnnotationInfo [ ] result = new AnnotationInfo [ numberOfAnnotations ] ; int readOffset = offset ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) { result [ i ] = new AnnotationInfo ( methodInfo . reference , methodInfo . constantPoolOffsets , readOffset + methodInfo . structOffset , runtimeVisible , false ) ; readOffset += result [ i ] . readOffset ; } return result ; } static AnnotationInfo [ ] decodeMethodAnnotations ( int offset , boolean runtimeVisible , MethodInfo methodInfo ) { int numberOfAnnotations = methodInfo . u2At ( offset + <NUM_LIT:6> ) ; if ( numberOfAnnotations > <NUM_LIT:0> ) { AnnotationInfo [ ] annos = decodeAnnotations ( offset + <NUM_LIT:8> , runtimeVisible , numberOfAnnotations , methodInfo ) ; if ( runtimeVisible ) { int numStandardAnnotations = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) { long standardAnnoTagBits = annos [ i ] . standardAnnotationTagBits ; methodInfo . tagBits |= standardAnnoTagBits ; if ( standardAnnoTagBits != <NUM_LIT:0> ) { annos [ i ] = null ; numStandardAnnotations ++ ; } } if ( numStandardAnnotations != <NUM_LIT:0> ) { if ( numStandardAnnotations == numberOfAnnotations ) return null ; AnnotationInfo [ ] temp = new AnnotationInfo [ numberOfAnnotations - numStandardAnnotations ] ; int tmpIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) if ( annos [ i ] != null ) temp [ tmpIndex ++ ] = annos [ i ] ; annos = temp ; } } return annos ; } return null ; } static AnnotationInfo [ ] [ ] decodeParamAnnotations ( int offset , boolean runtimeVisible , MethodInfo methodInfo ) { AnnotationInfo [ ] [ ] allParamAnnotations = null ; int numberOfParameters = methodInfo . u1At ( offset + <NUM_LIT:6> ) ; if ( numberOfParameters > <NUM_LIT:0> ) { int readOffset = offset + <NUM_LIT:7> ; for ( int i = <NUM_LIT:0> ; i < numberOfParameters ; i ++ ) { int numberOfAnnotations = methodInfo . u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( numberOfAnnotations > <NUM_LIT:0> ) { if ( allParamAnnotations == null ) allParamAnnotations = new AnnotationInfo [ numberOfParameters ] [ ] ; AnnotationInfo [ ] annos = decodeAnnotations ( readOffset , runtimeVisible , numberOfAnnotations , methodInfo ) ; allParamAnnotations [ i ] = annos ; for ( int aIndex = <NUM_LIT:0> ; aIndex < annos . length ; aIndex ++ ) readOffset += annos [ aIndex ] . readOffset ; } } } return allParamAnnotations ; } protected MethodInfo ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { super ( classFileBytes , offsets , offset ) ; this . accessFlags = - <NUM_LIT:1> ; this . signatureUtf8Offset = - <NUM_LIT:1> ; } public int compareTo ( Object o ) { MethodInfo otherMethod = ( MethodInfo ) o ; int result = new String ( getSelector ( ) ) . compareTo ( new String ( otherMethod . getSelector ( ) ) ) ; if ( result != <NUM_LIT:0> ) return result ; return new String ( getMethodDescriptor ( ) ) . compareTo ( new String ( otherMethod . getMethodDescriptor ( ) ) ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof MethodInfo ) ) { return false ; } MethodInfo otherMethod = ( MethodInfo ) o ; return CharOperation . equals ( getSelector ( ) , otherMethod . getSelector ( ) ) && CharOperation . equals ( getMethodDescriptor ( ) , otherMethod . getMethodDescriptor ( ) ) ; } public int hashCode ( ) { return CharOperation . hashCode ( getSelector ( ) ) + CharOperation . hashCode ( getMethodDescriptor ( ) ) ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return null ; } public char [ ] [ ] getArgumentNames ( ) { if ( this . argumentNames == null ) { readCodeAttribute ( ) ; } return this . argumentNames ; } public Object getDefaultValue ( ) { return null ; } public char [ ] [ ] getExceptionTypeNames ( ) { if ( this . exceptionNames == null ) { readExceptionAttributes ( ) ; } return this . exceptionNames ; } public char [ ] getGenericSignature ( ) { if ( this . signatureUtf8Offset != - <NUM_LIT:1> ) { if ( this . signature == null ) { this . signature = utf8At ( this . signatureUtf8Offset + <NUM_LIT:3> , u2At ( this . signatureUtf8Offset + <NUM_LIT:1> ) ) ; } return this . signature ; } return null ; } public char [ ] getMethodDescriptor ( ) { if ( this . descriptor == null ) { int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:4> ) ] - this . structOffset ; this . descriptor = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } return this . descriptor ; } public int getModifiers ( ) { if ( this . accessFlags == - <NUM_LIT:1> ) { this . accessFlags = u2At ( <NUM_LIT:0> ) ; readModifierRelatedAttributes ( ) ; } return this . accessFlags ; } public IBinaryAnnotation [ ] getParameterAnnotations ( int index ) { return null ; } public char [ ] getSelector ( ) { if ( this . name == null ) { int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:2> ) ] - this . structOffset ; this . name = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } return this . name ; } public long getTagBits ( ) { return this . tagBits ; } protected void initialize ( ) { getModifiers ( ) ; getSelector ( ) ; getMethodDescriptor ( ) ; getExceptionTypeNames ( ) ; getGenericSignature ( ) ; getArgumentNames ( ) ; reset ( ) ; } public boolean isClinit ( ) { char [ ] selector = getSelector ( ) ; return selector [ <NUM_LIT:0> ] == '<CHAR_LIT>' && selector . length == <NUM_LIT:8> ; } public boolean isConstructor ( ) { char [ ] selector = getSelector ( ) ; return selector [ <NUM_LIT:0> ] == '<CHAR_LIT>' && selector . length == <NUM_LIT:6> ; } public boolean isSynthetic ( ) { return ( getModifiers ( ) & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } private void readExceptionAttributes ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . ExceptionsName ) ) { int entriesNumber = u2At ( readOffset + <NUM_LIT:6> ) ; readOffset += <NUM_LIT:8> ; if ( entriesNumber == <NUM_LIT:0> ) { this . exceptionNames = noException ; } else { this . exceptionNames = new char [ entriesNumber ] [ ] ; for ( int j = <NUM_LIT:0> ; j < entriesNumber ; j ++ ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset + <NUM_LIT:1> ) ] - this . structOffset ; this . exceptionNames [ j ] = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; readOffset += <NUM_LIT:2> ; } } } else { readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } } if ( this . exceptionNames == null ) { this . exceptionNames = noException ; } } private void readModifierRelatedAttributes ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length != <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . DeprecatedName ) ) this . accessFlags |= ClassFileConstants . AccDeprecated ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SyntheticName ) ) this . accessFlags |= ClassFileConstants . AccSynthetic ; break ; case '<CHAR_LIT:A>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . AnnotationDefaultName ) ) this . accessFlags |= ClassFileConstants . AccAnnotationDefault ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . VarargsName ) ) this . accessFlags |= ClassFileConstants . AccVarargs ; } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } } public int sizeInBytes ( ) { return this . attributeBytes ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; toString ( buffer ) ; return buffer . toString ( ) ; } void toString ( StringBuffer buffer ) { buffer . append ( getClass ( ) . getName ( ) ) ; toStringContent ( buffer ) ; } protected void toStringContent ( StringBuffer buffer ) { int modifiers = getModifiers ( ) ; char [ ] desc = getGenericSignature ( ) ; if ( desc == null ) desc = getMethodDescriptor ( ) ; buffer . append ( '<CHAR_LIT>' ) . append ( ( ( modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT:1> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) ) . append ( getSelector ( ) ) . append ( desc ) . append ( '<CHAR_LIT:}>' ) ; } private void readCodeAttribute ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; if ( attributesCount != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . CodeName ) ) { decodeCodeAttribute ( readOffset ) ; if ( this . argumentNames == null ) { this . argumentNames = noArgumentNames ; } return ; } else { readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } } } this . argumentNames = noArgumentNames ; } private void decodeCodeAttribute ( int offset ) { int readOffset = offset + <NUM_LIT:10> ; int codeLength = ( int ) u4At ( readOffset ) ; readOffset += ( <NUM_LIT:4> + codeLength ) ; int exceptionTableLength = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( exceptionTableLength != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < exceptionTableLength ; i ++ ) { readOffset += <NUM_LIT:8> ; } } int attributesCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . LocalVariableTableName ) ) { decodeLocalVariableAttribute ( readOffset , codeLength ) ; } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } } private void decodeLocalVariableAttribute ( int offset , int codeLength ) { int readOffset = offset + <NUM_LIT:6> ; final int length = u2At ( readOffset ) ; if ( length != <NUM_LIT:0> ) { readOffset += <NUM_LIT:2> ; this . argumentNames = new char [ length ] [ ] ; this . argumentNamesIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { int startPC = u2At ( readOffset ) ; if ( startPC == <NUM_LIT:0> ) { int nameIndex = u2At ( <NUM_LIT:4> + readOffset ) ; int utf8Offset = this . constantPoolOffsets [ nameIndex ] - this . structOffset ; char [ ] localVariableName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( ! CharOperation . equals ( localVariableName , ConstantPool . This ) ) { this . argumentNames [ this . argumentNamesIndex ++ ] = localVariableName ; } } else { break ; } readOffset += <NUM_LIT:10> ; } if ( this . argumentNamesIndex != this . argumentNames . length ) { System . arraycopy ( this . argumentNames , <NUM_LIT:0> , ( this . argumentNames = new char [ this . argumentNamesIndex ] [ ] ) , <NUM_LIT:0> , this . argumentNamesIndex ) ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; public class AnnotationMethodInfo extends MethodInfo { protected Object defaultValue = null ; public static MethodInfo createAnnotationMethod ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { MethodInfo methodInfo = new MethodInfo ( classFileBytes , offsets , offset ) ; int attributesCount = methodInfo . u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; AnnotationInfo [ ] annotations = null ; Object defaultValue = null ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = methodInfo . constantPoolOffsets [ methodInfo . u2At ( readOffset ) ] - methodInfo . structOffset ; char [ ] attributeName = methodInfo . utf8At ( utf8Offset + <NUM_LIT:3> , methodInfo . u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length > <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:A>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . AnnotationDefaultName ) ) { AnnotationInfo info = new AnnotationInfo ( methodInfo . reference , methodInfo . constantPoolOffsets , readOffset + <NUM_LIT:6> + methodInfo . structOffset ) ; defaultValue = info . decodeDefaultValue ( ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( AttributeNamesConstants . SignatureName , attributeName ) ) methodInfo . signatureUtf8Offset = methodInfo . constantPoolOffsets [ methodInfo . u2At ( readOffset + <NUM_LIT:6> ) ] - methodInfo . structOffset ; break ; case '<CHAR_LIT>' : AnnotationInfo [ ] methodAnnotations = null ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { methodAnnotations = decodeMethodAnnotations ( readOffset , true , methodInfo ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { methodAnnotations = decodeMethodAnnotations ( readOffset , false , methodInfo ) ; } if ( methodAnnotations != null ) { if ( annotations == null ) { annotations = methodAnnotations ; } else { int length = annotations . length ; AnnotationInfo [ ] newAnnotations = new AnnotationInfo [ length + methodAnnotations . length ] ; System . arraycopy ( annotations , <NUM_LIT:0> , newAnnotations , <NUM_LIT:0> , length ) ; System . arraycopy ( methodAnnotations , <NUM_LIT:0> , newAnnotations , length , methodAnnotations . length ) ; annotations = newAnnotations ; } } break ; } } readOffset += ( <NUM_LIT:6> + methodInfo . u4At ( readOffset + <NUM_LIT:2> ) ) ; } methodInfo . attributeBytes = readOffset ; if ( defaultValue != null ) { if ( annotations != null ) { return new AnnotationMethodInfoWithAnnotations ( methodInfo , defaultValue , annotations ) ; } return new AnnotationMethodInfo ( methodInfo , defaultValue ) ; } if ( annotations != null ) return new MethodInfoWithAnnotations ( methodInfo , annotations ) ; return methodInfo ; } AnnotationMethodInfo ( MethodInfo methodInfo , Object defaultValue ) { super ( methodInfo . reference , methodInfo . constantPoolOffsets , methodInfo . structOffset ) ; this . defaultValue = defaultValue ; this . accessFlags = methodInfo . accessFlags ; this . attributeBytes = methodInfo . attributeBytes ; this . descriptor = methodInfo . descriptor ; this . exceptionNames = methodInfo . exceptionNames ; this . name = methodInfo . name ; this . signature = methodInfo . signature ; this . signatureUtf8Offset = methodInfo . signatureUtf8Offset ; this . tagBits = methodInfo . tagBits ; } public Object getDefaultValue ( ) { return this . defaultValue ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; if ( this . defaultValue != null ) { buffer . append ( "<STR_LIT>" ) ; if ( this . defaultValue instanceof Object [ ] ) { buffer . append ( '<CHAR_LIT>' ) ; Object [ ] elements = ( Object [ ] ) this . defaultValue ; for ( int i = <NUM_LIT:0> , len = elements . length ; i < len ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT:U+002CU+0020>" ) ; buffer . append ( elements [ i ] ) ; } buffer . append ( '<CHAR_LIT:}>' ) ; } else { buffer . append ( this . defaultValue ) ; } buffer . append ( '<STR_LIT:\n>' ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . util . Util ; public class AnnotationInfo extends ClassFileStruct implements IBinaryAnnotation { private char [ ] typename ; private ElementValuePairInfo [ ] pairs ; long standardAnnotationTagBits = <NUM_LIT:0> ; int readOffset = <NUM_LIT:0> ; static Object [ ] EmptyValueArray = new Object [ <NUM_LIT:0> ] ; AnnotationInfo ( byte [ ] classFileBytes , int [ ] contantPoolOffsets , int offset ) { super ( classFileBytes , contantPoolOffsets , offset ) ; } AnnotationInfo ( byte [ ] classFileBytes , int [ ] contantPoolOffsets , int offset , boolean runtimeVisible , boolean populate ) { this ( classFileBytes , contantPoolOffsets , offset ) ; if ( populate ) decodeAnnotation ( ) ; else this . readOffset = scanAnnotation ( <NUM_LIT:0> , runtimeVisible , true ) ; } private void decodeAnnotation ( ) { this . readOffset = <NUM_LIT:0> ; int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:0> ) ] - this . structOffset ; this . typename = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; int numberOfPairs = u2At ( <NUM_LIT:2> ) ; this . readOffset += <NUM_LIT:4> ; this . pairs = numberOfPairs == <NUM_LIT:0> ? ElementValuePairInfo . NoMembers : new ElementValuePairInfo [ numberOfPairs ] ; for ( int i = <NUM_LIT:0> ; i < numberOfPairs ; i ++ ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] membername = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; Object value = decodeDefaultValue ( ) ; this . pairs [ i ] = new ElementValuePairInfo ( membername , value ) ; } } Object decodeDefaultValue ( ) { Object value = null ; int tag = u1At ( this . readOffset ) ; this . readOffset ++ ; int constValueOffset = - <NUM_LIT:1> ; switch ( tag ) { case '<CHAR_LIT:Z>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = BooleanConstant . fromValue ( i4At ( constValueOffset + <NUM_LIT:1> ) == <NUM_LIT:1> ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = IntConstant . fromValue ( i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = CharConstant . fromValue ( ( char ) i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = ByteConstant . fromValue ( ( byte ) i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = ShortConstant . fromValue ( ( short ) i4At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = DoubleConstant . fromValue ( doubleAt ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = FloatConstant . fromValue ( floatAt ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = LongConstant . fromValue ( i8At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; value = StringConstant . fromValue ( String . valueOf ( utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ) ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT:e>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] typeName = utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] constName = utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ; this . readOffset += <NUM_LIT:2> ; value = new EnumConstantSignature ( typeName , constName ) ; break ; case '<CHAR_LIT:c>' : constValueOffset = this . constantPoolOffsets [ u2At ( this . readOffset ) ] - this . structOffset ; char [ ] className = utf8At ( constValueOffset + <NUM_LIT:3> , u2At ( constValueOffset + <NUM_LIT:1> ) ) ; value = new ClassSignature ( className ) ; this . readOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : value = new AnnotationInfo ( this . reference , this . constantPoolOffsets , this . readOffset + this . structOffset , false , true ) ; this . readOffset += ( ( AnnotationInfo ) value ) . readOffset ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( this . readOffset ) ; this . readOffset += <NUM_LIT:2> ; if ( numberOfValues == <NUM_LIT:0> ) { value = EmptyValueArray ; } else { Object [ ] arrayElements = new Object [ numberOfValues ] ; value = arrayElements ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) arrayElements [ i ] = decodeDefaultValue ( ) ; } break ; default : throw new IllegalStateException ( "<STR_LIT>" + ( char ) tag ) ; } return value ; } public IBinaryElementValuePair [ ] getElementValuePairs ( ) { if ( this . pairs == null ) initialize ( ) ; return this . pairs ; } public char [ ] getTypeName ( ) { return this . typename ; } void initialize ( ) { if ( this . pairs == null ) decodeAnnotation ( ) ; } private int readRetentionPolicy ( int offset ) { int currentOffset = offset ; int tag = u1At ( currentOffset ) ; currentOffset ++ ; switch ( tag ) { case '<CHAR_LIT:e>' : int utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] typeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; currentOffset += <NUM_LIT:2> ; if ( typeName . length == <NUM_LIT> && CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_RETENTIONPOLICY ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] constName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . standardAnnotationTagBits |= Annotation . getRetentionPolicy ( constName ) ; } currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : currentOffset = scanAnnotation ( currentOffset , false , false ) ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( currentOffset ) ; currentOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) currentOffset = scanElementValue ( currentOffset ) ; break ; default : throw new IllegalStateException ( ) ; } return currentOffset ; } private int readTargetValue ( int offset ) { int currentOffset = offset ; int tag = u1At ( currentOffset ) ; currentOffset ++ ; switch ( tag ) { case '<CHAR_LIT:e>' : int utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] typeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; currentOffset += <NUM_LIT:2> ; if ( typeName . length == <NUM_LIT> && CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_ELEMENTTYPE ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( currentOffset ) ] - this . structOffset ; char [ ] constName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . standardAnnotationTagBits |= Annotation . getTargetElementType ( constName ) ; } currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT>' : currentOffset = scanAnnotation ( currentOffset , false , false ) ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( currentOffset ) ; currentOffset += <NUM_LIT:2> ; if ( numberOfValues == <NUM_LIT:0> ) { this . standardAnnotationTagBits |= TagBits . AnnotationTarget ; } else { for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) currentOffset = readTargetValue ( currentOffset ) ; } break ; default : throw new IllegalStateException ( ) ; } return currentOffset ; } private int scanAnnotation ( int offset , boolean expectRuntimeVisibleAnno , boolean toplevel ) { int currentOffset = offset ; int utf8Offset = this . constantPoolOffsets [ u2At ( offset ) ] - this . structOffset ; char [ ] typeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( toplevel ) this . typename = typeName ; int numberOfPairs = u2At ( offset + <NUM_LIT:2> ) ; currentOffset += <NUM_LIT:4> ; if ( expectRuntimeVisibleAnno && toplevel ) { switch ( typeName . length ) { case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_DEPRECATED ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationDeprecated ; return currentOffset ; } break ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_TARGET ) ) { currentOffset += <NUM_LIT:2> ; return readTargetValue ( currentOffset ) ; } break ; case <NUM_LIT> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_DOCUMENTED ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationDocumented ; return currentOffset ; } break ; case <NUM_LIT:32> : if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_RETENTION ) ) { currentOffset += <NUM_LIT:2> ; return readRetentionPolicy ( currentOffset ) ; } if ( CharOperation . equals ( typeName , ConstantPool . JAVA_LANG_ANNOTATION_INHERITED ) ) { this . standardAnnotationTagBits |= TagBits . AnnotationInherited ; return currentOffset ; } break ; } } for ( int i = <NUM_LIT:0> ; i < numberOfPairs ; i ++ ) { currentOffset += <NUM_LIT:2> ; currentOffset = scanElementValue ( currentOffset ) ; } return currentOffset ; } private int scanElementValue ( int offset ) { int currentOffset = offset ; int tag = u1At ( currentOffset ) ; currentOffset ++ ; switch ( tag ) { case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT:c>' : currentOffset += <NUM_LIT:2> ; break ; case '<CHAR_LIT:e>' : currentOffset += <NUM_LIT:4> ; break ; case '<CHAR_LIT>' : currentOffset = scanAnnotation ( currentOffset , false , false ) ; break ; case '<CHAR_LIT:[>' : int numberOfValues = u2At ( currentOffset ) ; currentOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < numberOfValues ; i ++ ) currentOffset = scanElementValue ( currentOffset ) ; break ; default : throw new IllegalStateException ( ) ; } return currentOffset ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<CHAR_LIT>' ) ; buffer . append ( this . typename ) ; if ( this . pairs != null ) { buffer . append ( '<CHAR_LIT:(>' ) ; buffer . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> , len = this . pairs . length ; i < len ; i ++ ) { if ( i > <NUM_LIT:0> ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . pairs [ i ] ) ; } buffer . append ( '<CHAR_LIT:)>' ) ; } return buffer . toString ( ) ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + Util . hashCode ( this . pairs ) ; result = prime * result + CharOperation . hashCode ( this . typename ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } AnnotationInfo other = ( AnnotationInfo ) obj ; if ( ! Arrays . equals ( this . pairs , other . pairs ) ) { return false ; } if ( ! Arrays . equals ( this . typename , other . typename ) ) { return false ; } return true ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . io . File ; import java . io . IOException ; import java . io . InputStream ; import java . util . Arrays ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClassFileReader extends ClassFileStruct implements IBinaryType { private int accessFlags ; private char [ ] classFileName ; private char [ ] className ; private int classNameIndex ; private int constantPoolCount ; private AnnotationInfo [ ] annotations ; private FieldInfo [ ] fields ; private int fieldsCount ; private InnerClassInfo innerInfo ; private int innerInfoIndex ; private InnerClassInfo [ ] innerInfos ; private char [ ] [ ] interfaceNames ; private int interfacesCount ; private MethodInfo [ ] methods ; private int methodsCount ; private char [ ] signature ; private char [ ] sourceName ; private char [ ] sourceFileName ; private char [ ] superclassName ; private long tagBits ; private long version ; private char [ ] enclosingTypeName ; private char [ ] [ ] [ ] missingTypeNames ; private int enclosingNameAndTypeIndex ; private char [ ] enclosingMethod ; private static String printTypeModifiers ( int modifiers ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter print = new java . io . PrintWriter ( out ) ; if ( ( modifiers & ClassFileConstants . AccPublic ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccPrivate ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccFinal ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccSuper ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccInterface ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; if ( ( modifiers & ClassFileConstants . AccAbstract ) != <NUM_LIT:0> ) print . print ( "<STR_LIT>" ) ; print . flush ( ) ; return out . toString ( ) ; } public static ClassFileReader read ( File file ) throws ClassFormatException , IOException { return read ( file , false ) ; } public static ClassFileReader read ( File file , boolean fullyInitialize ) throws ClassFormatException , IOException { byte classFileBytes [ ] = Util . getFileByteContent ( file ) ; ClassFileReader classFileReader = new ClassFileReader ( classFileBytes , file . getAbsolutePath ( ) . toCharArray ( ) ) ; if ( fullyInitialize ) { classFileReader . initialize ( ) ; } return classFileReader ; } public static ClassFileReader read ( InputStream stream , String fileName ) throws ClassFormatException , IOException { return read ( stream , fileName , false ) ; } public static ClassFileReader read ( InputStream stream , String fileName , boolean fullyInitialize ) throws ClassFormatException , IOException { byte classFileBytes [ ] = Util . getInputStreamAsByteArray ( stream , - <NUM_LIT:1> ) ; ClassFileReader classFileReader = new ClassFileReader ( classFileBytes , fileName . toCharArray ( ) ) ; if ( fullyInitialize ) { classFileReader . initialize ( ) ; } return classFileReader ; } public static ClassFileReader read ( java . util . zip . ZipFile zip , String filename ) throws ClassFormatException , java . io . IOException { return read ( zip , filename , false ) ; } public static ClassFileReader read ( java . util . zip . ZipFile zip , String filename , boolean fullyInitialize ) throws ClassFormatException , java . io . IOException { java . util . zip . ZipEntry ze = zip . getEntry ( filename ) ; if ( ze == null ) return null ; byte classFileBytes [ ] = Util . getZipEntryByteContent ( ze , zip ) ; ClassFileReader classFileReader = new ClassFileReader ( classFileBytes , filename . toCharArray ( ) ) ; if ( fullyInitialize ) { classFileReader . initialize ( ) ; } return classFileReader ; } public static ClassFileReader read ( String fileName ) throws ClassFormatException , java . io . IOException { return read ( fileName , false ) ; } public static ClassFileReader read ( String fileName , boolean fullyInitialize ) throws ClassFormatException , java . io . IOException { return read ( new File ( fileName ) , fullyInitialize ) ; } public ClassFileReader ( byte classFileBytes [ ] , char [ ] fileName ) throws ClassFormatException { this ( classFileBytes , fileName , false ) ; } public ClassFileReader ( byte [ ] classFileBytes , char [ ] fileName , boolean fullyInitialize ) throws ClassFormatException { super ( classFileBytes , null , <NUM_LIT:0> ) ; this . classFileName = fileName ; int readOffset = <NUM_LIT:10> ; try { this . version = ( ( long ) u2At ( <NUM_LIT:6> ) << <NUM_LIT:16> ) + u2At ( <NUM_LIT:4> ) ; this . constantPoolCount = u2At ( <NUM_LIT:8> ) ; this . constantPoolOffsets = new int [ this . constantPoolCount ] ; for ( int i = <NUM_LIT:1> ; i < this . constantPoolCount ; i ++ ) { int tag = u1At ( readOffset ) ; switch ( tag ) { case ClassFileConstants . Utf8Tag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += u2At ( readOffset + <NUM_LIT:1> ) ; readOffset += ClassFileConstants . ConstantUtf8FixedSize ; break ; case ClassFileConstants . IntegerTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantIntegerFixedSize ; break ; case ClassFileConstants . FloatTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantFloatFixedSize ; break ; case ClassFileConstants . LongTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantLongFixedSize ; i ++ ; break ; case ClassFileConstants . DoubleTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantDoubleFixedSize ; i ++ ; break ; case ClassFileConstants . ClassTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantClassFixedSize ; break ; case ClassFileConstants . StringTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantStringFixedSize ; break ; case ClassFileConstants . FieldRefTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantFieldRefFixedSize ; break ; case ClassFileConstants . MethodRefTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantMethodRefFixedSize ; break ; case ClassFileConstants . InterfaceMethodRefTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantInterfaceMethodRefFixedSize ; break ; case ClassFileConstants . NameAndTypeTag : this . constantPoolOffsets [ i ] = readOffset ; readOffset += ClassFileConstants . ConstantNameAndTypeFixedSize ; } } this . accessFlags = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; this . classNameIndex = u2At ( readOffset ) ; this . className = getConstantClassNameAt ( this . classNameIndex ) ; readOffset += <NUM_LIT:2> ; int superclassNameIndex = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( superclassNameIndex != <NUM_LIT:0> ) { this . superclassName = getConstantClassNameAt ( superclassNameIndex ) ; } this . interfacesCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( this . interfacesCount != <NUM_LIT:0> ) { this . interfaceNames = new char [ this . interfacesCount ] [ ] ; for ( int i = <NUM_LIT:0> ; i < this . interfacesCount ; i ++ ) { this . interfaceNames [ i ] = getConstantClassNameAt ( u2At ( readOffset ) ) ; readOffset += <NUM_LIT:2> ; } } this . fieldsCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( this . fieldsCount != <NUM_LIT:0> ) { FieldInfo field ; this . fields = new FieldInfo [ this . fieldsCount ] ; for ( int i = <NUM_LIT:0> ; i < this . fieldsCount ; i ++ ) { field = FieldInfo . createField ( this . reference , this . constantPoolOffsets , readOffset ) ; this . fields [ i ] = field ; readOffset += field . sizeInBytes ( ) ; } } this . methodsCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; if ( this . methodsCount != <NUM_LIT:0> ) { this . methods = new MethodInfo [ this . methodsCount ] ; boolean isAnnotationType = ( this . accessFlags & ClassFileConstants . AccAnnotation ) != <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < this . methodsCount ; i ++ ) { this . methods [ i ] = isAnnotationType ? AnnotationMethodInfo . createAnnotationMethod ( this . reference , this . constantPoolOffsets , readOffset ) : MethodInfo . createMethod ( this . reference , this . constantPoolOffsets , readOffset ) ; readOffset += this . methods [ i ] . sizeInBytes ( ) ; } } int attributesCount = u2At ( readOffset ) ; readOffset += <NUM_LIT:2> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length == <NUM_LIT:0> ) { readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; continue ; } switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . EnclosingMethodName ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] + <NUM_LIT:1> ) ] ; this . enclosingTypeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . enclosingNameAndTypeIndex = u2At ( readOffset + <NUM_LIT:8> ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . DeprecatedName ) ) { this . accessFlags |= ClassFileConstants . AccDeprecated ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . InnerClassName ) ) { int innerOffset = readOffset + <NUM_LIT:6> ; int number_of_classes = u2At ( innerOffset ) ; if ( number_of_classes != <NUM_LIT:0> ) { innerOffset += <NUM_LIT:2> ; this . innerInfos = new InnerClassInfo [ number_of_classes ] ; for ( int j = <NUM_LIT:0> ; j < number_of_classes ; j ++ ) { this . innerInfos [ j ] = new InnerClassInfo ( this . reference , this . constantPoolOffsets , innerOffset ) ; if ( this . classNameIndex == this . innerInfos [ j ] . innerClassNameIndex ) { this . innerInfo = this . innerInfos [ j ] ; this . innerInfoIndex = j ; } innerOffset += <NUM_LIT:8> ; } if ( this . innerInfo != null ) { char [ ] enclosingType = this . innerInfo . getEnclosingTypeName ( ) ; if ( enclosingType != null ) { this . enclosingTypeName = enclosingType ; } } } } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . InconsistentHierarchy ) ) { this . tagBits |= TagBits . HierarchyHasProblems ; } break ; case '<CHAR_LIT>' : if ( attributeName . length > <NUM_LIT:2> ) { switch ( attributeName [ <NUM_LIT:1> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SourceName ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] ; this . sourceFileName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SyntheticName ) ) { this . accessFlags |= ClassFileConstants . AccSynthetic ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SignatureName ) ) { utf8Offset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] ; this . signature = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } } } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { decodeAnnotations ( readOffset , true ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { decodeAnnotations ( readOffset , false ) ; } break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . MissingTypesName ) ) { int missingTypeOffset = readOffset + <NUM_LIT:6> ; int numberOfMissingTypes = u2At ( missingTypeOffset ) ; if ( numberOfMissingTypes != <NUM_LIT:0> ) { this . missingTypeNames = new char [ numberOfMissingTypes ] [ ] [ ] ; missingTypeOffset += <NUM_LIT:2> ; for ( int j = <NUM_LIT:0> ; j < numberOfMissingTypes ; j ++ ) { utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ u2At ( missingTypeOffset ) ] + <NUM_LIT:1> ) ] ; char [ ] missingTypeConstantPoolName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; this . missingTypeNames [ j ] = CharOperation . splitOn ( '<CHAR_LIT:/>' , missingTypeConstantPoolName ) ; missingTypeOffset += <NUM_LIT:2> ; } } } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } if ( fullyInitialize ) { initialize ( ) ; } } catch ( ClassFormatException e ) { throw e ; } catch ( Exception e ) { throw new ClassFormatException ( ClassFormatException . ErrTruncatedInput , readOffset ) ; } } public int accessFlags ( ) { return this . accessFlags ; } private void decodeAnnotations ( int offset , boolean runtimeVisible ) { int numberOfAnnotations = u2At ( offset + <NUM_LIT:6> ) ; if ( numberOfAnnotations > <NUM_LIT:0> ) { int readOffset = offset + <NUM_LIT:8> ; AnnotationInfo [ ] newInfos = null ; int newInfoCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) { AnnotationInfo newInfo = new AnnotationInfo ( this . reference , this . constantPoolOffsets , readOffset , runtimeVisible , false ) ; readOffset += newInfo . readOffset ; long standardTagBits = newInfo . standardAnnotationTagBits ; if ( standardTagBits != <NUM_LIT:0> ) { this . tagBits |= standardTagBits ; } else { if ( newInfos == null ) newInfos = new AnnotationInfo [ numberOfAnnotations - i ] ; newInfos [ newInfoCount ++ ] = newInfo ; } } if ( newInfos == null ) return ; if ( this . annotations == null ) { if ( newInfoCount != newInfos . length ) System . arraycopy ( newInfos , <NUM_LIT:0> , newInfos = new AnnotationInfo [ newInfoCount ] , <NUM_LIT:0> , newInfoCount ) ; this . annotations = newInfos ; } else { int length = this . annotations . length ; AnnotationInfo [ ] temp = new AnnotationInfo [ length + newInfoCount ] ; System . arraycopy ( this . annotations , <NUM_LIT:0> , temp , <NUM_LIT:0> , length ) ; System . arraycopy ( newInfos , <NUM_LIT:0> , temp , length , newInfoCount ) ; this . annotations = temp ; } } } public IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } private char [ ] getConstantClassNameAt ( int constantPoolIndex ) { int utf8Offset = this . constantPoolOffsets [ u2At ( this . constantPoolOffsets [ constantPoolIndex ] + <NUM_LIT:1> ) ] ; return utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } public int [ ] getConstantPoolOffsets ( ) { return this . constantPoolOffsets ; } public char [ ] getEnclosingMethod ( ) { if ( this . enclosingNameAndTypeIndex <= <NUM_LIT:0> ) { return null ; } if ( this . enclosingMethod == null ) { StringBuffer buffer = new StringBuffer ( ) ; int nameAndTypeOffset = this . constantPoolOffsets [ this . enclosingNameAndTypeIndex ] ; int utf8Offset = this . constantPoolOffsets [ u2At ( nameAndTypeOffset + <NUM_LIT:1> ) ] ; buffer . append ( utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ) ; utf8Offset = this . constantPoolOffsets [ u2At ( nameAndTypeOffset + <NUM_LIT:3> ) ] ; buffer . append ( utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ) ; this . enclosingMethod = String . valueOf ( buffer ) . toCharArray ( ) ; } return this . enclosingMethod ; } public char [ ] getEnclosingTypeName ( ) { return this . enclosingTypeName ; } public IBinaryField [ ] getFields ( ) { return this . fields ; } public char [ ] getFileName ( ) { return this . classFileName ; } public char [ ] getGenericSignature ( ) { return this . signature ; } public char [ ] getInnerSourceName ( ) { if ( this . innerInfo != null ) return this . innerInfo . getSourceName ( ) ; return null ; } public char [ ] [ ] getInterfaceNames ( ) { return this . interfaceNames ; } public IBinaryNestedType [ ] getMemberTypes ( ) { if ( this . innerInfos == null ) return null ; int length = this . innerInfos . length ; int startingIndex = this . innerInfo != null ? this . innerInfoIndex + <NUM_LIT:1> : <NUM_LIT:0> ; if ( length != startingIndex ) { IBinaryNestedType [ ] memberTypes = new IBinaryNestedType [ length - this . innerInfoIndex ] ; int memberTypeIndex = <NUM_LIT:0> ; for ( int i = startingIndex ; i < length ; i ++ ) { InnerClassInfo currentInnerInfo = this . innerInfos [ i ] ; int outerClassNameIdx = currentInnerInfo . outerClassNameIndex ; int innerNameIndex = currentInnerInfo . innerNameIndex ; if ( outerClassNameIdx != <NUM_LIT:0> && innerNameIndex != <NUM_LIT:0> && outerClassNameIdx == this . classNameIndex && currentInnerInfo . getSourceName ( ) . length != <NUM_LIT:0> ) { memberTypes [ memberTypeIndex ++ ] = currentInnerInfo ; } } if ( memberTypeIndex == <NUM_LIT:0> ) return null ; if ( memberTypeIndex != memberTypes . length ) { System . arraycopy ( memberTypes , <NUM_LIT:0> , ( memberTypes = new IBinaryNestedType [ memberTypeIndex ] ) , <NUM_LIT:0> , memberTypeIndex ) ; } return memberTypes ; } return null ; } public IBinaryMethod [ ] getMethods ( ) { return this . methods ; } public char [ ] [ ] [ ] getMissingTypeNames ( ) { return this . missingTypeNames ; } public int getModifiers ( ) { int modifiers ; if ( this . innerInfo != null ) { modifiers = this . innerInfo . getModifiers ( ) | ( this . accessFlags & ClassFileConstants . AccDeprecated ) | ( this . accessFlags & ClassFileConstants . AccSynthetic ) ; } else { modifiers = this . accessFlags ; } return modifiers ; } public char [ ] getName ( ) { return this . className ; } public char [ ] getSourceName ( ) { if ( this . sourceName != null ) return this . sourceName ; char [ ] name = getInnerSourceName ( ) ; if ( name == null ) { name = getName ( ) ; int start ; if ( isAnonymous ( ) ) { start = CharOperation . indexOf ( '<CHAR_LIT>' , name , CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , name ) + <NUM_LIT:1> ) + <NUM_LIT:1> ; } else { start = CharOperation . lastIndexOf ( '<CHAR_LIT:/>' , name ) + <NUM_LIT:1> ; } if ( start > <NUM_LIT:0> ) { char [ ] newName = new char [ name . length - start ] ; System . arraycopy ( name , start , newName , <NUM_LIT:0> , newName . length ) ; name = newName ; } } return this . sourceName = name ; } public char [ ] getSuperclassName ( ) { return this . superclassName ; } public long getTagBits ( ) { return this . tagBits ; } public long getVersion ( ) { return this . version ; } private boolean hasNonSyntheticFieldChanges ( FieldInfo [ ] currentFieldInfos , FieldInfo [ ] otherFieldInfos ) { int length1 = currentFieldInfos == null ? <NUM_LIT:0> : currentFieldInfos . length ; int length2 = otherFieldInfos == null ? <NUM_LIT:0> : otherFieldInfos . length ; int index1 = <NUM_LIT:0> ; int index2 = <NUM_LIT:0> ; end : while ( index1 < length1 && index2 < length2 ) { while ( currentFieldInfos [ index1 ] . isSynthetic ( ) ) { if ( ++ index1 >= length1 ) break end ; } while ( otherFieldInfos [ index2 ] . isSynthetic ( ) ) { if ( ++ index2 >= length2 ) break end ; } if ( hasStructuralFieldChanges ( currentFieldInfos [ index1 ++ ] , otherFieldInfos [ index2 ++ ] ) ) return true ; } while ( index1 < length1 ) { if ( ! currentFieldInfos [ index1 ++ ] . isSynthetic ( ) ) return true ; } while ( index2 < length2 ) { if ( ! otherFieldInfos [ index2 ++ ] . isSynthetic ( ) ) return true ; } return false ; } private boolean hasNonSyntheticMethodChanges ( MethodInfo [ ] currentMethodInfos , MethodInfo [ ] otherMethodInfos ) { int length1 = currentMethodInfos == null ? <NUM_LIT:0> : currentMethodInfos . length ; int length2 = otherMethodInfos == null ? <NUM_LIT:0> : otherMethodInfos . length ; int index1 = <NUM_LIT:0> ; int index2 = <NUM_LIT:0> ; MethodInfo m ; end : while ( index1 < length1 && index2 < length2 ) { while ( ( m = currentMethodInfos [ index1 ] ) . isSynthetic ( ) || m . isClinit ( ) ) { if ( ++ index1 >= length1 ) break end ; } while ( ( m = otherMethodInfos [ index2 ] ) . isSynthetic ( ) || m . isClinit ( ) ) { if ( ++ index2 >= length2 ) break end ; } if ( hasStructuralMethodChanges ( currentMethodInfos [ index1 ++ ] , otherMethodInfos [ index2 ++ ] ) ) return true ; } while ( index1 < length1 ) { if ( ! ( ( m = currentMethodInfos [ index1 ++ ] ) . isSynthetic ( ) || m . isClinit ( ) ) ) return true ; } while ( index2 < length2 ) { if ( ! ( ( m = otherMethodInfos [ index2 ++ ] ) . isSynthetic ( ) || m . isClinit ( ) ) ) return true ; } return false ; } public boolean hasStructuralChanges ( byte [ ] newBytes ) { return hasStructuralChanges ( newBytes , true , true ) ; } public boolean hasStructuralChanges ( byte [ ] newBytes , boolean orderRequired , boolean excludesSynthetic ) { try { ClassFileReader newClassFile = new ClassFileReader ( newBytes , this . classFileName ) ; if ( getModifiers ( ) != newClassFile . getModifiers ( ) ) return true ; long OnlyStructuralTagBits = TagBits . AnnotationTargetMASK | TagBits . AnnotationDeprecated | TagBits . AnnotationRetentionMASK | TagBits . HierarchyHasProblems ; if ( ( getTagBits ( ) & OnlyStructuralTagBits ) != ( newClassFile . getTagBits ( ) & OnlyStructuralTagBits ) ) return true ; if ( hasStructuralAnnotationChanges ( getAnnotations ( ) , newClassFile . getAnnotations ( ) ) ) return true ; if ( ! CharOperation . equals ( getGenericSignature ( ) , newClassFile . getGenericSignature ( ) ) ) return true ; if ( ! CharOperation . equals ( getSuperclassName ( ) , newClassFile . getSuperclassName ( ) ) ) return true ; char [ ] [ ] newInterfacesNames = newClassFile . getInterfaceNames ( ) ; if ( this . interfaceNames != newInterfacesNames ) { int newInterfacesLength = newInterfacesNames == null ? <NUM_LIT:0> : newInterfacesNames . length ; if ( newInterfacesLength != this . interfacesCount ) return true ; for ( int i = <NUM_LIT:0> , max = this . interfacesCount ; i < max ; i ++ ) if ( ! CharOperation . equals ( this . interfaceNames [ i ] , newInterfacesNames [ i ] ) ) return true ; } IBinaryNestedType [ ] currentMemberTypes = getMemberTypes ( ) ; IBinaryNestedType [ ] otherMemberTypes = newClassFile . getMemberTypes ( ) ; if ( currentMemberTypes != otherMemberTypes ) { int currentMemberTypeLength = currentMemberTypes == null ? <NUM_LIT:0> : currentMemberTypes . length ; int otherMemberTypeLength = otherMemberTypes == null ? <NUM_LIT:0> : otherMemberTypes . length ; if ( currentMemberTypeLength != otherMemberTypeLength ) return true ; for ( int i = <NUM_LIT:0> ; i < currentMemberTypeLength ; i ++ ) if ( ! CharOperation . equals ( currentMemberTypes [ i ] . getName ( ) , otherMemberTypes [ i ] . getName ( ) ) || currentMemberTypes [ i ] . getModifiers ( ) != otherMemberTypes [ i ] . getModifiers ( ) ) return true ; } FieldInfo [ ] otherFieldInfos = ( FieldInfo [ ] ) newClassFile . getFields ( ) ; int otherFieldInfosLength = otherFieldInfos == null ? <NUM_LIT:0> : otherFieldInfos . length ; boolean compareFields = true ; if ( this . fieldsCount == otherFieldInfosLength ) { int i = <NUM_LIT:0> ; for ( ; i < this . fieldsCount ; i ++ ) if ( hasStructuralFieldChanges ( this . fields [ i ] , otherFieldInfos [ i ] ) ) break ; if ( ( compareFields = i != this . fieldsCount ) && ! orderRequired && ! excludesSynthetic ) return true ; } if ( compareFields ) { if ( this . fieldsCount != otherFieldInfosLength && ! excludesSynthetic ) return true ; if ( orderRequired ) { if ( this . fieldsCount != <NUM_LIT:0> ) Arrays . sort ( this . fields ) ; if ( otherFieldInfosLength != <NUM_LIT:0> ) Arrays . sort ( otherFieldInfos ) ; } if ( excludesSynthetic ) { if ( hasNonSyntheticFieldChanges ( this . fields , otherFieldInfos ) ) return true ; } else { for ( int i = <NUM_LIT:0> ; i < this . fieldsCount ; i ++ ) if ( hasStructuralFieldChanges ( this . fields [ i ] , otherFieldInfos [ i ] ) ) return true ; } } MethodInfo [ ] otherMethodInfos = ( MethodInfo [ ] ) newClassFile . getMethods ( ) ; int otherMethodInfosLength = otherMethodInfos == null ? <NUM_LIT:0> : otherMethodInfos . length ; boolean compareMethods = true ; if ( this . methodsCount == otherMethodInfosLength ) { int i = <NUM_LIT:0> ; for ( ; i < this . methodsCount ; i ++ ) if ( hasStructuralMethodChanges ( this . methods [ i ] , otherMethodInfos [ i ] ) ) break ; if ( ( compareMethods = i != this . methodsCount ) && ! orderRequired && ! excludesSynthetic ) return true ; } if ( compareMethods ) { if ( this . methodsCount != otherMethodInfosLength && ! excludesSynthetic ) return true ; if ( orderRequired ) { if ( this . methodsCount != <NUM_LIT:0> ) Arrays . sort ( this . methods ) ; if ( otherMethodInfosLength != <NUM_LIT:0> ) Arrays . sort ( otherMethodInfos ) ; } if ( excludesSynthetic ) { if ( hasNonSyntheticMethodChanges ( this . methods , otherMethodInfos ) ) return true ; } else { for ( int i = <NUM_LIT:0> ; i < this . methodsCount ; i ++ ) if ( hasStructuralMethodChanges ( this . methods [ i ] , otherMethodInfos [ i ] ) ) return true ; } } char [ ] [ ] [ ] missingTypes = getMissingTypeNames ( ) ; char [ ] [ ] [ ] newMissingTypes = newClassFile . getMissingTypeNames ( ) ; if ( missingTypes != null ) { if ( newMissingTypes == null ) { return true ; } int length = missingTypes . length ; if ( length != newMissingTypes . length ) { return true ; } for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( ! CharOperation . equals ( missingTypes [ i ] , newMissingTypes [ i ] ) ) { return true ; } } } else if ( newMissingTypes != null ) { return true ; } return false ; } catch ( ClassFormatException e ) { return true ; } } private boolean hasStructuralAnnotationChanges ( IBinaryAnnotation [ ] currentAnnotations , IBinaryAnnotation [ ] otherAnnotations ) { if ( currentAnnotations == otherAnnotations ) return false ; int currentAnnotationsLength = currentAnnotations == null ? <NUM_LIT:0> : currentAnnotations . length ; int otherAnnotationsLength = otherAnnotations == null ? <NUM_LIT:0> : otherAnnotations . length ; if ( currentAnnotationsLength != otherAnnotationsLength ) return true ; for ( int i = <NUM_LIT:0> ; i < currentAnnotationsLength ; i ++ ) { if ( ! CharOperation . equals ( currentAnnotations [ i ] . getTypeName ( ) , otherAnnotations [ i ] . getTypeName ( ) ) ) return true ; IBinaryElementValuePair [ ] currentPairs = currentAnnotations [ i ] . getElementValuePairs ( ) ; IBinaryElementValuePair [ ] otherPairs = otherAnnotations [ i ] . getElementValuePairs ( ) ; int currentPairsLength = currentPairs == null ? <NUM_LIT:0> : currentPairs . length ; int otherPairsLength = otherPairs == null ? <NUM_LIT:0> : otherPairs . length ; if ( currentPairsLength != otherPairsLength ) return true ; for ( int j = <NUM_LIT:0> ; j < currentPairsLength ; j ++ ) { if ( ! CharOperation . equals ( currentPairs [ j ] . getName ( ) , otherPairs [ j ] . getName ( ) ) ) return true ; final Object value = currentPairs [ j ] . getValue ( ) ; final Object value2 = otherPairs [ j ] . getValue ( ) ; if ( value instanceof Object [ ] ) { Object [ ] currentValues = ( Object [ ] ) value ; if ( value2 instanceof Object [ ] ) { Object [ ] currentValues2 = ( Object [ ] ) value2 ; final int length = currentValues . length ; if ( length != currentValues2 . length ) { return true ; } for ( int n = <NUM_LIT:0> ; n < length ; n ++ ) { if ( ! currentValues [ n ] . equals ( currentValues2 [ n ] ) ) { return true ; } } return false ; } return true ; } else if ( ! value . equals ( value2 ) ) { return true ; } } } return false ; } private boolean hasStructuralFieldChanges ( FieldInfo currentFieldInfo , FieldInfo otherFieldInfo ) { if ( ! CharOperation . equals ( currentFieldInfo . getGenericSignature ( ) , otherFieldInfo . getGenericSignature ( ) ) ) return true ; if ( currentFieldInfo . getModifiers ( ) != otherFieldInfo . getModifiers ( ) ) return true ; if ( ( currentFieldInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) != ( otherFieldInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) ) return true ; if ( hasStructuralAnnotationChanges ( currentFieldInfo . getAnnotations ( ) , otherFieldInfo . getAnnotations ( ) ) ) return true ; if ( ! CharOperation . equals ( currentFieldInfo . getName ( ) , otherFieldInfo . getName ( ) ) ) return true ; if ( ! CharOperation . equals ( currentFieldInfo . getTypeName ( ) , otherFieldInfo . getTypeName ( ) ) ) return true ; if ( currentFieldInfo . hasConstant ( ) != otherFieldInfo . hasConstant ( ) ) return true ; if ( currentFieldInfo . hasConstant ( ) ) { Constant currentConstant = currentFieldInfo . getConstant ( ) ; Constant otherConstant = otherFieldInfo . getConstant ( ) ; if ( currentConstant . typeID ( ) != otherConstant . typeID ( ) ) return true ; if ( ! currentConstant . getClass ( ) . equals ( otherConstant . getClass ( ) ) ) return true ; switch ( currentConstant . typeID ( ) ) { case TypeIds . T_int : return currentConstant . intValue ( ) != otherConstant . intValue ( ) ; case TypeIds . T_byte : return currentConstant . byteValue ( ) != otherConstant . byteValue ( ) ; case TypeIds . T_short : return currentConstant . shortValue ( ) != otherConstant . shortValue ( ) ; case TypeIds . T_char : return currentConstant . charValue ( ) != otherConstant . charValue ( ) ; case TypeIds . T_long : return currentConstant . longValue ( ) != otherConstant . longValue ( ) ; case TypeIds . T_float : return currentConstant . floatValue ( ) != otherConstant . floatValue ( ) ; case TypeIds . T_double : return currentConstant . doubleValue ( ) != otherConstant . doubleValue ( ) ; case TypeIds . T_boolean : return currentConstant . booleanValue ( ) != otherConstant . booleanValue ( ) ; case TypeIds . T_JavaLangString : return ! currentConstant . stringValue ( ) . equals ( otherConstant . stringValue ( ) ) ; } } return false ; } private boolean hasStructuralMethodChanges ( MethodInfo currentMethodInfo , MethodInfo otherMethodInfo ) { if ( ! CharOperation . equals ( currentMethodInfo . getGenericSignature ( ) , otherMethodInfo . getGenericSignature ( ) ) ) return true ; if ( currentMethodInfo . getModifiers ( ) != otherMethodInfo . getModifiers ( ) ) return true ; if ( ( currentMethodInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) != ( otherMethodInfo . getTagBits ( ) & TagBits . AnnotationDeprecated ) ) return true ; if ( hasStructuralAnnotationChanges ( currentMethodInfo . getAnnotations ( ) , otherMethodInfo . getAnnotations ( ) ) ) return true ; if ( ! CharOperation . equals ( currentMethodInfo . getSelector ( ) , otherMethodInfo . getSelector ( ) ) ) return true ; if ( ! CharOperation . equals ( currentMethodInfo . getMethodDescriptor ( ) , otherMethodInfo . getMethodDescriptor ( ) ) ) return true ; if ( ! CharOperation . equals ( currentMethodInfo . getGenericSignature ( ) , otherMethodInfo . getGenericSignature ( ) ) ) return true ; char [ ] [ ] currentThrownExceptions = currentMethodInfo . getExceptionTypeNames ( ) ; char [ ] [ ] otherThrownExceptions = otherMethodInfo . getExceptionTypeNames ( ) ; if ( currentThrownExceptions != otherThrownExceptions ) { int currentThrownExceptionsLength = currentThrownExceptions == null ? <NUM_LIT:0> : currentThrownExceptions . length ; int otherThrownExceptionsLength = otherThrownExceptions == null ? <NUM_LIT:0> : otherThrownExceptions . length ; if ( currentThrownExceptionsLength != otherThrownExceptionsLength ) return true ; for ( int k = <NUM_LIT:0> ; k < currentThrownExceptionsLength ; k ++ ) if ( ! CharOperation . equals ( currentThrownExceptions [ k ] , otherThrownExceptions [ k ] ) ) return true ; } return false ; } private void initialize ( ) throws ClassFormatException { try { for ( int i = <NUM_LIT:0> , max = this . fieldsCount ; i < max ; i ++ ) { this . fields [ i ] . initialize ( ) ; } for ( int i = <NUM_LIT:0> , max = this . methodsCount ; i < max ; i ++ ) { this . methods [ i ] . initialize ( ) ; } if ( this . innerInfos != null ) { for ( int i = <NUM_LIT:0> , max = this . innerInfos . length ; i < max ; i ++ ) { this . innerInfos [ i ] . initialize ( ) ; } } if ( this . annotations != null ) { for ( int i = <NUM_LIT:0> , max = this . annotations . length ; i < max ; i ++ ) { this . annotations [ i ] . initialize ( ) ; } } this . getEnclosingMethod ( ) ; reset ( ) ; } catch ( RuntimeException e ) { ClassFormatException exception = new ClassFormatException ( e , this . classFileName ) ; throw exception ; } } public boolean isAnonymous ( ) { if ( this . innerInfo == null ) return false ; char [ ] innerSourceName = this . innerInfo . getSourceName ( ) ; return ( innerSourceName == null || innerSourceName . length == <NUM_LIT:0> ) ; } public boolean isBinaryType ( ) { return true ; } public boolean isLocal ( ) { if ( this . innerInfo == null ) return false ; if ( this . innerInfo . getEnclosingTypeName ( ) != null ) return false ; char [ ] innerSourceName = this . innerInfo . getSourceName ( ) ; return ( innerSourceName != null && innerSourceName . length > <NUM_LIT:0> ) ; } public boolean isMember ( ) { if ( this . innerInfo == null ) return false ; if ( this . innerInfo . getEnclosingTypeName ( ) == null ) return false ; char [ ] innerSourceName = this . innerInfo . getSourceName ( ) ; return ( innerSourceName != null && innerSourceName . length > <NUM_LIT:0> ) ; } public boolean isNestedType ( ) { return this . innerInfo != null ; } public char [ ] sourceFileName ( ) { return this . sourceFileName ; } public String toString ( ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter print = new java . io . PrintWriter ( out ) ; print . println ( getClass ( ) . getName ( ) + "<STR_LIT:{>" ) ; print . println ( "<STR_LIT>" + new String ( getName ( ) ) ) ; print . println ( "<STR_LIT>" + ( getSuperclassName ( ) == null ? "<STR_LIT:null>" : new String ( getSuperclassName ( ) ) ) ) ; print . println ( "<STR_LIT>" + printTypeModifiers ( accessFlags ( ) ) + "<STR_LIT:(>" + accessFlags ( ) + "<STR_LIT:)>" ) ; print . flush ( ) ; return out . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; abstract public class ClassFileStruct { byte [ ] reference ; int [ ] constantPoolOffsets ; int structOffset ; public ClassFileStruct ( byte [ ] classFileBytes , int [ ] offsets , int offset ) { this . reference = classFileBytes ; this . constantPoolOffsets = offsets ; this . structOffset = offset ; } public double doubleAt ( int relativeOffset ) { return ( Double . longBitsToDouble ( i8At ( relativeOffset ) ) ) ; } public float floatAt ( int relativeOffset ) { return ( Float . intBitsToFloat ( i4At ( relativeOffset ) ) ) ; } public int i4At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( this . reference [ position ] & <NUM_LIT> ) ; } public long i8At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:32> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:24> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:16> ) | ( ( ( long ) ( this . reference [ position ++ ] & <NUM_LIT> ) ) << <NUM_LIT:8> ) | ( this . reference [ position ++ ] & <NUM_LIT> ) ; } protected void reset ( ) { this . reference = null ; this . constantPoolOffsets = null ; } public int u1At ( int relativeOffset ) { return ( this . reference [ relativeOffset + this . structOffset ] & <NUM_LIT> ) ; } public int u2At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) | ( this . reference [ position ] & <NUM_LIT> ) ; } public long u4At ( int relativeOffset ) { int position = relativeOffset + this . structOffset ; return ( ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) | ( ( this . reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) | ( this . reference [ position ] & <NUM_LIT> ) ) ; } public char [ ] utf8At ( int relativeOffset , int bytesAvailable ) { int length = bytesAvailable ; char outputBuf [ ] = new char [ bytesAvailable ] ; int outputPos = <NUM_LIT:0> ; int readOffset = this . structOffset + relativeOffset ; while ( length != <NUM_LIT:0> ) { int x = this . reference [ readOffset ++ ] & <NUM_LIT> ; length -- ; if ( ( <NUM_LIT> & x ) != <NUM_LIT:0> ) { if ( ( x & <NUM_LIT> ) != <NUM_LIT:0> ) { length -= <NUM_LIT:2> ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:12> ) | ( ( this . reference [ readOffset ++ ] & <NUM_LIT> ) << <NUM_LIT:6> ) | ( this . reference [ readOffset ++ ] & <NUM_LIT> ) ; } else { length -- ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:6> ) | ( this . reference [ readOffset ++ ] & <NUM_LIT> ) ; } } outputBuf [ outputPos ++ ] = ( char ) x ; } if ( outputPos != bytesAvailable ) { System . arraycopy ( outputBuf , <NUM_LIT:0> , ( outputBuf = new char [ outputPos ] ) , <NUM_LIT:0> , outputPos ) ; } return outputBuf ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public interface ClassFileConstants { int AccDefault = <NUM_LIT:0> ; int AccPublic = <NUM_LIT> ; int AccPrivate = <NUM_LIT> ; int AccProtected = <NUM_LIT> ; int AccStatic = <NUM_LIT> ; int AccFinal = <NUM_LIT> ; int AccSynchronized = <NUM_LIT> ; int AccVolatile = <NUM_LIT> ; int AccBridge = <NUM_LIT> ; int AccTransient = <NUM_LIT> ; int AccVarargs = <NUM_LIT> ; int AccNative = <NUM_LIT> ; int AccInterface = <NUM_LIT> ; int AccAbstract = <NUM_LIT> ; int AccStrictfp = <NUM_LIT> ; int AccSynthetic = <NUM_LIT> ; int AccAnnotation = <NUM_LIT> ; int AccEnum = <NUM_LIT> ; int AccSuper = <NUM_LIT> ; int AccAnnotationDefault = ASTNode . Bit18 ; int AccDeprecated = ASTNode . Bit21 ; int Utf8Tag = <NUM_LIT:1> ; int IntegerTag = <NUM_LIT:3> ; int FloatTag = <NUM_LIT:4> ; int LongTag = <NUM_LIT:5> ; int DoubleTag = <NUM_LIT:6> ; int ClassTag = <NUM_LIT:7> ; int StringTag = <NUM_LIT:8> ; int FieldRefTag = <NUM_LIT:9> ; int MethodRefTag = <NUM_LIT:10> ; int InterfaceMethodRefTag = <NUM_LIT:11> ; int NameAndTypeTag = <NUM_LIT:12> ; int ConstantMethodRefFixedSize = <NUM_LIT:5> ; int ConstantClassFixedSize = <NUM_LIT:3> ; int ConstantDoubleFixedSize = <NUM_LIT:9> ; int ConstantFieldRefFixedSize = <NUM_LIT:5> ; int ConstantFloatFixedSize = <NUM_LIT:5> ; int ConstantIntegerFixedSize = <NUM_LIT:5> ; int ConstantInterfaceMethodRefFixedSize = <NUM_LIT:5> ; int ConstantLongFixedSize = <NUM_LIT:9> ; int ConstantStringFixedSize = <NUM_LIT:3> ; int ConstantUtf8FixedSize = <NUM_LIT:3> ; int ConstantNameAndTypeFixedSize = <NUM_LIT:5> ; int MAJOR_VERSION_1_1 = <NUM_LIT> ; int MAJOR_VERSION_1_2 = <NUM_LIT> ; int MAJOR_VERSION_1_3 = <NUM_LIT> ; int MAJOR_VERSION_1_4 = <NUM_LIT> ; int MAJOR_VERSION_1_5 = <NUM_LIT> ; int MAJOR_VERSION_1_6 = <NUM_LIT> ; int MAJOR_VERSION_1_7 = <NUM_LIT> ; int MINOR_VERSION_0 = <NUM_LIT:0> ; int MINOR_VERSION_1 = <NUM_LIT:1> ; int MINOR_VERSION_2 = <NUM_LIT:2> ; int MINOR_VERSION_3 = <NUM_LIT:3> ; int MINOR_VERSION_4 = <NUM_LIT:4> ; long JDK1_1 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_1 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_3 ; long JDK1_2 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_2 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_3 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_3 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_4 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_4 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_5 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_5 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_6 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_6 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long JDK1_7 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_7 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_0 ; long CLDC_1_1 = ( ( long ) ClassFileConstants . MAJOR_VERSION_1_1 << <NUM_LIT:16> ) + ClassFileConstants . MINOR_VERSION_4 ; long JDK_DEFERRED = Long . MAX_VALUE ; int INT_ARRAY = <NUM_LIT:10> ; int BYTE_ARRAY = <NUM_LIT:8> ; int BOOLEAN_ARRAY = <NUM_LIT:4> ; int SHORT_ARRAY = <NUM_LIT:9> ; int CHAR_ARRAY = <NUM_LIT:5> ; int LONG_ARRAY = <NUM_LIT:11> ; int FLOAT_ARRAY = <NUM_LIT:6> ; int DOUBLE_ARRAY = <NUM_LIT:7> ; int ATTR_SOURCE = <NUM_LIT> ; int ATTR_LINES = <NUM_LIT> ; int ATTR_VARS = <NUM_LIT> ; int ATTR_STACK_MAP_TABLE = <NUM_LIT> ; int ATTR_STACK_MAP = <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; public class MethodInfoWithAnnotations extends MethodInfo { protected AnnotationInfo [ ] annotations ; MethodInfoWithAnnotations ( MethodInfo methodInfo , AnnotationInfo [ ] annotations ) { super ( methodInfo . reference , methodInfo . constantPoolOffsets , methodInfo . structOffset ) ; this . annotations = annotations ; this . accessFlags = methodInfo . accessFlags ; this . attributeBytes = methodInfo . attributeBytes ; this . descriptor = methodInfo . descriptor ; this . exceptionNames = methodInfo . exceptionNames ; this . name = methodInfo . name ; this . signature = methodInfo . signature ; this . signatureUtf8Offset = methodInfo . signatureUtf8Offset ; this . tagBits = methodInfo . tagBits ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return this . annotations ; } protected void initialize ( ) { for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) if ( this . annotations [ i ] != null ) this . annotations [ i ] . initialize ( ) ; super . initialize ( ) ; } protected void reset ( ) { for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) if ( this . annotations [ i ] != null ) this . annotations [ i ] . reset ( ) ; super . reset ( ) ; } protected void toStringContent ( StringBuffer buffer ) { super . toStringContent ( buffer ) ; for ( int i = <NUM_LIT:0> , l = this . annotations == null ? <NUM_LIT:0> : this . annotations . length ; i < l ; i ++ ) { buffer . append ( this . annotations [ i ] ) ; buffer . append ( '<STR_LIT:\n>' ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import java . io . PrintStream ; import java . io . PrintWriter ; public class ClassFormatException extends Exception { public static final int ErrBadMagic = <NUM_LIT:1> ; public static final int ErrBadMinorVersion = <NUM_LIT:2> ; public static final int ErrBadMajorVersion = <NUM_LIT:3> ; public static final int ErrBadConstantClass = <NUM_LIT:4> ; public static final int ErrBadConstantString = <NUM_LIT:5> ; public static final int ErrBadConstantNameAndType = <NUM_LIT:6> ; public static final int ErrBadConstantFieldRef = <NUM_LIT:7> ; public static final int ErrBadConstantMethodRef = <NUM_LIT:8> ; public static final int ErrBadConstantInterfaceMethodRef = <NUM_LIT:9> ; public static final int ErrBadConstantPoolIndex = <NUM_LIT:10> ; public static final int ErrBadSuperclassName = <NUM_LIT:11> ; public static final int ErrInterfaceCannotBeFinal = <NUM_LIT:12> ; public static final int ErrInterfaceMustBeAbstract = <NUM_LIT> ; public static final int ErrBadModifiers = <NUM_LIT> ; public static final int ErrClassCannotBeAbstractFinal = <NUM_LIT:15> ; public static final int ErrBadClassname = <NUM_LIT:16> ; public static final int ErrBadFieldInfo = <NUM_LIT> ; public static final int ErrBadMethodInfo = <NUM_LIT> ; public static final int ErrEmptyConstantPool = <NUM_LIT> ; public static final int ErrMalformedUtf8 = <NUM_LIT> ; public static final int ErrUnknownConstantTag = <NUM_LIT:20> ; public static final int ErrTruncatedInput = <NUM_LIT> ; public static final int ErrMethodMustBeAbstract = <NUM_LIT> ; public static final int ErrMalformedAttribute = <NUM_LIT> ; public static final int ErrBadInterface = <NUM_LIT:24> ; public static final int ErrInterfaceMustSubclassObject = <NUM_LIT> ; public static final int ErrIncorrectInterfaceMethods = <NUM_LIT> ; public static final int ErrInvalidMethodName = <NUM_LIT> ; public static final int ErrInvalidMethodSignature = <NUM_LIT> ; private static final long serialVersionUID = <NUM_LIT> ; private int errorCode ; private int bufferPosition ; private RuntimeException nestedException ; private char [ ] fileName ; public ClassFormatException ( RuntimeException e , char [ ] fileName ) { this . nestedException = e ; this . fileName = fileName ; } public ClassFormatException ( int code ) { this . errorCode = code ; } public ClassFormatException ( int code , int bufPos ) { this . errorCode = code ; this . bufferPosition = bufPos ; } public int getErrorCode ( ) { return this . errorCode ; } public int getBufferPosition ( ) { return this . bufferPosition ; } public Throwable getException ( ) { return this . nestedException ; } public void printStackTrace ( ) { printStackTrace ( System . err ) ; } public void printStackTrace ( PrintStream output ) { synchronized ( output ) { super . printStackTrace ( output ) ; Throwable throwable = getException ( ) ; if ( throwable != null ) { if ( this . fileName != null ) { output . print ( "<STR_LIT>" ) ; output . print ( this . fileName ) ; output . print ( "<STR_LIT>" ) ; } else { output . print ( "<STR_LIT>" ) ; } throwable . printStackTrace ( output ) ; } } } public void printStackTrace ( PrintWriter output ) { synchronized ( output ) { super . printStackTrace ( output ) ; Throwable throwable = getException ( ) ; if ( throwable != null ) { if ( this . fileName != null ) { output . print ( "<STR_LIT>" ) ; output . print ( this . fileName ) ; output . print ( "<STR_LIT>" ) ; } else { output . print ( "<STR_LIT>" ) ; } throwable . printStackTrace ( output ) ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . classfmt ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryField ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . util . Util ; public class FieldInfo extends ClassFileStruct implements IBinaryField , Comparable { protected int accessFlags ; protected int attributeBytes ; protected Constant constant ; protected char [ ] descriptor ; protected char [ ] name ; protected char [ ] signature ; protected int signatureUtf8Offset ; protected long tagBits ; protected Object wrappedConstantValue ; public static FieldInfo createField ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { FieldInfo fieldInfo = new FieldInfo ( classFileBytes , offsets , offset ) ; AnnotationInfo [ ] annotations = fieldInfo . readAttributes ( ) ; if ( annotations == null ) return fieldInfo ; return new FieldInfoWithAnnotation ( fieldInfo , annotations ) ; } protected FieldInfo ( byte classFileBytes [ ] , int offsets [ ] , int offset ) { super ( classFileBytes , offsets , offset ) ; this . accessFlags = - <NUM_LIT:1> ; this . signatureUtf8Offset = - <NUM_LIT:1> ; } private AnnotationInfo [ ] decodeAnnotations ( int offset , boolean runtimeVisible ) { int numberOfAnnotations = u2At ( offset + <NUM_LIT:6> ) ; if ( numberOfAnnotations > <NUM_LIT:0> ) { int readOffset = offset + <NUM_LIT:8> ; AnnotationInfo [ ] newInfos = null ; int newInfoCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < numberOfAnnotations ; i ++ ) { AnnotationInfo newInfo = new AnnotationInfo ( this . reference , this . constantPoolOffsets , readOffset + this . structOffset , runtimeVisible , false ) ; readOffset += newInfo . readOffset ; long standardTagBits = newInfo . standardAnnotationTagBits ; if ( standardTagBits != <NUM_LIT:0> ) { this . tagBits |= standardTagBits ; } else { if ( newInfos == null ) newInfos = new AnnotationInfo [ numberOfAnnotations - i ] ; newInfos [ newInfoCount ++ ] = newInfo ; } } if ( newInfos != null ) { if ( newInfoCount != newInfos . length ) System . arraycopy ( newInfos , <NUM_LIT:0> , newInfos = new AnnotationInfo [ newInfoCount ] , <NUM_LIT:0> , newInfoCount ) ; return newInfos ; } } return null ; } public int compareTo ( Object o ) { return new String ( getName ( ) ) . compareTo ( new String ( ( ( FieldInfo ) o ) . getName ( ) ) ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof FieldInfo ) ) { return false ; } return CharOperation . equals ( getName ( ) , ( ( FieldInfo ) o ) . getName ( ) ) ; } public int hashCode ( ) { return CharOperation . hashCode ( getName ( ) ) ; } public Constant getConstant ( ) { if ( this . constant == null ) { readConstantAttribute ( ) ; } return this . constant ; } public char [ ] getGenericSignature ( ) { if ( this . signatureUtf8Offset != - <NUM_LIT:1> ) { if ( this . signature == null ) { this . signature = utf8At ( this . signatureUtf8Offset + <NUM_LIT:3> , u2At ( this . signatureUtf8Offset + <NUM_LIT:1> ) ) ; } return this . signature ; } return null ; } public int getModifiers ( ) { if ( this . accessFlags == - <NUM_LIT:1> ) { this . accessFlags = u2At ( <NUM_LIT:0> ) ; readModifierRelatedAttributes ( ) ; } return this . accessFlags ; } public char [ ] getName ( ) { if ( this . name == null ) { int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:2> ) ] - this . structOffset ; this . name = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } return this . name ; } public long getTagBits ( ) { return this . tagBits ; } public char [ ] getTypeName ( ) { if ( this . descriptor == null ) { int utf8Offset = this . constantPoolOffsets [ u2At ( <NUM_LIT:4> ) ] - this . structOffset ; this . descriptor = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; } return this . descriptor ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return null ; } public Object getWrappedConstantValue ( ) { if ( this . wrappedConstantValue == null ) { if ( hasConstant ( ) ) { Constant fieldConstant = getConstant ( ) ; switch ( fieldConstant . typeID ( ) ) { case TypeIds . T_int : this . wrappedConstantValue = new Integer ( fieldConstant . intValue ( ) ) ; break ; case TypeIds . T_byte : this . wrappedConstantValue = new Byte ( fieldConstant . byteValue ( ) ) ; break ; case TypeIds . T_short : this . wrappedConstantValue = new Short ( fieldConstant . shortValue ( ) ) ; break ; case TypeIds . T_char : this . wrappedConstantValue = new Character ( fieldConstant . charValue ( ) ) ; break ; case TypeIds . T_float : this . wrappedConstantValue = new Float ( fieldConstant . floatValue ( ) ) ; break ; case TypeIds . T_double : this . wrappedConstantValue = new Double ( fieldConstant . doubleValue ( ) ) ; break ; case TypeIds . T_boolean : this . wrappedConstantValue = Util . toBoolean ( fieldConstant . booleanValue ( ) ) ; break ; case TypeIds . T_long : this . wrappedConstantValue = new Long ( fieldConstant . longValue ( ) ) ; break ; case TypeIds . T_JavaLangString : this . wrappedConstantValue = fieldConstant . stringValue ( ) ; } } } return this . wrappedConstantValue ; } public boolean hasConstant ( ) { return getConstant ( ) != Constant . NotAConstant ; } protected void initialize ( ) { getModifiers ( ) ; getName ( ) ; getConstant ( ) ; getTypeName ( ) ; getGenericSignature ( ) ; reset ( ) ; } public boolean isSynthetic ( ) { return ( getModifiers ( ) & ClassFileConstants . AccSynthetic ) != <NUM_LIT:0> ; } private AnnotationInfo [ ] readAttributes ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; AnnotationInfo [ ] annotations = null ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length > <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( AttributeNamesConstants . SignatureName , attributeName ) ) this . signatureUtf8Offset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] - this . structOffset ; break ; case '<CHAR_LIT>' : AnnotationInfo [ ] decodedAnnotations = null ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ) { decodedAnnotations = decodeAnnotations ( readOffset , true ) ; } else if ( CharOperation . equals ( attributeName , AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ) { decodedAnnotations = decodeAnnotations ( readOffset , false ) ; } if ( decodedAnnotations != null ) { if ( annotations == null ) { annotations = decodedAnnotations ; } else { int length = annotations . length ; AnnotationInfo [ ] combined = new AnnotationInfo [ length + decodedAnnotations . length ] ; System . arraycopy ( annotations , <NUM_LIT:0> , combined , <NUM_LIT:0> , length ) ; System . arraycopy ( decodedAnnotations , <NUM_LIT:0> , combined , length , decodedAnnotations . length ) ; annotations = combined ; } } } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } this . attributeBytes = readOffset ; return annotations ; } private void readConstantAttribute ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; boolean isConstant = false ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( CharOperation . equals ( attributeName , AttributeNamesConstants . ConstantValueName ) ) { isConstant = true ; int relativeOffset = this . constantPoolOffsets [ u2At ( readOffset + <NUM_LIT:6> ) ] - this . structOffset ; switch ( u1At ( relativeOffset ) ) { case ClassFileConstants . IntegerTag : char [ ] sign = getTypeName ( ) ; if ( sign . length == <NUM_LIT:1> ) { switch ( sign [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : this . constant = BooleanConstant . fromValue ( i4At ( relativeOffset + <NUM_LIT:1> ) == <NUM_LIT:1> ) ; break ; case '<CHAR_LIT>' : this . constant = IntConstant . fromValue ( i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case '<CHAR_LIT>' : this . constant = CharConstant . fromValue ( ( char ) i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case '<CHAR_LIT>' : this . constant = ByteConstant . fromValue ( ( byte ) i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case '<CHAR_LIT>' : this . constant = ShortConstant . fromValue ( ( short ) i4At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; default : this . constant = Constant . NotAConstant ; } } else { this . constant = Constant . NotAConstant ; } break ; case ClassFileConstants . FloatTag : this . constant = FloatConstant . fromValue ( floatAt ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case ClassFileConstants . DoubleTag : this . constant = DoubleConstant . fromValue ( doubleAt ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case ClassFileConstants . LongTag : this . constant = LongConstant . fromValue ( i8At ( relativeOffset + <NUM_LIT:1> ) ) ; break ; case ClassFileConstants . StringTag : utf8Offset = this . constantPoolOffsets [ u2At ( relativeOffset + <NUM_LIT:1> ) ] - this . structOffset ; this . constant = StringConstant . fromValue ( String . valueOf ( utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ) ) ; break ; } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } if ( ! isConstant ) { this . constant = Constant . NotAConstant ; } } private void readModifierRelatedAttributes ( ) { int attributesCount = u2At ( <NUM_LIT:6> ) ; int readOffset = <NUM_LIT:8> ; for ( int i = <NUM_LIT:0> ; i < attributesCount ; i ++ ) { int utf8Offset = this . constantPoolOffsets [ u2At ( readOffset ) ] - this . structOffset ; char [ ] attributeName = utf8At ( utf8Offset + <NUM_LIT:3> , u2At ( utf8Offset + <NUM_LIT:1> ) ) ; if ( attributeName . length != <NUM_LIT:0> ) { switch ( attributeName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . DeprecatedName ) ) this . accessFlags |= ClassFileConstants . AccDeprecated ; break ; case '<CHAR_LIT>' : if ( CharOperation . equals ( attributeName , AttributeNamesConstants . SyntheticName ) ) this . accessFlags |= ClassFileConstants . AccSynthetic ; break ; } } readOffset += ( <NUM_LIT:6> + u4At ( readOffset + <NUM_LIT:2> ) ) ; } } public int sizeInBytes ( ) { return this . attributeBytes ; } public void throwFormatException ( ) throws ClassFormatException { throw new ClassFormatException ( ClassFormatException . ErrBadFieldInfo ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( getClass ( ) . getName ( ) ) ; toStringContent ( buffer ) ; return buffer . toString ( ) ; } protected void toStringContent ( StringBuffer buffer ) { int modifiers = getModifiers ( ) ; buffer . append ( '<CHAR_LIT>' ) . append ( ( ( modifiers & ClassFileConstants . AccDeprecated ) != <NUM_LIT:0> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT:1> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) + ( ( modifiers & <NUM_LIT> ) == <NUM_LIT> ? "<STR_LIT>" : Util . EMPTY_STRING ) ) . append ( getTypeName ( ) ) . append ( '<CHAR_LIT:U+0020>' ) . append ( getName ( ) ) . append ( '<CHAR_LIT:U+0020>' ) . append ( getConstant ( ) ) . append ( '<CHAR_LIT:}>' ) . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . ast . AnnotationMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . ArrayInitializer ; import org . eclipse . jdt . internal . compiler . ast . ClassLiteralAccess ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . MemberValuePair ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . NormalAnnotation ; import org . eclipse . jdt . internal . compiler . ast . QualifiedNameReference ; import org . eclipse . jdt . internal . compiler . ast . SingleMemberAnnotation ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . codegen . AttributeNamesConstants ; import org . eclipse . jdt . internal . compiler . codegen . CodeStream ; import org . eclipse . jdt . internal . compiler . codegen . ConstantPool ; import org . eclipse . jdt . internal . compiler . codegen . ExceptionLabel ; import org . eclipse . jdt . internal . compiler . codegen . Opcodes ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrame ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream ; import org . eclipse . jdt . internal . compiler . codegen . VerificationTypeInfo ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream . ExceptionMarker ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream . StackDepthMarker ; import org . eclipse . jdt . internal . compiler . codegen . StackMapFrameCodeStream . StackMarker ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . Constant ; import org . eclipse . jdt . internal . compiler . impl . StringConstant ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . FieldBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; import org . eclipse . jdt . internal . compiler . lookup . LookupEnvironment ; import org . eclipse . jdt . internal . compiler . lookup . MethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . NestedTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; import org . eclipse . jdt . internal . compiler . lookup . SourceTypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . SyntheticArgumentBinding ; import org . eclipse . jdt . internal . compiler . lookup . SyntheticMethodBinding ; import org . eclipse . jdt . internal . compiler . lookup . TagBits ; import org . eclipse . jdt . internal . compiler . lookup . TypeBinding ; import org . eclipse . jdt . internal . compiler . lookup . TypeConstants ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . lookup . TypeVariableBinding ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . problem . ShouldNotImplement ; import org . eclipse . jdt . internal . compiler . util . Messages ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClassFile implements TypeConstants , TypeIds { private byte [ ] bytes ; public CodeStream codeStream ; public ConstantPool constantPool ; public int constantPoolOffset ; public byte [ ] contents ; public int contentsOffset ; protected boolean creatingProblemType ; public ClassFile enclosingClassFile ; public byte [ ] header ; public int headerOffset ; public Set innerClassesBindings ; public int methodCount ; public int methodCountOffset ; boolean isShared = false ; public int produceAttributes ; public SourceTypeBinding referenceBinding ; public boolean isNestedType ; public long targetJDK ; public List missingTypes = null ; public Set visitedTypes ; public static final int INITIAL_CONTENTS_SIZE = <NUM_LIT> ; public static final int INITIAL_HEADER_SIZE = <NUM_LIT> ; public static final int INNER_CLASSES_SIZE = <NUM_LIT:5> ; public static void createProblemType ( TypeDeclaration typeDeclaration , CompilationResult unitResult ) { SourceTypeBinding typeBinding = typeDeclaration . binding ; ClassFile classFile = ClassFile . getNewInstance ( typeBinding ) ; classFile . initialize ( typeBinding , null , true ) ; if ( typeBinding . hasMemberTypes ( ) ) { ReferenceBinding [ ] members = typeBinding . memberTypes ; for ( int i = <NUM_LIT:0> , l = members . length ; i < l ; i ++ ) classFile . recordInnerClasses ( members [ i ] ) ; } if ( typeBinding . isNestedType ( ) ) { classFile . recordInnerClasses ( typeBinding ) ; } TypeVariableBinding [ ] typeVariables = typeBinding . typeVariables ( ) ; for ( int i = <NUM_LIT:0> , max = typeVariables . length ; i < max ; i ++ ) { TypeVariableBinding typeVariableBinding = typeVariables [ i ] ; if ( ( typeVariableBinding . tagBits & TagBits . ContainsNestedTypeReferences ) != <NUM_LIT:0> ) { Util . recordNestedType ( classFile , typeVariableBinding ) ; } } FieldBinding [ ] fields = typeBinding . fields ( ) ; if ( ( fields != null ) && ( fields != Binding . NO_FIELDS ) ) { classFile . addFieldInfos ( ) ; } else { classFile . contents [ classFile . contentsOffset ++ ] = <NUM_LIT:0> ; classFile . contents [ classFile . contentsOffset ++ ] = <NUM_LIT:0> ; } classFile . setForMethodInfos ( ) ; int problemsLength ; CategorizedProblem [ ] problems = unitResult . getErrors ( ) ; if ( problems == null ) { problems = new CategorizedProblem [ <NUM_LIT:0> ] ; } CategorizedProblem [ ] problemsCopy = new CategorizedProblem [ problemsLength = problems . length ] ; System . arraycopy ( problems , <NUM_LIT:0> , problemsCopy , <NUM_LIT:0> , problemsLength ) ; AbstractMethodDeclaration [ ] methodDecls = typeDeclaration . methods ; if ( methodDecls != null ) { if ( typeBinding . isInterface ( ) ) { classFile . addProblemClinit ( problemsCopy ) ; for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { AbstractMethodDeclaration methodDecl = methodDecls [ i ] ; MethodBinding method = methodDecl . binding ; if ( method == null || method . isConstructor ( ) ) continue ; method . modifiers = ClassFileConstants . AccPublic | ClassFileConstants . AccAbstract ; classFile . addAbstractMethod ( methodDecl , method ) ; } } else { for ( int i = <NUM_LIT:0> , length = methodDecls . length ; i < length ; i ++ ) { AbstractMethodDeclaration methodDecl = methodDecls [ i ] ; MethodBinding method = methodDecl . binding ; if ( method == null ) continue ; if ( method . isConstructor ( ) ) { classFile . addProblemConstructor ( methodDecl , method , problemsCopy ) ; } else if ( method . isAbstract ( ) ) { classFile . addAbstractMethod ( methodDecl , method ) ; } else { classFile . addProblemMethod ( methodDecl , method , problemsCopy ) ; } } } classFile . addDefaultAbstractMethods ( ) ; } if ( typeDeclaration . memberTypes != null ) { for ( int i = <NUM_LIT:0> , max = typeDeclaration . memberTypes . length ; i < max ; i ++ ) { TypeDeclaration memberType = typeDeclaration . memberTypes [ i ] ; if ( memberType . binding != null ) { ClassFile . createProblemType ( memberType , unitResult ) ; } } } classFile . addAttributes ( ) ; unitResult . record ( typeBinding . constantPoolName ( ) , classFile ) ; } public static ClassFile getNewInstance ( SourceTypeBinding typeBinding ) { LookupEnvironment env = typeBinding . scope . environment ( ) ; return env . classFilePool . acquire ( typeBinding ) ; } protected ClassFile ( ) { } public ClassFile ( SourceTypeBinding typeBinding ) { this . constantPool = new ConstantPool ( this ) ; final CompilerOptions options = typeBinding . scope . compilerOptions ( ) ; this . targetJDK = options . targetJDK ; this . produceAttributes = options . produceDebugAttributes ; this . referenceBinding = typeBinding ; this . isNestedType = typeBinding . isNestedType ( ) ; if ( this . targetJDK >= ClassFileConstants . JDK1_6 ) { this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP_TABLE ; this . codeStream = new StackMapFrameCodeStream ( this ) ; } else if ( this . targetJDK == ClassFileConstants . CLDC_1_1 ) { this . targetJDK = ClassFileConstants . JDK1_1 ; this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP ; this . codeStream = new StackMapFrameCodeStream ( this ) ; } else { this . codeStream = new CodeStream ( this ) ; } initByteArrays ( ) ; } public void addAbstractMethod ( AbstractMethodDeclaration method , MethodBinding methodBinding ) { this . generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = this . generateMethodInfoAttribute ( methodBinding ) ; completeMethodInfo ( methodAttributeOffset , attributeNumber ) ; } public void addAttributes ( ) { this . contents [ this . methodCountOffset ++ ] = ( byte ) ( this . methodCount > > <NUM_LIT:8> ) ; this . contents [ this . methodCountOffset ] = ( byte ) this . methodCount ; int attributesNumber = <NUM_LIT:0> ; int attributeOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; if ( ( this . produceAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ) { String fullFileName = new String ( this . referenceBinding . scope . referenceCompilationUnit ( ) . getFileName ( ) ) ; fullFileName = fullFileName . replace ( '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; int lastIndex = fullFileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; if ( lastIndex != - <NUM_LIT:1> ) { fullFileName = fullFileName . substring ( lastIndex + <NUM_LIT:1> , fullFileName . length ( ) ) ; } if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int sourceAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SourceName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( sourceAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) sourceAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:2> ; int fileNameIndex = this . constantPool . literalIndex ( fullFileName . toCharArray ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( fileNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) fileNameIndex ; attributesNumber ++ ; } if ( this . referenceBinding . isDeprecated ( ) ) { if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int deprecatedAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . DeprecatedName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( deprecatedAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) deprecatedAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributesNumber ++ ; } char [ ] genericSignature = this . referenceBinding . genericSignature ( ) ; if ( genericSignature != null ) { if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int signatureAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SignatureName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( signatureAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) signatureAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:2> ; int signatureIndex = this . constantPool . literalIndex ( genericSignature ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( signatureIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) signatureIndex ; attributesNumber ++ ; } if ( this . targetJDK >= ClassFileConstants . JDK1_5 && this . referenceBinding . isNestedType ( ) && ! this . referenceBinding . isMemberType ( ) ) { if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } int enclosingMethodAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . EnclosingMethodName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( enclosingMethodAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) enclosingMethodAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:4> ; int enclosingTypeIndex = this . constantPool . literalIndexForType ( this . referenceBinding . enclosingType ( ) . constantPoolName ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( enclosingTypeIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) enclosingTypeIndex ; byte methodIndexByte1 = <NUM_LIT:0> ; byte methodIndexByte2 = <NUM_LIT:0> ; if ( this . referenceBinding instanceof LocalTypeBinding ) { MethodBinding methodBinding = ( ( LocalTypeBinding ) this . referenceBinding ) . enclosingMethod ; if ( methodBinding != null ) { int enclosingMethodIndex = this . constantPool . literalIndexForNameAndType ( methodBinding . selector , methodBinding . signature ( this ) ) ; methodIndexByte1 = ( byte ) ( enclosingMethodIndex > > <NUM_LIT:8> ) ; methodIndexByte2 = ( byte ) enclosingMethodIndex ; } } this . contents [ this . contentsOffset ++ ] = methodIndexByte1 ; this . contents [ this . contentsOffset ++ ] = methodIndexByte2 ; attributesNumber ++ ; } if ( this . targetJDK >= ClassFileConstants . JDK1_4 ) { TypeDeclaration typeDeclaration = this . referenceBinding . scope . referenceContext ; if ( typeDeclaration != null ) { final Annotation [ ] annotations = typeDeclaration . annotations ; if ( annotations != null ) { attributesNumber += generateRuntimeAnnotations ( annotations ) ; } } } if ( this . referenceBinding . isHierarchyInconsistent ( ) ) { ReferenceBinding superclass = this . referenceBinding . superclass ; if ( superclass != null ) { this . missingTypes = superclass . collectMissingTypes ( this . missingTypes ) ; } ReferenceBinding [ ] superInterfaces = this . referenceBinding . superInterfaces ( ) ; for ( int i = <NUM_LIT:0> , max = superInterfaces . length ; i < max ; i ++ ) { this . missingTypes = superInterfaces [ i ] . collectMissingTypes ( this . missingTypes ) ; } if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int inconsistentHierarchyNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . InconsistentHierarchy ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( inconsistentHierarchyNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) inconsistentHierarchyNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributesNumber ++ ; } int numberOfInnerClasses = this . innerClassesBindings == null ? <NUM_LIT:0> : this . innerClassesBindings . size ( ) ; if ( numberOfInnerClasses != <NUM_LIT:0> ) { ReferenceBinding [ ] innerClasses = new ReferenceBinding [ numberOfInnerClasses ] ; this . innerClassesBindings . toArray ( innerClasses ) ; Arrays . sort ( innerClasses , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { TypeBinding binding1 = ( TypeBinding ) o1 ; TypeBinding binding2 = ( TypeBinding ) o2 ; return CharOperation . compareTo ( binding1 . constantPoolName ( ) , binding2 . constantPoolName ( ) ) ; } } ) ; int exSize = <NUM_LIT:8> * numberOfInnerClasses + <NUM_LIT:8> ; if ( exSize + this . contentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } int attributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . InnerClassName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeNameIndex ; int value = ( numberOfInnerClasses << <NUM_LIT:3> ) + <NUM_LIT:2> ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) value ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( numberOfInnerClasses > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) numberOfInnerClasses ; for ( int i = <NUM_LIT:0> ; i < numberOfInnerClasses ; i ++ ) { ReferenceBinding innerClass = innerClasses [ i ] ; int accessFlags = innerClass . getAccessFlags ( ) ; int innerClassIndex = this . constantPool . literalIndexForType ( innerClass . constantPoolName ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( innerClassIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) innerClassIndex ; if ( innerClass . isMemberType ( ) ) { int outerClassIndex = this . constantPool . literalIndexForType ( innerClass . enclosingType ( ) . constantPoolName ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( outerClassIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) outerClassIndex ; } else { this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; } if ( ! innerClass . isAnonymousType ( ) ) { int nameIndex = this . constantPool . literalIndex ( innerClass . sourceName ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; } else { this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; } if ( innerClass . isAnonymousType ( ) ) { accessFlags &= ~ ClassFileConstants . AccFinal ; } else if ( innerClass . isMemberType ( ) && innerClass . isInterface ( ) ) { accessFlags |= ClassFileConstants . AccStatic ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; } attributesNumber ++ ; } if ( this . missingTypes != null ) { generateMissingTypesAttribute ( ) ; attributesNumber ++ ; } if ( attributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ attributeOffset ++ ] = ( byte ) ( attributesNumber > > <NUM_LIT:8> ) ; this . contents [ attributeOffset ] = ( byte ) attributesNumber ; this . header = this . constantPool . poolContent ; this . headerOffset = this . constantPool . currentOffset ; int constantPoolCount = this . constantPool . currentIndex ; this . header [ this . constantPoolOffset ++ ] = ( byte ) ( constantPoolCount > > <NUM_LIT:8> ) ; this . header [ this . constantPoolOffset ] = ( byte ) constantPoolCount ; } public void addDefaultAbstractMethods ( ) { MethodBinding [ ] defaultAbstractMethods = this . referenceBinding . getDefaultAbstractMethods ( ) ; for ( int i = <NUM_LIT:0> , max = defaultAbstractMethods . length ; i < max ; i ++ ) { generateMethodInfoHeader ( defaultAbstractMethods [ i ] ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( defaultAbstractMethods [ i ] ) ; completeMethodInfo ( methodAttributeOffset , attributeNumber ) ; } } private int addFieldAttributes ( FieldBinding fieldBinding , int fieldAttributeOffset ) { int attributesNumber = <NUM_LIT:0> ; Constant fieldConstant = fieldBinding . constant ( ) ; if ( fieldConstant != Constant . NotAConstant ) { if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int constantValueNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . ConstantValueName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( constantValueNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) constantValueNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:2> ; attributesNumber ++ ; switch ( fieldConstant . typeID ( ) ) { case T_boolean : int booleanValueIndex = this . constantPool . literalIndex ( fieldConstant . booleanValue ( ) ? <NUM_LIT:1> : <NUM_LIT:0> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( booleanValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) booleanValueIndex ; break ; case T_byte : case T_char : case T_int : case T_short : int integerValueIndex = this . constantPool . literalIndex ( fieldConstant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_float : int floatValueIndex = this . constantPool . literalIndex ( fieldConstant . floatValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( floatValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) floatValueIndex ; break ; case T_double : int doubleValueIndex = this . constantPool . literalIndex ( fieldConstant . doubleValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( doubleValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) doubleValueIndex ; break ; case T_long : int longValueIndex = this . constantPool . literalIndex ( fieldConstant . longValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( longValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) longValueIndex ; break ; case T_JavaLangString : int stringValueIndex = this . constantPool . literalIndex ( ( ( StringConstant ) fieldConstant ) . stringValue ( ) ) ; if ( stringValueIndex == - <NUM_LIT:1> ) { if ( ! this . creatingProblemType ) { TypeDeclaration typeDeclaration = this . referenceBinding . scope . referenceContext ; FieldDeclaration [ ] fieldDecls = typeDeclaration . fields ; for ( int i = <NUM_LIT:0> , max = fieldDecls . length ; i < max ; i ++ ) { if ( fieldDecls [ i ] . binding == fieldBinding ) { typeDeclaration . scope . problemReporter ( ) . stringConstantIsExceedingUtf8Limit ( fieldDecls [ i ] ) ; } } } else { this . contentsOffset = fieldAttributeOffset ; } } else { this . contents [ this . contentsOffset ++ ] = ( byte ) ( stringValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) stringValueIndex ; } } } if ( this . targetJDK < ClassFileConstants . JDK1_5 && fieldBinding . isSynthetic ( ) ) { if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int syntheticAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SyntheticName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( syntheticAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) syntheticAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributesNumber ++ ; } if ( fieldBinding . isDeprecated ( ) ) { if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int deprecatedAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . DeprecatedName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( deprecatedAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) deprecatedAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributesNumber ++ ; } char [ ] genericSignature = fieldBinding . genericSignature ( ) ; if ( genericSignature != null ) { if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int signatureAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SignatureName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( signatureAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) signatureAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:2> ; int signatureIndex = this . constantPool . literalIndex ( genericSignature ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( signatureIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) signatureIndex ; attributesNumber ++ ; } if ( this . targetJDK >= ClassFileConstants . JDK1_4 ) { FieldDeclaration fieldDeclaration = fieldBinding . sourceField ( ) ; if ( fieldDeclaration != null ) { Annotation [ ] annotations = fieldDeclaration . annotations ; if ( annotations != null ) { attributesNumber += generateRuntimeAnnotations ( annotations ) ; } } } if ( ( fieldBinding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . missingTypes = fieldBinding . type . collectMissingTypes ( this . missingTypes ) ; } return attributesNumber ; } private void addFieldInfo ( FieldBinding fieldBinding ) { if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int accessFlags = fieldBinding . getAccessFlags ( ) ; if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { accessFlags &= ~ ClassFileConstants . AccSynthetic ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; int nameIndex = this . constantPool . literalIndex ( fieldBinding . name ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; int descriptorIndex = this . constantPool . literalIndex ( fieldBinding . type ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) descriptorIndex ; int fieldAttributeOffset = this . contentsOffset ; int attributeNumber = <NUM_LIT:0> ; this . contentsOffset += <NUM_LIT:2> ; attributeNumber += addFieldAttributes ( fieldBinding , fieldAttributeOffset ) ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ fieldAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ fieldAttributeOffset ] = ( byte ) attributeNumber ; } public void addFieldInfos ( ) { SourceTypeBinding currentBinding = this . referenceBinding ; FieldBinding [ ] syntheticFields = currentBinding . syntheticFields ( ) ; int fieldCount = currentBinding . fieldCount ( ) + ( syntheticFields == null ? <NUM_LIT:0> : syntheticFields . length ) ; if ( fieldCount > <NUM_LIT> ) { this . referenceBinding . scope . problemReporter ( ) . tooManyFields ( this . referenceBinding . scope . referenceType ( ) ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( fieldCount > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) fieldCount ; FieldDeclaration [ ] fieldDecls = currentBinding . scope . referenceContext . fields ; for ( int i = <NUM_LIT:0> , max = fieldDecls == null ? <NUM_LIT:0> : fieldDecls . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDecls [ i ] ; if ( fieldDecl . binding != null ) { addFieldInfo ( fieldDecl . binding ) ; } } if ( syntheticFields != null ) { for ( int i = <NUM_LIT:0> , max = syntheticFields . length ; i < max ; i ++ ) { addFieldInfo ( syntheticFields [ i ] ) ; } } } private void addMissingAbstractProblemMethod ( MethodDeclaration methodDeclaration , MethodBinding methodBinding , CategorizedProblem problem , CompilationResult compilationResult ) { generateMethodInfoHeader ( methodBinding , methodBinding . modifiers & ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccNative | ClassFileConstants . AccAbstract ) ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; attributeNumber ++ ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; String problemString = buffer . toString ( ) ; this . codeStream . init ( this ) ; this . codeStream . preserveUnusedLocals = true ; this . codeStream . initializeMaxLocals ( methodBinding ) ; this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; completeCodeAttributeForMissingAbstractProblemMethod ( methodBinding , codeAttributeOffset , compilationResult . getLineSeparatorPositions ( ) , problem . getSourceLineNumber ( ) ) ; completeMethodInfo ( methodAttributeOffset , attributeNumber ) ; } public void addProblemClinit ( CategorizedProblem [ ] problems ) { generateMethodInfoHeaderForClinit ( ) ; this . contentsOffset -= <NUM_LIT:2> ; int attributeOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int attributeNumber = <NUM_LIT:0> ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; this . codeStream . resetForProblemClinit ( this ) ; String problemString = "<STR_LIT>" ; int problemLine = <NUM_LIT:0> ; if ( problems != null ) { int max = problems . length ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( ( problem != null ) && ( problem . isError ( ) ) ) { buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; count ++ ; if ( problemLine == <NUM_LIT:0> ) { problemLine = problem . getSourceLineNumber ( ) ; } problems [ i ] = null ; } } if ( count > <NUM_LIT:1> ) { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblems ) ; } else { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; } problemString = buffer . toString ( ) ; } this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; attributeNumber ++ ; completeCodeAttributeForClinit ( codeAttributeOffset , problemLine ) ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ attributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ attributeOffset ] = ( byte ) attributeNumber ; } public void addProblemConstructor ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems ) { generateMethodInfoHeader ( methodBinding , methodBinding . modifiers & ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccNative | ClassFileConstants . AccAbstract ) ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; attributeNumber ++ ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; this . codeStream . reset ( method , this ) ; String problemString = "<STR_LIT>" ; int problemLine = <NUM_LIT:0> ; if ( problems != null ) { int max = problems . length ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( ( problem != null ) && ( problem . isError ( ) ) ) { buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; count ++ ; if ( problemLine == <NUM_LIT:0> ) { problemLine = problem . getSourceLineNumber ( ) ; } } } if ( count > <NUM_LIT:1> ) { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblems ) ; } else { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; } problemString = buffer . toString ( ) ; } this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; completeCodeAttributeForProblemMethod ( method , methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) , problemLine ) ; completeMethodInfo ( methodAttributeOffset , attributeNumber ) ; } public void addProblemConstructor ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems , int savedOffset ) { this . contentsOffset = savedOffset ; this . methodCount -- ; addProblemConstructor ( method , methodBinding , problems ) ; } public void addProblemMethod ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems ) { if ( methodBinding . isAbstract ( ) && methodBinding . declaringClass . isInterface ( ) ) { method . abort ( ProblemSeverities . AbortType , null ) ; } generateMethodInfoHeader ( methodBinding , methodBinding . modifiers & ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccNative | ClassFileConstants . AccAbstract ) ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; attributeNumber ++ ; int codeAttributeOffset = this . contentsOffset ; generateCodeAttributeHeader ( ) ; this . codeStream . reset ( method , this ) ; String problemString = "<STR_LIT>" ; int problemLine = <NUM_LIT:0> ; if ( problems != null ) { int max = problems . length ; StringBuffer buffer = new StringBuffer ( <NUM_LIT> ) ; int count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { CategorizedProblem problem = problems [ i ] ; if ( ( problem != null ) && ( problem . isError ( ) ) && ( problem . getSourceStart ( ) >= method . declarationSourceStart ) && ( problem . getSourceEnd ( ) <= method . declarationSourceEnd ) ) { buffer . append ( "<STR_LIT:t>" + problem . getMessage ( ) + "<STR_LIT:n>" ) ; count ++ ; if ( problemLine == <NUM_LIT:0> ) { problemLine = problem . getSourceLineNumber ( ) ; } problems [ i ] = null ; } } if ( count > <NUM_LIT:1> ) { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblems ) ; } else { buffer . insert ( <NUM_LIT:0> , Messages . compilation_unresolvedProblem ) ; } problemString = buffer . toString ( ) ; } this . codeStream . generateCodeAttributeForProblemMethod ( problemString ) ; completeCodeAttributeForProblemMethod ( method , methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) , problemLine ) ; completeMethodInfo ( methodAttributeOffset , attributeNumber ) ; } public void addProblemMethod ( AbstractMethodDeclaration method , MethodBinding methodBinding , CategorizedProblem [ ] problems , int savedOffset ) { this . contentsOffset = savedOffset ; this . methodCount -- ; addProblemMethod ( method , methodBinding , problems ) ; } public void addSpecialMethods ( ) { generateMissingAbstractMethods ( this . referenceBinding . scope . referenceType ( ) . missingAbstractMethods , this . referenceBinding . scope . referenceCompilationUnit ( ) . compilationResult ) ; MethodBinding [ ] defaultAbstractMethods = this . referenceBinding . getDefaultAbstractMethods ( ) ; for ( int i = <NUM_LIT:0> , max = defaultAbstractMethods . length ; i < max ; i ++ ) { generateMethodInfoHeader ( defaultAbstractMethods [ i ] ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( defaultAbstractMethods [ i ] ) ; completeMethodInfo ( methodAttributeOffset , attributeNumber ) ; } SyntheticMethodBinding [ ] syntheticMethods = this . referenceBinding . syntheticMethods ( ) ; if ( syntheticMethods != null ) { for ( int i = <NUM_LIT:0> , max = syntheticMethods . length ; i < max ; i ++ ) { SyntheticMethodBinding syntheticMethod = syntheticMethods [ i ] ; switch ( syntheticMethod . purpose ) { case SyntheticMethodBinding . FieldReadAccess : case SyntheticMethodBinding . SuperFieldReadAccess : addSyntheticFieldReadAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . FieldWriteAccess : case SyntheticMethodBinding . SuperFieldWriteAccess : addSyntheticFieldWriteAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . MethodAccess : case SyntheticMethodBinding . SuperMethodAccess : case SyntheticMethodBinding . BridgeMethod : addSyntheticMethodAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . ConstructorAccess : addSyntheticConstructorAccessMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . EnumValues : addSyntheticEnumValuesMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . EnumValueOf : addSyntheticEnumValueOfMethod ( syntheticMethod ) ; break ; case SyntheticMethodBinding . SwitchTable : addSyntheticSwitchTable ( syntheticMethod ) ; } } } } public void addSyntheticConstructorAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForConstructorAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticEnumValueOfMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForEnumValueOf ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticEnumValuesMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForEnumValues ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticFieldReadAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForFieldReadAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticFieldWriteAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForFieldWriteAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticMethodAccessMethod ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForMethodAccess ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void addSyntheticSwitchTable ( SyntheticMethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding ) ; int methodAttributeOffset = this . contentsOffset ; int attributeNumber = generateMethodInfoAttribute ( methodBinding ) ; int codeAttributeOffset = this . contentsOffset ; attributeNumber ++ ; generateCodeAttributeHeader ( ) ; this . codeStream . init ( this ) ; this . codeStream . generateSyntheticBodyForSwitchTable ( methodBinding ) ; completeCodeAttributeForSyntheticMethod ( true , methodBinding , codeAttributeOffset , ( ( SourceTypeBinding ) methodBinding . declaringClass ) . scope . referenceCompilationUnit ( ) . compilationResult . getLineSeparatorPositions ( ) ) ; this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public void completeCodeAttribute ( int codeAttributeOffset ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int code_length = this . codeStream . position ; if ( code_length > <NUM_LIT> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . bytecodeExceeds64KLimit ( this . codeStream . methodDeclaration ) ; } if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; boolean addStackMaps = ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ; ExceptionLabel [ ] exceptionLabels = this . codeStream . exceptionLabels ; int exceptionHandlersCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . codeStream . exceptionLabelsCounter ; i < length ; i ++ ) { exceptionHandlersCount += this . codeStream . exceptionLabels [ i ] . count / <NUM_LIT:2> ; } int exSize = exceptionHandlersCount * <NUM_LIT:8> + <NUM_LIT:2> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionHandlersCount > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionHandlersCount ; for ( int i = <NUM_LIT:0> , max = this . codeStream . exceptionLabelsCounter ; i < max ; i ++ ) { ExceptionLabel exceptionLabel = exceptionLabels [ i ] ; if ( exceptionLabel != null ) { int iRange = <NUM_LIT:0> , maxRange = exceptionLabel . count ; if ( ( maxRange & <NUM_LIT:1> ) != <NUM_LIT:0> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidExceptionAttribute , new String ( this . codeStream . methodDeclaration . selector ) ) , this . codeStream . methodDeclaration ) ; } while ( iRange < maxRange ) { int start = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( start > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) start ; int end = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( end > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) end ; int handlerPC = exceptionLabel . position ; if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . addFramePosition ( handlerPC ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( handlerPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) handlerPC ; if ( exceptionLabel . exceptionType == null ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } else { int nameIndex ; if ( exceptionLabel . exceptionType == TypeBinding . NULL ) { nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ; } else { nameIndex = this . constantPool . literalIndexForType ( exceptionLabel . exceptionType ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } } } } int codeAttributeAttributeOffset = localContentsOffset ; int attributeNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { int [ ] pcToSourceMapTable ; if ( ( ( pcToSourceMapTable = this . codeStream . pcToSourceMap ) != null ) && ( this . codeStream . pcToSourceMapSize != <NUM_LIT:0> ) ) { int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; int lineNumberTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int numberOfEntries = <NUM_LIT:0> ; int length = this . codeStream . pcToSourceMapSize ; for ( int i = <NUM_LIT:0> ; i < length ; ) { if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int pc = pcToSourceMapTable [ i ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( pc > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) pc ; int lineNumber = pcToSourceMapTable [ i ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumber > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumber ; numberOfEntries ++ ; } int lineNumberAttr_length = numberOfEntries * <NUM_LIT:4> + <NUM_LIT:2> ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:24> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:16> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:8> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) lineNumberAttr_length ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) numberOfEntries ; attributeNumber ++ ; } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { int numberOfEntries = <NUM_LIT:0> ; int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; final boolean methodDeclarationIsStatic = this . codeStream . methodDeclaration . isStatic ( ) ; int maxOfEntries = <NUM_LIT:8> + <NUM_LIT:10> * ( methodDeclarationIsStatic ? <NUM_LIT:0> : <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:0> ; i < this . codeStream . allLocalsCounter ; i ++ ) { LocalVariableBinding localVariableBinding = this . codeStream . locals [ i ] ; maxOfEntries += <NUM_LIT:10> * localVariableBinding . initializationCount ; } if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; int localVariableTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int nameIndex ; int descriptorIndex ; SourceTypeBinding declaringClassBinding = null ; if ( ! methodDeclarationIsStatic ) { numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( ConstantPool . This ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; declaringClassBinding = ( SourceTypeBinding ) this . codeStream . methodDeclaration . binding . declaringClass ; descriptorIndex = this . constantPool . literalIndex ( declaringClassBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } int genericLocalVariablesCounter = <NUM_LIT:0> ; LocalVariableBinding [ ] genericLocalVariables = null ; int numberOfGenericEntries = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable . declaration == null ) continue ; final TypeBinding localVariableTypeBinding = localVariable . type ; boolean isParameterizedType = localVariableTypeBinding . isParameterizedType ( ) || localVariableTypeBinding . isTypeVariable ( ) ; if ( localVariable . initializationCount != <NUM_LIT:0> && isParameterizedType ) { if ( genericLocalVariables == null ) { genericLocalVariables = new LocalVariableBinding [ max ] ; } genericLocalVariables [ genericLocalVariablesCounter ++ ] = localVariable ; } for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { if ( endPC == - <NUM_LIT:1> ) { localVariable . declaringScope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidAttribute , new String ( localVariable . name ) ) , ( ASTNode ) localVariable . declaringScope . methodScope ( ) . referenceContext ) ; } if ( isParameterizedType ) { numberOfGenericEntries ++ ; } numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariableTypeBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } int value = numberOfEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) value ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ] = ( byte ) numberOfEntries ; attributeNumber ++ ; final boolean currentInstanceIsGeneric = ! methodDeclarationIsStatic && declaringClassBinding != null && declaringClassBinding . typeVariables != Binding . NO_TYPE_VARIABLES ; if ( genericLocalVariablesCounter != <NUM_LIT:0> || currentInstanceIsGeneric ) { numberOfGenericEntries += ( currentInstanceIsGeneric ? <NUM_LIT:1> : <NUM_LIT:0> ) ; maxOfEntries = <NUM_LIT:8> + numberOfGenericEntries * <NUM_LIT:10> ; if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } int localVariableTypeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTypeTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableTypeNameIndex ; value = numberOfGenericEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) value ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfGenericEntries > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfGenericEntries ; if ( currentInstanceIsGeneric ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( ConstantPool . This ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( declaringClassBinding . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } for ( int i = <NUM_LIT:0> ; i < genericLocalVariablesCounter ; i ++ ) { LocalVariableBinding localVariable = genericLocalVariables [ i ] ; for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariable . type . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } attributeNumber ++ ; } } if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributeNumber ; int codeAttributeLength = localContentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; this . contentsOffset = localContentsOffset ; } public void completeCodeAttributeForClinit ( int codeAttributeOffset ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int code_length = this . codeStream . position ; if ( code_length > <NUM_LIT> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . bytecodeExceeds64KLimit ( this . codeStream . methodDeclaration . scope . referenceType ( ) ) ; } if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; boolean addStackMaps = ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ; ExceptionLabel [ ] exceptionLabels = this . codeStream . exceptionLabels ; int exceptionHandlersCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . codeStream . exceptionLabelsCounter ; i < length ; i ++ ) { exceptionHandlersCount += this . codeStream . exceptionLabels [ i ] . count / <NUM_LIT:2> ; } int exSize = exceptionHandlersCount * <NUM_LIT:8> + <NUM_LIT:2> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionHandlersCount > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionHandlersCount ; for ( int i = <NUM_LIT:0> , max = this . codeStream . exceptionLabelsCounter ; i < max ; i ++ ) { ExceptionLabel exceptionLabel = exceptionLabels [ i ] ; if ( exceptionLabel != null ) { int iRange = <NUM_LIT:0> , maxRange = exceptionLabel . count ; if ( ( maxRange & <NUM_LIT:1> ) != <NUM_LIT:0> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidExceptionAttribute , new String ( this . codeStream . methodDeclaration . selector ) ) , this . codeStream . methodDeclaration ) ; } while ( iRange < maxRange ) { int start = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( start > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) start ; int end = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( end > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) end ; int handlerPC = exceptionLabel . position ; this . contents [ localContentsOffset ++ ] = ( byte ) ( handlerPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) handlerPC ; if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . addFramePosition ( handlerPC ) ; } if ( exceptionLabel . exceptionType == null ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } else { int nameIndex ; if ( exceptionLabel . exceptionType == TypeBinding . NULL ) { nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ; } else { nameIndex = this . constantPool . literalIndexForType ( exceptionLabel . exceptionType ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } } } } int codeAttributeAttributeOffset = localContentsOffset ; int attributeNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { int [ ] pcToSourceMapTable ; if ( ( ( pcToSourceMapTable = this . codeStream . pcToSourceMap ) != null ) && ( this . codeStream . pcToSourceMapSize != <NUM_LIT:0> ) ) { int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; int lineNumberTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int numberOfEntries = <NUM_LIT:0> ; int length = this . codeStream . pcToSourceMapSize ; for ( int i = <NUM_LIT:0> ; i < length ; ) { if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int pc = pcToSourceMapTable [ i ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( pc > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) pc ; int lineNumber = pcToSourceMapTable [ i ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumber > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumber ; numberOfEntries ++ ; } int lineNumberAttr_length = numberOfEntries * <NUM_LIT:4> + <NUM_LIT:2> ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:24> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:16> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( lineNumberAttr_length > > <NUM_LIT:8> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) lineNumberAttr_length ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ lineNumberTableOffset ++ ] = ( byte ) numberOfEntries ; attributeNumber ++ ; } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { int numberOfEntries = <NUM_LIT:0> ; if ( ( this . codeStream . pcToSourceMap != null ) && ( this . codeStream . pcToSourceMapSize != <NUM_LIT:0> ) ) { int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; int localVariableTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int nameIndex ; int descriptorIndex ; int genericLocalVariablesCounter = <NUM_LIT:0> ; LocalVariableBinding [ ] genericLocalVariables = null ; int numberOfGenericEntries = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable . declaration == null ) continue ; final TypeBinding localVariableTypeBinding = localVariable . type ; boolean isParameterizedType = localVariableTypeBinding . isParameterizedType ( ) || localVariableTypeBinding . isTypeVariable ( ) ; if ( localVariable . initializationCount != <NUM_LIT:0> && isParameterizedType ) { if ( genericLocalVariables == null ) { genericLocalVariables = new LocalVariableBinding [ max ] ; } genericLocalVariables [ genericLocalVariablesCounter ++ ] = localVariable ; } for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { if ( endPC == - <NUM_LIT:1> ) { localVariable . declaringScope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidAttribute , new String ( localVariable . name ) ) , ( ASTNode ) localVariable . declaringScope . methodScope ( ) . referenceContext ) ; } if ( localContentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } numberOfEntries ++ ; if ( isParameterizedType ) { numberOfGenericEntries ++ ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariableTypeBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } int value = numberOfEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) value ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ] = ( byte ) numberOfEntries ; attributeNumber ++ ; if ( genericLocalVariablesCounter != <NUM_LIT:0> ) { int maxOfEntries = <NUM_LIT:8> + numberOfGenericEntries * <NUM_LIT:10> ; if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } int localVariableTypeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTypeTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableTypeNameIndex ; value = numberOfGenericEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) value ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfGenericEntries > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfGenericEntries ; for ( int i = <NUM_LIT:0> ; i < genericLocalVariablesCounter ; i ++ ) { LocalVariableBinding localVariable = genericLocalVariables [ i ] ; for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariable . type . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } attributeNumber ++ ; } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( null , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , true ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributeNumber ; int codeAttributeLength = localContentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; this . contentsOffset = localContentsOffset ; } public void completeCodeAttributeForClinit ( int codeAttributeOffset , int problemLine ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int code_length = this . codeStream . position ; if ( code_length > <NUM_LIT> ) { this . codeStream . methodDeclaration . scope . problemReporter ( ) . bytecodeExceeds64KLimit ( this . codeStream . methodDeclaration . scope . referenceType ( ) ) ; } if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; int codeAttributeAttributeOffset = localContentsOffset ; int attributeNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:6> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:1> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( problemLine > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) problemLine ; attributeNumber ++ ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; attributeNumber ++ ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( null , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , true ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } numberOfFrames = <NUM_LIT:0> ; int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; numberOfFrames ++ ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributeNumber ; int codeAttributeLength = localContentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; this . contentsOffset = localContentsOffset ; } public void completeCodeAttributeForMissingAbstractProblemMethod ( MethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes , int problemLine ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; int code_length = this . codeStream . position ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; if ( localContentsOffset + <NUM_LIT> >= this . contents . length ) { resizeContents ( <NUM_LIT> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; int codeAttributeAttributeOffset = localContentsOffset ; int attributeNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { if ( localContentsOffset + <NUM_LIT:12> >= this . contents . length ) { resizeContents ( <NUM_LIT:12> ) ; } int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:6> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:1> ; if ( problemLine == <NUM_LIT:0> ) { problemLine = Util . getLineNumber ( binding . sourceStart ( ) , startLineIndexes , <NUM_LIT:0> , startLineIndexes . length - <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( problemLine > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) problemLine ; attributeNumber ++ ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } numberOfFrames = <NUM_LIT:0> ; int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; numberOfFrames ++ ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributeNumber ; int codeAttributeLength = localContentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; this . contentsOffset = localContentsOffset ; } public void completeCodeAttributeForProblemMethod ( AbstractMethodDeclaration method , MethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes , int problemLine ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; int code_length = this . codeStream . position ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; if ( localContentsOffset + <NUM_LIT> >= this . contents . length ) { resizeContents ( <NUM_LIT> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; int codeAttributeAttributeOffset = localContentsOffset ; int attributeNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { if ( localContentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:6> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:1> ; if ( problemLine == <NUM_LIT:0> ) { problemLine = Util . getLineNumber ( binding . sourceStart ( ) , startLineIndexes , <NUM_LIT:0> , startLineIndexes . length - <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( problemLine > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) problemLine ; attributeNumber ++ ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { int argSize ; int numberOfEntries = <NUM_LIT:0> ; int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; int localVariableTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int descriptorIndex ; int nameIndex ; SourceTypeBinding declaringClassBinding = null ; final boolean methodDeclarationIsStatic = this . codeStream . methodDeclaration . isStatic ( ) ; if ( ! methodDeclarationIsStatic ) { numberOfEntries ++ ; if ( localContentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( ConstantPool . This ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; declaringClassBinding = ( SourceTypeBinding ) this . codeStream . methodDeclaration . binding . declaringClass ; descriptorIndex = this . constantPool . literalIndex ( declaringClassBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } int genericLocalVariablesCounter = <NUM_LIT:0> ; LocalVariableBinding [ ] genericLocalVariables = null ; int numberOfGenericEntries = <NUM_LIT:0> ; if ( binding . isConstructor ( ) ) { ReferenceBinding declaringClass = binding . declaringClass ; if ( declaringClass . isNestedType ( ) ) { NestedTypeBinding methodDeclaringClass = ( NestedTypeBinding ) declaringClass ; argSize = methodDeclaringClass . getEnclosingInstancesSlotSize ( ) ; SyntheticArgumentBinding [ ] syntheticArguments ; if ( ( syntheticArguments = methodDeclaringClass . syntheticEnclosingInstances ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { LocalVariableBinding localVariable = syntheticArguments [ i ] ; final TypeBinding localVariableTypeBinding = localVariable . type ; if ( localVariableTypeBinding . isParameterizedType ( ) || localVariableTypeBinding . isTypeVariable ( ) ) { if ( genericLocalVariables == null ) { genericLocalVariables = new LocalVariableBinding [ max ] ; } genericLocalVariables [ genericLocalVariablesCounter ++ ] = localVariable ; numberOfGenericEntries ++ ; } if ( localContentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariableTypeBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } else { argSize = <NUM_LIT:1> ; } } else { argSize = binding . isStatic ( ) ? <NUM_LIT:0> : <NUM_LIT:1> ; } int genericArgumentsCounter = <NUM_LIT:0> ; int [ ] genericArgumentsNameIndexes = null ; int [ ] genericArgumentsResolvedPositions = null ; TypeBinding [ ] genericArgumentsTypeBindings = null ; if ( method . binding != null ) { TypeBinding [ ] parameters = method . binding . parameters ; Argument [ ] arguments = method . arguments ; if ( ( parameters != null ) && ( arguments != null ) ) { for ( int i = <NUM_LIT:0> , max = parameters . length ; i < max ; i ++ ) { TypeBinding argumentBinding = parameters [ i ] ; if ( localContentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( arguments [ i ] . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; int resolvedPosition = argSize ; if ( argumentBinding . isParameterizedType ( ) || argumentBinding . isTypeVariable ( ) ) { if ( genericArgumentsCounter == <NUM_LIT:0> ) { genericArgumentsNameIndexes = new int [ max ] ; genericArgumentsResolvedPositions = new int [ max ] ; genericArgumentsTypeBindings = new TypeBinding [ max ] ; } genericArgumentsNameIndexes [ genericArgumentsCounter ] = nameIndex ; genericArgumentsResolvedPositions [ genericArgumentsCounter ] = resolvedPosition ; genericArgumentsTypeBindings [ genericArgumentsCounter ++ ] = argumentBinding ; } descriptorIndex = this . constantPool . literalIndex ( argumentBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; switch ( argumentBinding . id ) { case TypeIds . T_long : case TypeIds . T_double : argSize += <NUM_LIT:2> ; break ; default : argSize ++ ; break ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } int value = numberOfEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) value ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ] = ( byte ) numberOfEntries ; attributeNumber ++ ; final boolean currentInstanceIsGeneric = ! methodDeclarationIsStatic && declaringClassBinding != null && declaringClassBinding . typeVariables != Binding . NO_TYPE_VARIABLES ; if ( genericLocalVariablesCounter != <NUM_LIT:0> || genericArgumentsCounter != <NUM_LIT:0> || currentInstanceIsGeneric ) { numberOfEntries = numberOfGenericEntries + genericArgumentsCounter + ( currentInstanceIsGeneric ? <NUM_LIT:1> : <NUM_LIT:0> ) ; int maxOfEntries = <NUM_LIT:8> + numberOfEntries * <NUM_LIT:10> ; if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } int localVariableTypeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTypeTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableTypeNameIndex ; value = numberOfEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) value ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfEntries ; if ( currentInstanceIsGeneric ) { numberOfEntries ++ ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( ConstantPool . This ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( declaringClassBinding . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } for ( int i = <NUM_LIT:0> ; i < genericLocalVariablesCounter ; i ++ ) { LocalVariableBinding localVariable = genericLocalVariables [ i ] ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariable . type . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } for ( int i = <NUM_LIT:0> ; i < genericArgumentsCounter ; i ++ ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) code_length ; nameIndex = genericArgumentsNameIndexes [ i ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( genericArgumentsTypeBindings [ i ] . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = genericArgumentsResolvedPositions [ i ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } attributeNumber ++ ; } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } numberOfFrames = <NUM_LIT:0> ; int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; numberOfFrames ++ ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributeNumber ; int codeAttributeLength = localContentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; this . contentsOffset = localContentsOffset ; } public void completeCodeAttributeForSyntheticMethod ( boolean hasExceptionHandlers , SyntheticMethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes ) { this . contents = this . codeStream . bCodeStream ; int localContentsOffset = this . codeStream . classFileOffset ; int max_stack = this . codeStream . stackMax ; this . contents [ codeAttributeOffset + <NUM_LIT:6> ] = ( byte ) ( max_stack > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:7> ] = ( byte ) max_stack ; int max_locals = this . codeStream . maxLocals ; this . contents [ codeAttributeOffset + <NUM_LIT:8> ] = ( byte ) ( max_locals > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:9> ] = ( byte ) max_locals ; int code_length = this . codeStream . position ; this . contents [ codeAttributeOffset + <NUM_LIT:10> ] = ( byte ) ( code_length > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:11> ] = ( byte ) ( code_length > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:12> ] = ( byte ) ( code_length > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT> ] = ( byte ) code_length ; if ( ( localContentsOffset + <NUM_LIT> ) >= this . contents . length ) { resizeContents ( <NUM_LIT> ) ; } boolean addStackMaps = ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP_TABLE ) != <NUM_LIT:0> ; if ( hasExceptionHandlers ) { ExceptionLabel [ ] exceptionLabels = this . codeStream . exceptionLabels ; int exceptionHandlersCount = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , length = this . codeStream . exceptionLabelsCounter ; i < length ; i ++ ) { exceptionHandlersCount += this . codeStream . exceptionLabels [ i ] . count / <NUM_LIT:2> ; } int exSize = exceptionHandlersCount * <NUM_LIT:8> + <NUM_LIT:2> ; if ( exSize + localContentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( exceptionHandlersCount > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) exceptionHandlersCount ; for ( int i = <NUM_LIT:0> , max = this . codeStream . exceptionLabelsCounter ; i < max ; i ++ ) { ExceptionLabel exceptionLabel = exceptionLabels [ i ] ; if ( exceptionLabel != null ) { int iRange = <NUM_LIT:0> , maxRange = exceptionLabel . count ; if ( ( maxRange & <NUM_LIT:1> ) != <NUM_LIT:0> ) { this . referenceBinding . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidExceptionAttribute , new String ( binding . selector ) , this . referenceBinding . scope . problemReporter ( ) . referenceContext ) ) ; } while ( iRange < maxRange ) { int start = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( start > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) start ; int end = exceptionLabel . ranges [ iRange ++ ] ; this . contents [ localContentsOffset ++ ] = ( byte ) ( end > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) end ; int handlerPC = exceptionLabel . position ; if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . addFramePosition ( handlerPC ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( handlerPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) handlerPC ; if ( exceptionLabel . exceptionType == null ) { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } else { int nameIndex ; switch ( exceptionLabel . exceptionType . id ) { case T_null : nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangClassNotFoundExceptionConstantPoolName ) ; break ; case T_long : nameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangNoSuchFieldErrorConstantPoolName ) ; break ; default : nameIndex = this . constantPool . literalIndexForType ( exceptionLabel . exceptionType ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; } } } } } else { this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; } int codeAttributeAttributeOffset = localContentsOffset ; int attributeNumber = <NUM_LIT:0> ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ) { if ( localContentsOffset + <NUM_LIT:12> >= this . contents . length ) { resizeContents ( <NUM_LIT:12> ) ; } int index = <NUM_LIT:0> ; int lineNumberNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LineNumberTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( lineNumberNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) lineNumberNameIndex ; int lineNumberTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; index = Util . getLineNumber ( binding . sourceStart , startLineIndexes , <NUM_LIT:0> , startLineIndexes . length - <NUM_LIT:1> ) ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( index > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) index ; this . contents [ lineNumberTableOffset ++ ] = <NUM_LIT:0> ; this . contents [ lineNumberTableOffset ++ ] = <NUM_LIT:0> ; this . contents [ lineNumberTableOffset ++ ] = <NUM_LIT:0> ; this . contents [ lineNumberTableOffset ++ ] = <NUM_LIT:6> ; this . contents [ lineNumberTableOffset ++ ] = <NUM_LIT:0> ; this . contents [ lineNumberTableOffset ++ ] = <NUM_LIT:1> ; attributeNumber ++ ; } if ( ( this . produceAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ) { int numberOfEntries = <NUM_LIT:0> ; int localVariableNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTableName ) ; if ( localContentsOffset + <NUM_LIT:8> > this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableNameIndex ; int localVariableTableOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:6> ; int nameIndex ; int descriptorIndex ; int genericLocalVariablesCounter = <NUM_LIT:0> ; LocalVariableBinding [ ] genericLocalVariables = null ; int numberOfGenericEntries = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable . declaration == null ) continue ; final TypeBinding localVariableTypeBinding = localVariable . type ; boolean isParameterizedType = localVariableTypeBinding . isParameterizedType ( ) || localVariableTypeBinding . isTypeVariable ( ) ; if ( localVariable . initializationCount != <NUM_LIT:0> && isParameterizedType ) { if ( genericLocalVariables == null ) { genericLocalVariables = new LocalVariableBinding [ max ] ; } genericLocalVariables [ genericLocalVariablesCounter ++ ] = localVariable ; } for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { if ( endPC == - <NUM_LIT:1> ) { localVariable . declaringScope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidAttribute , new String ( localVariable . name ) ) , ( ASTNode ) localVariable . declaringScope . methodScope ( ) . referenceContext ) ; } if ( localContentsOffset + <NUM_LIT:10> > this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } numberOfEntries ++ ; if ( isParameterizedType ) { numberOfGenericEntries ++ ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariableTypeBinding . signature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } int value = numberOfEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ++ ] = ( byte ) value ; this . contents [ localVariableTableOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ localVariableTableOffset ] = ( byte ) numberOfEntries ; attributeNumber ++ ; if ( genericLocalVariablesCounter != <NUM_LIT:0> ) { int maxOfEntries = <NUM_LIT:8> + numberOfGenericEntries * <NUM_LIT:10> ; if ( localContentsOffset + maxOfEntries >= this . contents . length ) { resizeContents ( maxOfEntries ) ; } int localVariableTypeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . LocalVariableTypeTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( localVariableTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) localVariableTypeNameIndex ; value = numberOfGenericEntries * <NUM_LIT:10> + <NUM_LIT:2> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:24> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:16> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( value > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) value ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfGenericEntries > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfGenericEntries ; for ( int i = <NUM_LIT:0> ; i < genericLocalVariablesCounter ; i ++ ) { LocalVariableBinding localVariable = genericLocalVariables [ i ] ; for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( startPC != endPC ) { this . contents [ localContentsOffset ++ ] = ( byte ) ( startPC > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) startPC ; int length = endPC - startPC ; this . contents [ localContentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) length ; nameIndex = this . constantPool . literalIndex ( localVariable . name ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) nameIndex ; descriptorIndex = this . constantPool . literalIndex ( localVariable . type . genericTypeSignature ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) descriptorIndex ; int resolvedPosition = localVariable . resolvedPosition ; this . contents [ localContentsOffset ++ ] = ( byte ) ( resolvedPosition > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) resolvedPosition ; } } } attributeNumber ++ ; } } if ( addStackMaps ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapTableAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapTableName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapTableAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapTableAttributeNameIndex ; int stackMapTableAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; StackMapFrame prevFrame = null ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { prevFrame = currentFrame ; currentFrame = ( StackMapFrame ) frames . get ( j ) ; int offsetDelta = currentFrame . getOffsetDelta ( prevFrame ) ; switch ( currentFrame . getFrameType ( prevFrame ) ) { case StackMapFrame . APPEND_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } int numberOfDifferentLocals = currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> + numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int index = currentFrame . getIndexOfDifferentLocals ( numberOfDifferentLocals ) ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; for ( int i = index ; i < currentFrame . locals . length && numberOfDifferentLocals > <NUM_LIT:0> ; i ++ ) { if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfDifferentLocals -- ; } } break ; case StackMapFrame . SAME_FRAME : if ( localContentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_FRAME_EXTENDED : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . CHOP_FRAME : if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } numberOfDifferentLocals = - currentFrame . numberOfDifferentLocals ( prevFrame ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( <NUM_LIT> - numberOfDifferentLocals ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS : if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta + <NUM_LIT> ) ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; case StackMapFrame . SAME_LOCALS_1_STACK_ITEMS_EXTENDED : if ( localContentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; if ( currentFrame . stackItems [ <NUM_LIT:0> ] == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( currentFrame . stackItems [ <NUM_LIT:0> ] . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : VerificationTypeInfo info = currentFrame . stackItems [ <NUM_LIT:0> ] ; byte tag = ( byte ) info . tag ; this . contents [ localContentsOffset ++ ] = tag ; switch ( tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } break ; default : if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) <NUM_LIT:255> ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offsetDelta > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offsetDelta ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapTableAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapTableAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapTableAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( ( this . produceAttributes & ClassFileConstants . ATTR_STACK_MAP ) != <NUM_LIT:0> ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; stackMapFrameCodeStream . removeFramePosition ( code_length ) ; if ( stackMapFrameCodeStream . hasFramePositions ( ) ) { ArrayList frames = new ArrayList ( ) ; traverse ( this . codeStream . methodDeclaration . binding , max_locals , this . contents , codeAttributeOffset + <NUM_LIT> , code_length , frames , false ) ; int numberOfFrames = frames . size ( ) ; if ( numberOfFrames > <NUM_LIT:1> ) { int stackMapTableAttributeOffset = localContentsOffset ; if ( localContentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int stackMapAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . StackMapName ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( stackMapAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) stackMapAttributeNameIndex ; int stackMapAttributeLengthOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:4> ; if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } int numberOfFramesOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; if ( localContentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } StackMapFrame currentFrame = ( StackMapFrame ) frames . get ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:1> ; j < numberOfFrames ; j ++ ) { currentFrame = ( StackMapFrame ) frames . get ( j ) ; int frameOffset = currentFrame . pc ; if ( localContentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ localContentsOffset ++ ] = ( byte ) ( frameOffset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) frameOffset ; int numberOfLocalOffset = localContentsOffset ; localContentsOffset += <NUM_LIT:2> ; int numberOfLocalEntries = <NUM_LIT:0> ; int numberOfLocals = currentFrame . getNumberOfLocals ( ) ; int numberOfEntries = <NUM_LIT:0> ; int localsLength = currentFrame . locals == null ? <NUM_LIT:0> : currentFrame . locals . length ; for ( int i = <NUM_LIT:0> ; i < localsLength && numberOfLocalEntries < numberOfLocals ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . locals [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; i ++ ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; i ++ ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } numberOfLocalEntries ++ ; } numberOfEntries ++ ; } if ( localContentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } this . contents [ numberOfLocalOffset ++ ] = ( byte ) ( numberOfEntries > > <NUM_LIT:8> ) ; this . contents [ numberOfLocalOffset ] = ( byte ) numberOfEntries ; int numberOfStackItems = currentFrame . numberOfStackItems ; this . contents [ localContentsOffset ++ ] = ( byte ) ( numberOfStackItems > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) numberOfStackItems ; for ( int i = <NUM_LIT:0> ; i < numberOfStackItems ; i ++ ) { if ( localContentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } VerificationTypeInfo info = currentFrame . stackItems [ i ] ; if ( info == null ) { this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_TOP ; } else { switch ( info . id ( ) ) { case T_boolean : case T_byte : case T_char : case T_int : case T_short : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_INTEGER ; break ; case T_float : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_FLOAT ; break ; case T_long : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_LONG ; break ; case T_double : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_DOUBLE ; break ; case T_null : this . contents [ localContentsOffset ++ ] = ( byte ) VerificationTypeInfo . ITEM_NULL ; break ; default : this . contents [ localContentsOffset ++ ] = ( byte ) info . tag ; switch ( info . tag ) { case VerificationTypeInfo . ITEM_UNINITIALIZED : int offset = info . offset ; this . contents [ localContentsOffset ++ ] = ( byte ) ( offset > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) offset ; break ; case VerificationTypeInfo . ITEM_OBJECT : int indexForType = this . constantPool . literalIndexForType ( info . constantPoolName ( ) ) ; this . contents [ localContentsOffset ++ ] = ( byte ) ( indexForType > > <NUM_LIT:8> ) ; this . contents [ localContentsOffset ++ ] = ( byte ) indexForType ; } } } } } numberOfFrames -- ; if ( numberOfFrames != <NUM_LIT:0> ) { this . contents [ numberOfFramesOffset ++ ] = ( byte ) ( numberOfFrames > > <NUM_LIT:8> ) ; this . contents [ numberOfFramesOffset ] = ( byte ) numberOfFrames ; int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - <NUM_LIT:4> ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ stackMapAttributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ stackMapAttributeLengthOffset ] = ( byte ) attributeLength ; attributeNumber ++ ; } else { localContentsOffset = stackMapTableAttributeOffset ; } } } } if ( codeAttributeAttributeOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } this . contents [ codeAttributeAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ codeAttributeAttributeOffset ] = ( byte ) attributeNumber ; int codeAttributeLength = localContentsOffset - ( codeAttributeOffset + <NUM_LIT:6> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:2> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:24> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:3> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:16> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:4> ] = ( byte ) ( codeAttributeLength > > <NUM_LIT:8> ) ; this . contents [ codeAttributeOffset + <NUM_LIT:5> ] = ( byte ) codeAttributeLength ; this . contentsOffset = localContentsOffset ; } public void completeCodeAttributeForSyntheticMethod ( SyntheticMethodBinding binding , int codeAttributeOffset , int [ ] startLineIndexes ) { this . completeCodeAttributeForSyntheticMethod ( false , binding , codeAttributeOffset , startLineIndexes ) ; } public void completeMethodInfo ( int methodAttributeOffset , int attributeNumber ) { this . contents [ methodAttributeOffset ++ ] = ( byte ) ( attributeNumber > > <NUM_LIT:8> ) ; this . contents [ methodAttributeOffset ] = ( byte ) attributeNumber ; } public char [ ] fileName ( ) { return this . constantPool . UTF8Cache . returnKeyFor ( <NUM_LIT:2> ) ; } private void generateAnnotation ( Annotation annotation , int currentOffset ) { int startingContentsOffset = currentOffset ; if ( this . contentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } TypeBinding annotationTypeBinding = annotation . resolvedType ; if ( annotationTypeBinding == null ) { this . contentsOffset = startingContentsOffset ; return ; } final int typeIndex = this . constantPool . literalIndex ( annotationTypeBinding . signature ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( typeIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) typeIndex ; if ( annotation instanceof NormalAnnotation ) { NormalAnnotation normalAnnotation = ( NormalAnnotation ) annotation ; MemberValuePair [ ] memberValuePairs = normalAnnotation . memberValuePairs ; if ( memberValuePairs != null ) { final int memberValuePairsLength = memberValuePairs . length ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( memberValuePairsLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) memberValuePairsLength ; for ( int i = <NUM_LIT:0> ; i < memberValuePairsLength ; i ++ ) { MemberValuePair memberValuePair = memberValuePairs [ i ] ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } final int elementNameIndex = this . constantPool . literalIndex ( memberValuePair . name ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( elementNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) elementNameIndex ; MethodBinding methodBinding = memberValuePair . binding ; if ( methodBinding == null ) { this . contentsOffset = startingContentsOffset ; } else { try { generateElementValue ( memberValuePair . value , methodBinding . returnType , startingContentsOffset ) ; } catch ( ClassCastException e ) { this . contentsOffset = startingContentsOffset ; } catch ( ShouldNotImplement e ) { this . contentsOffset = startingContentsOffset ; } } } } else { this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; } } else if ( annotation instanceof SingleMemberAnnotation ) { SingleMemberAnnotation singleMemberAnnotation = ( SingleMemberAnnotation ) annotation ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:1> ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } final int elementNameIndex = this . constantPool . literalIndex ( VALUE ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( elementNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) elementNameIndex ; MethodBinding methodBinding = singleMemberAnnotation . memberValuePairs ( ) [ <NUM_LIT:0> ] . binding ; if ( methodBinding == null ) { this . contentsOffset = startingContentsOffset ; } else { try { generateElementValue ( singleMemberAnnotation . memberValue , methodBinding . returnType , startingContentsOffset ) ; } catch ( ClassCastException e ) { this . contentsOffset = startingContentsOffset ; } catch ( ShouldNotImplement e ) { this . contentsOffset = startingContentsOffset ; } } } else { this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; } } public void generateCodeAttributeHeader ( ) { if ( this . contentsOffset + <NUM_LIT:20> >= this . contents . length ) { resizeContents ( <NUM_LIT:20> ) ; } int constantValueNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . CodeName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( constantValueNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) constantValueNameIndex ; this . contentsOffset += <NUM_LIT:12> ; } private void generateElementValue ( Expression defaultValue , TypeBinding memberValuePairReturnType , int attributeOffset ) { Constant constant = defaultValue . constant ; TypeBinding defaultValueBinding = defaultValue . resolvedType ; if ( defaultValueBinding == null ) { this . contentsOffset = attributeOffset ; } else { if ( memberValuePairReturnType . isArrayType ( ) && ! defaultValueBinding . isArrayType ( ) ) { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:[>' ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:1> ; } if ( constant != null && constant != Constant . NotAConstant ) { generateElementValue ( attributeOffset , defaultValue , constant , memberValuePairReturnType . leafComponentType ( ) ) ; } else { generateElementValueForNonConstantExpression ( defaultValue , attributeOffset , defaultValueBinding ) ; } } } private void generateElementValue ( int attributeOffset , Expression defaultValue , Constant constant , TypeBinding binding ) { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } switch ( binding . id ) { case T_boolean : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:Z>' ; int booleanValueIndex = this . constantPool . literalIndex ( constant . booleanValue ( ) ? <NUM_LIT:1> : <NUM_LIT:0> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( booleanValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) booleanValueIndex ; break ; case T_byte : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_char : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_int : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_short : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; integerValueIndex = this . constantPool . literalIndex ( constant . intValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( integerValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) integerValueIndex ; break ; case T_float : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int floatValueIndex = this . constantPool . literalIndex ( constant . floatValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( floatValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) floatValueIndex ; break ; case T_double : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int doubleValueIndex = this . constantPool . literalIndex ( constant . doubleValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( doubleValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) doubleValueIndex ; break ; case T_long : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int longValueIndex = this . constantPool . literalIndex ( constant . longValue ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( longValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) longValueIndex ; break ; case T_JavaLangString : this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; int stringValueIndex = this . constantPool . literalIndex ( ( ( StringConstant ) constant ) . stringValue ( ) . toCharArray ( ) ) ; if ( stringValueIndex == - <NUM_LIT:1> ) { if ( ! this . creatingProblemType ) { TypeDeclaration typeDeclaration = this . referenceBinding . scope . referenceContext ; typeDeclaration . scope . problemReporter ( ) . stringConstantIsExceedingUtf8Limit ( defaultValue ) ; } else { this . contentsOffset = attributeOffset ; } } else { this . contents [ this . contentsOffset ++ ] = ( byte ) ( stringValueIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) stringValueIndex ; } } } private void generateElementValueForNonConstantExpression ( Expression defaultValue , int attributeOffset , TypeBinding defaultValueBinding ) { if ( defaultValueBinding != null ) { if ( defaultValueBinding . isEnum ( ) ) { if ( this . contentsOffset + <NUM_LIT:5> >= this . contents . length ) { resizeContents ( <NUM_LIT:5> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:e>' ; FieldBinding fieldBinding = null ; if ( defaultValue instanceof QualifiedNameReference ) { QualifiedNameReference nameReference = ( QualifiedNameReference ) defaultValue ; fieldBinding = ( FieldBinding ) nameReference . binding ; } else if ( defaultValue instanceof SingleNameReference ) { SingleNameReference nameReference = ( SingleNameReference ) defaultValue ; fieldBinding = ( FieldBinding ) nameReference . binding ; } else { this . contentsOffset = attributeOffset ; } if ( fieldBinding != null ) { final int enumConstantTypeNameIndex = this . constantPool . literalIndex ( fieldBinding . type . signature ( ) ) ; final int enumConstantNameIndex = this . constantPool . literalIndex ( fieldBinding . name ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( enumConstantTypeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) enumConstantTypeNameIndex ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( enumConstantNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) enumConstantNameIndex ; } } else if ( defaultValueBinding . isAnnotationType ( ) ) { if ( this . contentsOffset + <NUM_LIT:1> >= this . contents . length ) { resizeContents ( <NUM_LIT:1> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT>' ; generateAnnotation ( ( Annotation ) defaultValue , attributeOffset ) ; } else if ( defaultValueBinding . isArrayType ( ) ) { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:[>' ; if ( defaultValue instanceof ArrayInitializer ) { ArrayInitializer arrayInitializer = ( ArrayInitializer ) defaultValue ; int arrayLength = arrayInitializer . expressions != null ? arrayInitializer . expressions . length : <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( arrayLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) arrayLength ; for ( int i = <NUM_LIT:0> ; i < arrayLength ; i ++ ) { generateElementValue ( arrayInitializer . expressions [ i ] , defaultValueBinding . leafComponentType ( ) , attributeOffset ) ; } } else { this . contentsOffset = attributeOffset ; } } else { if ( this . contentsOffset + <NUM_LIT:3> >= this . contents . length ) { resizeContents ( <NUM_LIT:3> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) '<CHAR_LIT:c>' ; if ( defaultValue instanceof ClassLiteralAccess ) { ClassLiteralAccess classLiteralAccess = ( ClassLiteralAccess ) defaultValue ; final int classInfoIndex = this . constantPool . literalIndex ( classLiteralAccess . targetType . signature ( ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( classInfoIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) classInfoIndex ; } else { this . contentsOffset = attributeOffset ; } } } else { this . contentsOffset = attributeOffset ; } } public int generateMethodInfoAttribute ( MethodBinding methodBinding ) { this . contentsOffset += <NUM_LIT:2> ; if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } ReferenceBinding [ ] thrownsExceptions ; int attributeNumber = <NUM_LIT:0> ; if ( ( thrownsExceptions = methodBinding . thrownExceptions ) != Binding . NO_EXCEPTIONS ) { int length = thrownsExceptions . length ; int exSize = <NUM_LIT:8> + length * <NUM_LIT:2> ; if ( exSize + this . contentsOffset >= this . contents . length ) { resizeContents ( exSize ) ; } int exceptionNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . ExceptionsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( exceptionNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) exceptionNameIndex ; int attributeLength = length * <NUM_LIT:2> + <NUM_LIT:2> ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeLength ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( length > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { int exceptionIndex = this . constantPool . literalIndexForType ( thrownsExceptions [ i ] ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( exceptionIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) exceptionIndex ; } attributeNumber ++ ; } if ( methodBinding . isDeprecated ( ) ) { if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int deprecatedAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . DeprecatedName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( deprecatedAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) deprecatedAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributeNumber ++ ; } if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { if ( methodBinding . isSynthetic ( ) ) { if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int syntheticAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SyntheticName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( syntheticAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) syntheticAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributeNumber ++ ; } if ( methodBinding . isVarargs ( ) ) { if ( this . contentsOffset + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( <NUM_LIT:6> ) ; } int varargsAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . VarargsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( varargsAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) varargsAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; attributeNumber ++ ; } } char [ ] genericSignature = methodBinding . genericSignature ( ) ; if ( genericSignature != null ) { if ( this . contentsOffset + <NUM_LIT:8> >= this . contents . length ) { resizeContents ( <NUM_LIT:8> ) ; } int signatureAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . SignatureName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( signatureAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) signatureAttributeNameIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:2> ; int signatureIndex = this . constantPool . literalIndex ( genericSignature ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( signatureIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) signatureIndex ; attributeNumber ++ ; } if ( this . targetJDK >= ClassFileConstants . JDK1_4 ) { AbstractMethodDeclaration methodDeclaration = methodBinding . sourceMethod ( ) ; if ( methodDeclaration != null ) { Annotation [ ] annotations = methodDeclaration . annotations ; if ( annotations != null ) { attributeNumber += generateRuntimeAnnotations ( annotations ) ; } if ( ( methodBinding . tagBits & TagBits . HasParameterAnnotations ) != <NUM_LIT:0> ) { Argument [ ] arguments = methodDeclaration . arguments ; if ( arguments != null ) { attributeNumber += generateRuntimeAnnotationsForParameters ( arguments ) ; } } } } if ( ( methodBinding . tagBits & TagBits . HasMissingType ) != <NUM_LIT:0> ) { this . missingTypes = methodBinding . collectMissingTypes ( this . missingTypes ) ; } return attributeNumber ; } public int generateMethodInfoAttribute ( MethodBinding methodBinding , AnnotationMethodDeclaration declaration ) { int attributesNumber = generateMethodInfoAttribute ( methodBinding ) ; int attributeOffset = this . contentsOffset ; if ( ( declaration . modifiers & ClassFileConstants . AccAnnotationDefault ) != <NUM_LIT:0> ) { int annotationDefaultNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . AnnotationDefaultName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( annotationDefaultNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) annotationDefaultNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; if ( this . contentsOffset + <NUM_LIT:4> >= this . contents . length ) { resizeContents ( <NUM_LIT:4> ) ; } generateElementValue ( declaration . defaultValue , declaration . binding . returnType , attributeOffset ) ; if ( this . contentsOffset != attributeOffset ) { int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } } return attributesNumber ; } public void generateMethodInfoHeader ( MethodBinding methodBinding ) { generateMethodInfoHeader ( methodBinding , methodBinding . modifiers ) ; } public void generateMethodInfoHeader ( MethodBinding methodBinding , int accessFlags ) { this . methodCount ++ ; if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { accessFlags &= ~ ( ClassFileConstants . AccSynthetic | ClassFileConstants . AccVarargs ) ; } if ( ( methodBinding . tagBits & TagBits . ClearPrivateModifier ) != <NUM_LIT:0> ) { accessFlags &= ~ ClassFileConstants . AccPrivate ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; int nameIndex = this . constantPool . literalIndex ( methodBinding . selector ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; int descriptorIndex = this . constantPool . literalIndex ( methodBinding . signature ( this ) ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) descriptorIndex ; } public void generateMethodInfoHeaderForClinit ( ) { this . methodCount ++ ; if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( ( ClassFileConstants . AccDefault | ClassFileConstants . AccStatic ) > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( ClassFileConstants . AccDefault | ClassFileConstants . AccStatic ) ; int nameIndex = this . constantPool . literalIndex ( ConstantPool . Clinit ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( nameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) nameIndex ; int descriptorIndex = this . constantPool . literalIndex ( ConstantPool . ClinitSignature ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( descriptorIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) descriptorIndex ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = <NUM_LIT:1> ; } public void generateMissingAbstractMethods ( MethodDeclaration [ ] methodDeclarations , CompilationResult compilationResult ) { if ( methodDeclarations != null ) { TypeDeclaration currentDeclaration = this . referenceBinding . scope . referenceContext ; int typeDeclarationSourceStart = currentDeclaration . sourceStart ( ) ; int typeDeclarationSourceEnd = currentDeclaration . sourceEnd ( ) ; for ( int i = <NUM_LIT:0> , max = methodDeclarations . length ; i < max ; i ++ ) { MethodDeclaration methodDeclaration = methodDeclarations [ i ] ; MethodBinding methodBinding = methodDeclaration . binding ; String readableName = new String ( methodBinding . readableName ( ) ) ; CategorizedProblem [ ] problems = compilationResult . problems ; int problemsCount = compilationResult . problemCount ; for ( int j = <NUM_LIT:0> ; j < problemsCount ; j ++ ) { CategorizedProblem problem = problems [ j ] ; if ( problem != null && problem . getID ( ) == IProblem . AbstractMethodMustBeImplemented && problem . getMessage ( ) . indexOf ( readableName ) != - <NUM_LIT:1> && problem . getSourceStart ( ) >= typeDeclarationSourceStart && problem . getSourceEnd ( ) <= typeDeclarationSourceEnd ) { addMissingAbstractProblemMethod ( methodDeclaration , methodBinding , problem , compilationResult ) ; } } } } } private void generateMissingTypesAttribute ( ) { int initialSize = this . missingTypes . size ( ) ; int [ ] missingTypesIndexes = new int [ initialSize ] ; int numberOfMissingTypes = <NUM_LIT:0> ; if ( initialSize > <NUM_LIT:1> ) { Collections . sort ( this . missingTypes , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { TypeBinding typeBinding1 = ( TypeBinding ) o1 ; TypeBinding typeBinding2 = ( TypeBinding ) o2 ; return CharOperation . compareTo ( typeBinding1 . constantPoolName ( ) , typeBinding2 . constantPoolName ( ) ) ; } } ) ; } int previousIndex = <NUM_LIT:0> ; next : for ( int i = <NUM_LIT:0> ; i < initialSize ; i ++ ) { int missingTypeIndex = this . constantPool . literalIndexForType ( ( TypeBinding ) this . missingTypes . get ( i ) ) ; if ( previousIndex == missingTypeIndex ) { continue next ; } previousIndex = missingTypeIndex ; missingTypesIndexes [ numberOfMissingTypes ++ ] = missingTypeIndex ; } int attributeLength = numberOfMissingTypes * <NUM_LIT:2> + <NUM_LIT:2> ; if ( this . contentsOffset + attributeLength + <NUM_LIT:6> >= this . contents . length ) { resizeContents ( attributeLength + <NUM_LIT:6> ) ; } int missingTypesNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . MissingTypesName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( missingTypesNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) missingTypesNameIndex ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeLength ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( numberOfMissingTypes > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) numberOfMissingTypes ; for ( int i = <NUM_LIT:0> ; i < numberOfMissingTypes ; i ++ ) { int missingTypeIndex = missingTypesIndexes [ i ] ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( missingTypeIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) missingTypeIndex ; } } private int generateRuntimeAnnotations ( final Annotation [ ] annotations ) { int attributesNumber = <NUM_LIT:0> ; final int length = annotations . length ; int visibleAnnotationsCounter = <NUM_LIT:0> ; int invisibleAnnotationsCounter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { Annotation annotation = annotations [ i ] ; if ( isRuntimeInvisible ( annotation ) ) { invisibleAnnotationsCounter ++ ; } else if ( isRuntimeVisible ( annotation ) ) { visibleAnnotationsCounter ++ ; } } int annotationAttributeOffset = this . contentsOffset ; int constantPOffset = this . constantPool . currentOffset ; int constantPoolIndex = this . constantPool . currentIndex ; if ( invisibleAnnotationsCounter != <NUM_LIT:0> ) { if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } int runtimeInvisibleAnnotationsAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeInvisibleAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( runtimeInvisibleAnnotationsAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) runtimeInvisibleAnnotationsAttributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; int annotationsLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; loop : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( invisibleAnnotationsCounter == <NUM_LIT:0> ) break loop ; Annotation annotation = annotations [ i ] ; if ( isRuntimeInvisible ( annotation ) ) { int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; invisibleAnnotationsCounter -- ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; } } } if ( counter != <NUM_LIT:0> ) { this . contents [ annotationsLengthOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ annotationsLengthOffset ++ ] = ( byte ) counter ; int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; this . constantPool . resetForAttributeName ( AttributeNamesConstants . RuntimeInvisibleAnnotationsName , constantPoolIndex , constantPOffset ) ; } } annotationAttributeOffset = this . contentsOffset ; constantPOffset = this . constantPool . currentOffset ; constantPoolIndex = this . constantPool . currentIndex ; if ( visibleAnnotationsCounter != <NUM_LIT:0> ) { if ( this . contentsOffset + <NUM_LIT:10> >= this . contents . length ) { resizeContents ( <NUM_LIT:10> ) ; } int runtimeVisibleAnnotationsAttributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeVisibleAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( runtimeVisibleAnnotationsAttributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) runtimeVisibleAnnotationsAttributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; int annotationsLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; loop : for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( visibleAnnotationsCounter == <NUM_LIT:0> ) break loop ; Annotation annotation = annotations [ i ] ; if ( isRuntimeVisible ( annotation ) ) { visibleAnnotationsCounter -- ; int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; } } } if ( counter != <NUM_LIT:0> ) { this . contents [ annotationsLengthOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ annotationsLengthOffset ++ ] = ( byte ) counter ; int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; this . constantPool . resetForAttributeName ( AttributeNamesConstants . RuntimeVisibleAnnotationsName , constantPoolIndex , constantPOffset ) ; } } return attributesNumber ; } private int generateRuntimeAnnotationsForParameters ( Argument [ ] arguments ) { final int argumentsLength = arguments . length ; final int VISIBLE_INDEX = <NUM_LIT:0> ; final int INVISIBLE_INDEX = <NUM_LIT:1> ; int invisibleParametersAnnotationsCounter = <NUM_LIT:0> ; int visibleParametersAnnotationsCounter = <NUM_LIT:0> ; int [ ] [ ] annotationsCounters = new int [ argumentsLength ] [ <NUM_LIT:2> ] ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { Argument argument = arguments [ i ] ; Annotation [ ] annotations = argument . annotations ; if ( annotations != null ) { for ( int j = <NUM_LIT:0> , max2 = annotations . length ; j < max2 ; j ++ ) { Annotation annotation = annotations [ j ] ; if ( isRuntimeInvisible ( annotation ) ) { annotationsCounters [ i ] [ INVISIBLE_INDEX ] ++ ; invisibleParametersAnnotationsCounter ++ ; } else if ( isRuntimeVisible ( annotation ) ) { annotationsCounters [ i ] [ VISIBLE_INDEX ] ++ ; visibleParametersAnnotationsCounter ++ ; } } } } int attributesNumber = <NUM_LIT:0> ; int annotationAttributeOffset = this . contentsOffset ; if ( invisibleParametersAnnotationsCounter != <NUM_LIT:0> ) { int globalCounter = <NUM_LIT:0> ; if ( this . contentsOffset + <NUM_LIT:7> >= this . contents . length ) { resizeContents ( <NUM_LIT:7> ) ; } int attributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeInvisibleParameterAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; this . contents [ this . contentsOffset ++ ] = ( byte ) argumentsLength ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( invisibleParametersAnnotationsCounter == <NUM_LIT:0> ) { this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; } else { final int numberOfInvisibleAnnotations = annotationsCounters [ i ] [ INVISIBLE_INDEX ] ; int invisibleAnnotationsOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; if ( numberOfInvisibleAnnotations != <NUM_LIT:0> ) { Argument argument = arguments [ i ] ; Annotation [ ] annotations = argument . annotations ; for ( int j = <NUM_LIT:0> , max = annotations . length ; j < max ; j ++ ) { Annotation annotation = annotations [ j ] ; if ( isRuntimeInvisible ( annotation ) ) { int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; globalCounter ++ ; } invisibleParametersAnnotationsCounter -- ; } } } this . contents [ invisibleAnnotationsOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ invisibleAnnotationsOffset ] = ( byte ) counter ; } } if ( globalCounter != <NUM_LIT:0> ) { int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; } } if ( visibleParametersAnnotationsCounter != <NUM_LIT:0> ) { int globalCounter = <NUM_LIT:0> ; if ( this . contentsOffset + <NUM_LIT:7> >= this . contents . length ) { resizeContents ( <NUM_LIT:7> ) ; } int attributeNameIndex = this . constantPool . literalIndex ( AttributeNamesConstants . RuntimeVisibleParameterAnnotationsName ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( attributeNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) attributeNameIndex ; int attributeLengthOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:4> ; this . contents [ this . contentsOffset ++ ] = ( byte ) argumentsLength ; for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { if ( this . contentsOffset + <NUM_LIT:2> >= this . contents . length ) { resizeContents ( <NUM_LIT:2> ) ; } if ( visibleParametersAnnotationsCounter == <NUM_LIT:0> ) { this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; this . contents [ this . contentsOffset ++ ] = ( byte ) <NUM_LIT:0> ; } else { final int numberOfVisibleAnnotations = annotationsCounters [ i ] [ VISIBLE_INDEX ] ; int visibleAnnotationsOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; int counter = <NUM_LIT:0> ; if ( numberOfVisibleAnnotations != <NUM_LIT:0> ) { Argument argument = arguments [ i ] ; Annotation [ ] annotations = argument . annotations ; for ( int j = <NUM_LIT:0> , max = annotations . length ; j < max ; j ++ ) { Annotation annotation = annotations [ j ] ; if ( isRuntimeVisible ( annotation ) ) { int currentAnnotationOffset = this . contentsOffset ; generateAnnotation ( annotation , currentAnnotationOffset ) ; if ( this . contentsOffset != currentAnnotationOffset ) { counter ++ ; globalCounter ++ ; } visibleParametersAnnotationsCounter -- ; } } } this . contents [ visibleAnnotationsOffset ++ ] = ( byte ) ( counter > > <NUM_LIT:8> ) ; this . contents [ visibleAnnotationsOffset ] = ( byte ) counter ; } } if ( globalCounter != <NUM_LIT:0> ) { int attributeLength = this . contentsOffset - attributeLengthOffset - <NUM_LIT:4> ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:24> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:16> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) ( attributeLength > > <NUM_LIT:8> ) ; this . contents [ attributeLengthOffset ++ ] = ( byte ) attributeLength ; attributesNumber ++ ; } else { this . contentsOffset = annotationAttributeOffset ; } } return attributesNumber ; } public byte [ ] getBytes ( ) { if ( this . bytes == null ) { this . bytes = new byte [ this . headerOffset + this . contentsOffset ] ; System . arraycopy ( this . header , <NUM_LIT:0> , this . bytes , <NUM_LIT:0> , this . headerOffset ) ; System . arraycopy ( this . contents , <NUM_LIT:0> , this . bytes , this . headerOffset , this . contentsOffset ) ; } return this . bytes ; } public char [ ] [ ] getCompoundName ( ) { return CharOperation . splitOn ( '<CHAR_LIT:/>' , fileName ( ) ) ; } private int getParametersCount ( char [ ] methodSignature ) { int i = CharOperation . indexOf ( '<CHAR_LIT:(>' , methodSignature ) ; i ++ ; char currentCharacter = methodSignature [ i ] ; if ( currentCharacter == '<CHAR_LIT:)>' ) { return <NUM_LIT:0> ; } int result = <NUM_LIT:0> ; while ( true ) { currentCharacter = methodSignature [ i ] ; if ( currentCharacter == '<CHAR_LIT:)>' ) { return result ; } switch ( currentCharacter ) { case '<CHAR_LIT:[>' : int scanType = scanType ( methodSignature , i + <NUM_LIT:1> ) ; result ++ ; i = scanType + <NUM_LIT:1> ; break ; case '<CHAR_LIT>' : scanType = CharOperation . indexOf ( '<CHAR_LIT:;>' , methodSignature , i + <NUM_LIT:1> ) ; result ++ ; i = scanType + <NUM_LIT:1> ; break ; case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : result ++ ; i ++ ; break ; default : throw new IllegalArgumentException ( ) ; } } } private char [ ] getReturnType ( char [ ] methodSignature ) { int paren = CharOperation . lastIndexOf ( '<CHAR_LIT:)>' , methodSignature ) ; return CharOperation . subarray ( methodSignature , paren + <NUM_LIT:1> , methodSignature . length ) ; } private final int i4At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } protected void initByteArrays ( ) { int members = this . referenceBinding . methods ( ) . length + this . referenceBinding . fields ( ) . length ; this . header = new byte [ INITIAL_HEADER_SIZE ] ; this . contents = new byte [ members < <NUM_LIT:15> ? INITIAL_CONTENTS_SIZE : INITIAL_HEADER_SIZE ] ; } public void initialize ( SourceTypeBinding aType , ClassFile parentClassFile , boolean createProblemType ) { this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:24> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:16> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:8> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( <NUM_LIT> > > <NUM_LIT:0> ) ; long targetVersion = this . targetJDK ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:8> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:0> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:24> ) ; this . header [ this . headerOffset ++ ] = ( byte ) ( targetVersion > > <NUM_LIT:16> ) ; this . constantPoolOffset = this . headerOffset ; this . headerOffset += <NUM_LIT:2> ; this . constantPool . initialize ( this ) ; int accessFlags = aType . getAccessFlags ( ) ; if ( aType . isPrivate ( ) ) { accessFlags &= ~ ClassFileConstants . AccPublic ; } if ( aType . isProtected ( ) ) { accessFlags |= ClassFileConstants . AccPublic ; } accessFlags &= ~ ( ClassFileConstants . AccStrictfp | ClassFileConstants . AccProtected | ClassFileConstants . AccPrivate | ClassFileConstants . AccStatic | ClassFileConstants . AccSynchronized | ClassFileConstants . AccNative ) ; if ( ! aType . isInterface ( ) ) { accessFlags |= ClassFileConstants . AccSuper ; } if ( aType . isAnonymousType ( ) ) { accessFlags &= ~ ClassFileConstants . AccFinal ; } this . enclosingClassFile = parentClassFile ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( accessFlags > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) accessFlags ; int classNameIndex = this . constantPool . literalIndexForType ( aType ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( classNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) classNameIndex ; int superclassNameIndex ; if ( aType . isInterface ( ) ) { superclassNameIndex = this . constantPool . literalIndexForType ( ConstantPool . JavaLangObjectConstantPoolName ) ; } else { superclassNameIndex = ( aType . superclass == null ? <NUM_LIT:0> : this . constantPool . literalIndexForType ( aType . superclass ) ) ; } this . contents [ this . contentsOffset ++ ] = ( byte ) ( superclassNameIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) superclassNameIndex ; ReferenceBinding [ ] superInterfacesBinding = aType . superInterfaces ( ) ; int interfacesCount = superInterfacesBinding . length ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( interfacesCount > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) interfacesCount ; for ( int i = <NUM_LIT:0> ; i < interfacesCount ; i ++ ) { int interfaceIndex = this . constantPool . literalIndexForType ( superInterfacesBinding [ i ] ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) ( interfaceIndex > > <NUM_LIT:8> ) ; this . contents [ this . contentsOffset ++ ] = ( byte ) interfaceIndex ; } this . creatingProblemType = createProblemType ; this . codeStream . maxFieldCount = aType . scope . outerMostClassScope ( ) . referenceType ( ) . maxFieldCount ; } private void initializeDefaultLocals ( StackMapFrame frame , MethodBinding methodBinding , int maxLocals , int codeLength ) { if ( maxLocals != <NUM_LIT:0> ) { int resolvedPosition = <NUM_LIT:0> ; final boolean isConstructor = methodBinding . isConstructor ( ) ; if ( isConstructor ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , methodBinding . declaringClass , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = <NUM_LIT:0> ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( VerificationTypeInfo . ITEM_UNINITIALIZED_THIS , methodBinding . declaringClass ) ) ; resolvedPosition ++ ; } else if ( ! methodBinding . isStatic ( ) ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , methodBinding . declaringClass , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = <NUM_LIT:0> ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( VerificationTypeInfo . ITEM_OBJECT , methodBinding . declaringClass ) ) ; resolvedPosition ++ ; } if ( isConstructor ) { if ( methodBinding . declaringClass . isEnum ( ) ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , this . referenceBinding . scope . getJavaLangString ( ) , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( TypeIds . T_JavaLangString , ConstantPool . JavaLangStringConstantPoolName ) ) ; resolvedPosition ++ ; localVariableBinding = new LocalVariableBinding ( "<STR_LIT>" . toCharArray ( ) , TypeBinding . INT , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( TypeBinding . INT ) ) ; resolvedPosition ++ ; } if ( methodBinding . declaringClass . isNestedType ( ) ) { ReferenceBinding enclosingInstanceTypes [ ] ; if ( ( enclosingInstanceTypes = methodBinding . declaringClass . syntheticEnclosingInstanceTypes ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = enclosingInstanceTypes . length ; i < max ; i ++ ) { LocalVariableBinding localVariableBinding = new LocalVariableBinding ( ( "<STR_LIT>" + i ) . toCharArray ( ) , enclosingInstanceTypes [ i ] , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( enclosingInstanceTypes [ i ] ) ) ; resolvedPosition ++ ; } } TypeBinding [ ] arguments ; if ( ( arguments = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = arguments [ i ] ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } SyntheticArgumentBinding syntheticArguments [ ] ; if ( ( syntheticArguments = methodBinding . declaringClass . syntheticOuterLocalVariables ( ) ) != null ) { for ( int i = <NUM_LIT:0> , max = syntheticArguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = syntheticArguments [ i ] . type ; LocalVariableBinding localVariableBinding = new LocalVariableBinding ( ( "<STR_LIT>" + i ) . toCharArray ( ) , typeBinding , <NUM_LIT:0> , false ) ; localVariableBinding . resolvedPosition = resolvedPosition ; this . codeStream . record ( localVariableBinding ) ; localVariableBinding . recordInitializationStartPC ( <NUM_LIT:0> ) ; localVariableBinding . recordInitializationEndPC ( codeLength ) ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } } else { TypeBinding [ ] arguments ; if ( ( arguments = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = arguments [ i ] ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } } } else { TypeBinding [ ] arguments ; if ( ( arguments = methodBinding . parameters ) != null ) { for ( int i = <NUM_LIT:0> , max = arguments . length ; i < max ; i ++ ) { final TypeBinding typeBinding = arguments [ i ] ; frame . putLocal ( resolvedPosition , new VerificationTypeInfo ( typeBinding ) ) ; switch ( typeBinding . id ) { case TypeIds . T_double : case TypeIds . T_long : resolvedPosition += <NUM_LIT:2> ; break ; default : resolvedPosition ++ ; } } } } } } private void initializeLocals ( boolean isStatic , int currentPC , StackMapFrame currentFrame ) { VerificationTypeInfo [ ] locals = currentFrame . locals ; int localsLength = locals . length ; int i = <NUM_LIT:0> ; if ( ! isStatic ) { i = <NUM_LIT:1> ; } for ( ; i < localsLength ; i ++ ) { locals [ i ] = null ; } i = <NUM_LIT:0> ; locals : for ( int max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable == null ) continue ; int resolvedPosition = localVariable . resolvedPosition ; final TypeBinding localVariableTypeBinding = localVariable . type ; inits : for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( currentPC < startPC ) { continue inits ; } else if ( currentPC < endPC ) { if ( currentFrame . locals [ resolvedPosition ] == null ) { currentFrame . locals [ resolvedPosition ] = new VerificationTypeInfo ( localVariableTypeBinding ) ; } continue locals ; } } } } private boolean isRuntimeInvisible ( Annotation annotation ) { final TypeBinding annotationBinding = annotation . 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 ; } private boolean isRuntimeVisible ( Annotation annotation ) { final TypeBinding annotationBinding = annotation . 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 ClassFile outerMostEnclosingClassFile ( ) { ClassFile current = this ; while ( current . enclosingClassFile != null ) current = current . enclosingClassFile ; return current ; } public void recordInnerClasses ( TypeBinding binding ) { if ( this . innerClassesBindings == null ) { this . innerClassesBindings = new HashSet ( INNER_CLASSES_SIZE ) ; } ReferenceBinding innerClass = ( ReferenceBinding ) binding ; this . innerClassesBindings . add ( innerClass . erasure ( ) ) ; ReferenceBinding enclosingType = innerClass . enclosingType ( ) ; while ( enclosingType != null && enclosingType . isNestedType ( ) ) { this . innerClassesBindings . add ( enclosingType . erasure ( ) ) ; enclosingType = enclosingType . enclosingType ( ) ; } } public void reset ( SourceTypeBinding typeBinding ) { final CompilerOptions options = typeBinding . scope . compilerOptions ( ) ; this . referenceBinding = typeBinding ; this . isNestedType = typeBinding . isNestedType ( ) ; this . targetJDK = options . targetJDK ; this . produceAttributes = options . produceDebugAttributes ; if ( this . targetJDK >= ClassFileConstants . JDK1_6 ) { this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP_TABLE ; } else if ( this . targetJDK == ClassFileConstants . CLDC_1_1 ) { this . targetJDK = ClassFileConstants . JDK1_1 ; this . produceAttributes |= ClassFileConstants . ATTR_STACK_MAP ; } this . bytes = null ; this . constantPool . reset ( ) ; this . codeStream . reset ( this ) ; this . constantPoolOffset = <NUM_LIT:0> ; this . contentsOffset = <NUM_LIT:0> ; this . creatingProblemType = false ; this . enclosingClassFile = null ; this . headerOffset = <NUM_LIT:0> ; this . methodCount = <NUM_LIT:0> ; this . methodCountOffset = <NUM_LIT:0> ; if ( this . innerClassesBindings != null ) { this . innerClassesBindings . clear ( ) ; } this . missingTypes = null ; this . visitedTypes = null ; } private final void resizeContents ( int minimalSize ) { int length = this . contents . length ; int toAdd = length ; if ( toAdd < minimalSize ) toAdd = minimalSize ; System . arraycopy ( this . contents , <NUM_LIT:0> , this . contents = new byte [ length + toAdd ] , <NUM_LIT:0> , length ) ; } private VerificationTypeInfo retrieveLocal ( int currentPC , int resolvedPosition ) { for ( int i = <NUM_LIT:0> , max = this . codeStream . allLocalsCounter ; i < max ; i ++ ) { LocalVariableBinding localVariable = this . codeStream . locals [ i ] ; if ( localVariable == null ) continue ; if ( resolvedPosition == localVariable . resolvedPosition ) { inits : for ( int j = <NUM_LIT:0> ; j < localVariable . initializationCount ; j ++ ) { int startPC = localVariable . initializationPCs [ j << <NUM_LIT:1> ] ; int endPC = localVariable . initializationPCs [ ( j << <NUM_LIT:1> ) + <NUM_LIT:1> ] ; if ( currentPC < startPC ) { continue inits ; } else if ( currentPC < endPC ) { return new VerificationTypeInfo ( localVariable . type ) ; } } } } return null ; } private int scanType ( char [ ] methodSignature , int index ) { switch ( methodSignature [ index ] ) { case '<CHAR_LIT:[>' : return scanType ( methodSignature , index + <NUM_LIT:1> ) ; case '<CHAR_LIT>' : return CharOperation . indexOf ( '<CHAR_LIT:;>' , methodSignature , index + <NUM_LIT:1> ) ; case '<CHAR_LIT:Z>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : case '<CHAR_LIT>' : return index ; default : throw new IllegalArgumentException ( ) ; } } public void setForMethodInfos ( ) { this . methodCountOffset = this . contentsOffset ; this . contentsOffset += <NUM_LIT:2> ; } public void traverse ( MethodBinding methodBinding , int maxLocals , byte [ ] bytecodes , int codeOffset , int codeLength , ArrayList frames , boolean isClinit ) { StackMapFrameCodeStream stackMapFrameCodeStream = ( StackMapFrameCodeStream ) this . codeStream ; int [ ] framePositions = stackMapFrameCodeStream . getFramePositions ( ) ; int pc = codeOffset ; int index ; int [ ] constantPoolOffsets = this . constantPool . offsets ; byte [ ] poolContents = this . constantPool . poolContent ; int indexInFramePositions = <NUM_LIT:0> ; int framePositionsLength = framePositions . length ; int currentFramePosition = framePositions [ <NUM_LIT:0> ] ; int indexInStackDepthMarkers = <NUM_LIT:0> ; StackDepthMarker [ ] stackDepthMarkers = stackMapFrameCodeStream . getStackDepthMarkers ( ) ; int stackDepthMarkersLength = stackDepthMarkers == null ? <NUM_LIT:0> : stackDepthMarkers . length ; boolean hasStackDepthMarkers = stackDepthMarkersLength != <NUM_LIT:0> ; StackDepthMarker stackDepthMarker = null ; if ( hasStackDepthMarkers ) { stackDepthMarker = stackDepthMarkers [ <NUM_LIT:0> ] ; } int indexInStackMarkers = <NUM_LIT:0> ; StackMarker [ ] stackMarkers = stackMapFrameCodeStream . getStackMarkers ( ) ; int stackMarkersLength = stackMarkers == null ? <NUM_LIT:0> : stackMarkers . length ; boolean hasStackMarkers = stackMarkersLength != <NUM_LIT:0> ; StackMarker stackMarker = null ; if ( hasStackMarkers ) { stackMarker = stackMarkers [ <NUM_LIT:0> ] ; } int indexInExceptionMarkers = <NUM_LIT:0> ; ExceptionMarker [ ] exceptionMarkers = stackMapFrameCodeStream . getExceptionMarkers ( ) ; int exceptionsMarkersLength = exceptionMarkers == null ? <NUM_LIT:0> : exceptionMarkers . length ; boolean hasExceptionMarkers = exceptionsMarkersLength != <NUM_LIT:0> ; ExceptionMarker exceptionMarker = null ; if ( hasExceptionMarkers ) { exceptionMarker = exceptionMarkers [ <NUM_LIT:0> ] ; } StackMapFrame frame = new StackMapFrame ( maxLocals ) ; if ( ! isClinit ) { initializeDefaultLocals ( frame , methodBinding , maxLocals , codeLength ) ; } frame . pc = - <NUM_LIT:1> ; frames . add ( frame . duplicate ( ) ) ; while ( true ) { int currentPC = pc - codeOffset ; if ( hasStackMarkers && stackMarker . pc == currentPC ) { VerificationTypeInfo [ ] infos = frame . stackItems ; VerificationTypeInfo [ ] tempInfos = new VerificationTypeInfo [ frame . numberOfStackItems ] ; System . arraycopy ( infos , <NUM_LIT:0> , tempInfos , <NUM_LIT:0> , frame . numberOfStackItems ) ; stackMarker . setInfos ( tempInfos ) ; } else if ( hasStackMarkers && stackMarker . destinationPC == currentPC ) { VerificationTypeInfo [ ] infos = stackMarker . infos ; frame . stackItems = infos ; frame . numberOfStackItems = infos . length ; indexInStackMarkers ++ ; if ( indexInStackMarkers < stackMarkersLength ) { stackMarker = stackMarkers [ indexInStackMarkers ] ; } else { hasStackMarkers = false ; } } if ( hasStackDepthMarkers && stackDepthMarker . pc == currentPC ) { TypeBinding typeBinding = stackDepthMarker . typeBinding ; if ( typeBinding != null ) { if ( stackDepthMarker . delta > <NUM_LIT:0> ) { frame . addStackItem ( new VerificationTypeInfo ( typeBinding ) ) ; } else { frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( typeBinding ) ; } } else { frame . numberOfStackItems -- ; } indexInStackDepthMarkers ++ ; if ( indexInStackDepthMarkers < stackDepthMarkersLength ) { stackDepthMarker = stackDepthMarkers [ indexInStackDepthMarkers ] ; } else { hasStackDepthMarkers = false ; } } if ( hasExceptionMarkers && exceptionMarker . pc == currentPC ) { frame . numberOfStackItems = <NUM_LIT:0> ; frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , VerificationTypeInfo . ITEM_OBJECT , exceptionMarker . constantPoolName ) ) ; indexInExceptionMarkers ++ ; if ( indexInExceptionMarkers < exceptionsMarkersLength ) { exceptionMarker = exceptionMarkers [ indexInExceptionMarkers ] ; } else { hasExceptionMarkers = false ; } } if ( currentFramePosition < currentPC ) { do { indexInFramePositions ++ ; if ( indexInFramePositions < framePositionsLength ) { currentFramePosition = framePositions [ indexInFramePositions ] ; } else { return ; } } while ( currentFramePosition < currentPC ) ; } if ( currentFramePosition == currentPC ) { StackMapFrame currentFrame = frame . duplicate ( ) ; currentFrame . pc = currentPC ; initializeLocals ( isClinit ? true : methodBinding . isStatic ( ) , currentPC , currentFrame ) ; frames . add ( currentFrame ) ; indexInFramePositions ++ ; if ( indexInFramePositions < framePositionsLength ) { currentFramePosition = framePositions [ indexInFramePositions ] ; } else { return ; } } byte opcode = ( byte ) u1At ( bytecodes , <NUM_LIT:0> , pc ) ; switch ( opcode ) { case Opcodes . OPC_nop : pc ++ ; break ; case Opcodes . OPC_aconst_null : frame . addStackItem ( TypeBinding . NULL ) ; pc ++ ; break ; case Opcodes . OPC_iconst_m1 : case Opcodes . OPC_iconst_0 : case Opcodes . OPC_iconst_1 : case Opcodes . OPC_iconst_2 : case Opcodes . OPC_iconst_3 : case Opcodes . OPC_iconst_4 : case Opcodes . OPC_iconst_5 : frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_lconst_0 : case Opcodes . OPC_lconst_1 : frame . addStackItem ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_fconst_0 : case Opcodes . OPC_fconst_1 : case Opcodes . OPC_fconst_2 : frame . addStackItem ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_dconst_0 : case Opcodes . OPC_dconst_1 : frame . addStackItem ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_bipush : frame . addStackItem ( TypeBinding . BYTE ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_sipush : frame . addStackItem ( TypeBinding . SHORT ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_ldc : index = u1At ( bytecodes , <NUM_LIT:1> , pc ) ; switch ( u1At ( poolContents , <NUM_LIT:0> , constantPoolOffsets [ index ] ) ) { case ClassFileConstants . StringTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangString , ConstantPool . JavaLangStringConstantPoolName ) ) ; break ; case ClassFileConstants . IntegerTag : frame . addStackItem ( TypeBinding . INT ) ; break ; case ClassFileConstants . FloatTag : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case ClassFileConstants . ClassTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangClass , ConstantPool . JavaLangClassConstantPoolName ) ) ; } pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_ldc_w : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; switch ( u1At ( poolContents , <NUM_LIT:0> , constantPoolOffsets [ index ] ) ) { case ClassFileConstants . StringTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangString , ConstantPool . JavaLangStringConstantPoolName ) ) ; break ; case ClassFileConstants . IntegerTag : frame . addStackItem ( TypeBinding . INT ) ; break ; case ClassFileConstants . FloatTag : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case ClassFileConstants . ClassTag : frame . addStackItem ( new VerificationTypeInfo ( TypeIds . T_JavaLangClass , ConstantPool . JavaLangClassConstantPoolName ) ) ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_ldc2_w : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; switch ( u1At ( poolContents , <NUM_LIT:0> , constantPoolOffsets [ index ] ) ) { case ClassFileConstants . DoubleTag : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case ClassFileConstants . LongTag : frame . addStackItem ( TypeBinding . LONG ) ; break ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_iload : frame . addStackItem ( TypeBinding . INT ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_lload : frame . addStackItem ( TypeBinding . LONG ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_fload : frame . addStackItem ( TypeBinding . FLOAT ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_dload : frame . addStackItem ( TypeBinding . DOUBLE ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_aload : index = u1At ( bytecodes , <NUM_LIT:1> , pc ) ; VerificationTypeInfo localsN = retrieveLocal ( currentPC , index ) ; frame . addStackItem ( localsN ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_iload_0 : case Opcodes . OPC_iload_1 : case Opcodes . OPC_iload_2 : case Opcodes . OPC_iload_3 : frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_lload_0 : case Opcodes . OPC_lload_1 : case Opcodes . OPC_lload_2 : case Opcodes . OPC_lload_3 : frame . addStackItem ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_fload_0 : case Opcodes . OPC_fload_1 : case Opcodes . OPC_fload_2 : case Opcodes . OPC_fload_3 : frame . addStackItem ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_dload_0 : case Opcodes . OPC_dload_1 : case Opcodes . OPC_dload_2 : case Opcodes . OPC_dload_3 : frame . addStackItem ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_aload_0 : VerificationTypeInfo locals0 = frame . locals [ <NUM_LIT:0> ] ; if ( locals0 == null ) { locals0 = retrieveLocal ( currentPC , <NUM_LIT:0> ) ; } frame . addStackItem ( locals0 ) ; pc ++ ; break ; case Opcodes . OPC_aload_1 : VerificationTypeInfo locals1 = retrieveLocal ( currentPC , <NUM_LIT:1> ) ; frame . addStackItem ( locals1 ) ; pc ++ ; break ; case Opcodes . OPC_aload_2 : VerificationTypeInfo locals2 = retrieveLocal ( currentPC , <NUM_LIT:2> ) ; frame . addStackItem ( locals2 ) ; pc ++ ; break ; case Opcodes . OPC_aload_3 : VerificationTypeInfo locals3 = retrieveLocal ( currentPC , <NUM_LIT:3> ) ; frame . addStackItem ( locals3 ) ; pc ++ ; break ; case Opcodes . OPC_iaload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_laload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_faload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_daload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_aaload : frame . numberOfStackItems -- ; frame . replaceWithElementType ( ) ; pc ++ ; break ; case Opcodes . OPC_baload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . BYTE ) ; pc ++ ; break ; case Opcodes . OPC_caload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . CHAR ) ; pc ++ ; break ; case Opcodes . OPC_saload : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . SHORT ) ; pc ++ ; break ; case Opcodes . OPC_istore : case Opcodes . OPC_lstore : case Opcodes . OPC_fstore : case Opcodes . OPC_dstore : frame . numberOfStackItems -- ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_astore : index = u1At ( bytecodes , <NUM_LIT:1> , pc ) ; frame . numberOfStackItems -- ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_astore_0 : frame . locals [ <NUM_LIT:0> ] = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_astore_1 : case Opcodes . OPC_astore_2 : case Opcodes . OPC_astore_3 : case Opcodes . OPC_istore_0 : case Opcodes . OPC_istore_1 : case Opcodes . OPC_istore_2 : case Opcodes . OPC_istore_3 : case Opcodes . OPC_lstore_0 : case Opcodes . OPC_lstore_1 : case Opcodes . OPC_lstore_2 : case Opcodes . OPC_lstore_3 : case Opcodes . OPC_fstore_0 : case Opcodes . OPC_fstore_1 : case Opcodes . OPC_fstore_2 : case Opcodes . OPC_fstore_3 : case Opcodes . OPC_dstore_0 : case Opcodes . OPC_dstore_1 : case Opcodes . OPC_dstore_2 : case Opcodes . OPC_dstore_3 : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_iastore : case Opcodes . OPC_lastore : case Opcodes . OPC_fastore : case Opcodes . OPC_dastore : case Opcodes . OPC_aastore : case Opcodes . OPC_bastore : case Opcodes . OPC_castore : case Opcodes . OPC_sastore : frame . numberOfStackItems -= <NUM_LIT:3> ; pc ++ ; break ; case Opcodes . OPC_pop : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_pop2 : int numberOfStackItems = frame . numberOfStackItems ; switch ( frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . numberOfStackItems -- ; break ; default : frame . numberOfStackItems -= <NUM_LIT:2> ; } pc ++ ; break ; case Opcodes . OPC_dup : frame . addStackItem ( frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ) ; pc ++ ; break ; case Opcodes . OPC_dup_x1 : VerificationTypeInfo info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; VerificationTypeInfo info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; pc ++ ; break ; case Opcodes . OPC_dup_x2 : info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info2 . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info3 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } pc ++ ; break ; case Opcodes . OPC_dup2 : info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : frame . addStackItem ( info ) ; frame . addStackItem ( info ) ; break ; default : info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } pc ++ ; break ; case Opcodes . OPC_dup2_x1 : info = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : VerificationTypeInfo info3 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } pc ++ ; break ; case Opcodes . OPC_dup2_x2 : numberOfStackItems = frame . numberOfStackItems ; info = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; info2 = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : switch ( info2 . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . addStackItem ( info ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info3 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info3 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; switch ( info3 . id ( ) ) { case TypeIds . T_long : case TypeIds . T_double : frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; break ; default : numberOfStackItems = frame . numberOfStackItems ; VerificationTypeInfo info4 = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; frame . addStackItem ( info4 ) ; frame . addStackItem ( info3 ) ; frame . addStackItem ( info2 ) ; frame . addStackItem ( info ) ; } } pc ++ ; break ; case Opcodes . OPC_swap : numberOfStackItems = frame . numberOfStackItems ; info = frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] ; info2 = frame . stackItems [ numberOfStackItems - <NUM_LIT:2> ] ; frame . stackItems [ numberOfStackItems - <NUM_LIT:1> ] = info2 ; frame . stackItems [ numberOfStackItems - <NUM_LIT:2> ] = info ; pc ++ ; break ; case Opcodes . OPC_iadd : case Opcodes . OPC_ladd : case Opcodes . OPC_fadd : case Opcodes . OPC_dadd : case Opcodes . OPC_isub : case Opcodes . OPC_lsub : case Opcodes . OPC_fsub : case Opcodes . OPC_dsub : case Opcodes . OPC_imul : case Opcodes . OPC_lmul : case Opcodes . OPC_fmul : case Opcodes . OPC_dmul : case Opcodes . OPC_idiv : case Opcodes . OPC_ldiv : case Opcodes . OPC_fdiv : case Opcodes . OPC_ddiv : case Opcodes . OPC_irem : case Opcodes . OPC_lrem : case Opcodes . OPC_frem : case Opcodes . OPC_drem : case Opcodes . OPC_ishl : case Opcodes . OPC_lshl : case Opcodes . OPC_ishr : case Opcodes . OPC_lshr : case Opcodes . OPC_iushr : case Opcodes . OPC_lushr : case Opcodes . OPC_iand : case Opcodes . OPC_land : case Opcodes . OPC_ior : case Opcodes . OPC_lor : case Opcodes . OPC_ixor : case Opcodes . OPC_lxor : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_ineg : case Opcodes . OPC_lneg : case Opcodes . OPC_fneg : case Opcodes . OPC_dneg : pc ++ ; break ; case Opcodes . OPC_iinc : pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_i2l : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_i2f : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_i2d : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_l2i : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_l2f : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_l2d : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_f2i : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_f2l : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_f2d : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . DOUBLE ) ; pc ++ ; break ; case Opcodes . OPC_d2i : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_d2l : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . LONG ) ; pc ++ ; break ; case Opcodes . OPC_d2f : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . FLOAT ) ; pc ++ ; break ; case Opcodes . OPC_i2b : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . BYTE ) ; pc ++ ; break ; case Opcodes . OPC_i2c : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . CHAR ) ; pc ++ ; break ; case Opcodes . OPC_i2s : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . SHORT ) ; pc ++ ; break ; case Opcodes . OPC_lcmp : case Opcodes . OPC_fcmpl : case Opcodes . OPC_fcmpg : case Opcodes . OPC_dcmpl : case Opcodes . OPC_dcmpg : frame . numberOfStackItems -= <NUM_LIT:2> ; frame . addStackItem ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_ifeq : case Opcodes . OPC_ifne : case Opcodes . OPC_iflt : case Opcodes . OPC_ifge : case Opcodes . OPC_ifgt : case Opcodes . OPC_ifle : frame . numberOfStackItems -- ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_if_icmpeq : case Opcodes . OPC_if_icmpne : case Opcodes . OPC_if_icmplt : case Opcodes . OPC_if_icmpge : case Opcodes . OPC_if_icmpgt : case Opcodes . OPC_if_icmple : case Opcodes . OPC_if_acmpeq : case Opcodes . OPC_if_acmpne : frame . numberOfStackItems -= <NUM_LIT:2> ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_goto : pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_tableswitch : pc ++ ; while ( ( ( pc - codeOffset ) & <NUM_LIT> ) != <NUM_LIT:0> ) { pc ++ ; } pc += <NUM_LIT:4> ; int low = i4At ( bytecodes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int high = i4At ( bytecodes , <NUM_LIT:0> , pc ) ; pc += <NUM_LIT:4> ; int length = high - low + <NUM_LIT:1> ; pc += ( length * <NUM_LIT:4> ) ; frame . numberOfStackItems -- ; break ; case Opcodes . OPC_lookupswitch : pc ++ ; while ( ( ( pc - codeOffset ) & <NUM_LIT> ) != <NUM_LIT:0> ) { pc ++ ; } pc += <NUM_LIT:4> ; int npairs = ( int ) u4At ( bytecodes , <NUM_LIT:0> , pc ) ; pc += ( <NUM_LIT:4> + npairs * <NUM_LIT:8> ) ; frame . numberOfStackItems -- ; break ; case Opcodes . OPC_ireturn : case Opcodes . OPC_lreturn : case Opcodes . OPC_freturn : case Opcodes . OPC_dreturn : case Opcodes . OPC_areturn : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_return : pc ++ ; break ; case Opcodes . OPC_getstatic : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; int nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; int utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; char [ ] descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; if ( descriptor . length == <NUM_LIT:1> ) { switch ( descriptor [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else if ( descriptor [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , descriptor ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( descriptor , <NUM_LIT:1> , descriptor . length - <NUM_LIT:1> ) ) ) ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_putstatic : frame . numberOfStackItems -- ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_getfield : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -- ; if ( descriptor . length == <NUM_LIT:1> ) { switch ( descriptor [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else if ( descriptor [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , descriptor ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( descriptor , <NUM_LIT:1> , descriptor . length - <NUM_LIT:1> ) ) ) ; } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_putfield : frame . numberOfStackItems -= <NUM_LIT:2> ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokevirtual : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; char [ ] name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= ( getParametersCount ( descriptor ) + <NUM_LIT:1> ) ; char [ ] returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokespecial : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= getParametersCount ( descriptor ) ; if ( CharOperation . equals ( ConstantPool . Init , name ) ) { frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] . tag = VerificationTypeInfo . ITEM_OBJECT ; } frame . numberOfStackItems -- ; returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokestatic : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= getParametersCount ( descriptor ) ; returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_invokeinterface : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; nameAndTypeIndex = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ index ] ) ; utf8index = u2At ( poolContents , <NUM_LIT:3> , constantPoolOffsets [ nameAndTypeIndex ] ) ; descriptor = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ nameAndTypeIndex ] ) ; name = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . numberOfStackItems -= ( getParametersCount ( descriptor ) + <NUM_LIT:1> ) ; returnType = getReturnType ( descriptor ) ; if ( returnType . length == <NUM_LIT:1> ) { switch ( returnType [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:Z>' : frame . addStackItem ( TypeBinding . BOOLEAN ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . BYTE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . CHAR ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . INT ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . LONG ) ; break ; case '<CHAR_LIT>' : frame . addStackItem ( TypeBinding . SHORT ) ; break ; } } else { if ( returnType [ <NUM_LIT:0> ] == '<CHAR_LIT:[>' ) { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , returnType ) ) ; } else { frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , CharOperation . subarray ( returnType , <NUM_LIT:1> , returnType . length - <NUM_LIT:1> ) ) ) ; } } pc += <NUM_LIT:5> ; break ; case Opcodes . OPC_new : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; char [ ] className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo ( <NUM_LIT:0> , VerificationTypeInfo . ITEM_UNINITIALIZED , className ) ; verificationTypeInfo . offset = currentPC ; frame . addStackItem ( verificationTypeInfo ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_newarray : char [ ] constantPoolName = null ; switch ( u1At ( bytecodes , <NUM_LIT:1> , pc ) ) { case ClassFileConstants . INT_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . BYTE_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . BOOLEAN_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT:Z>' } ; break ; case ClassFileConstants . SHORT_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . CHAR_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . LONG_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . FLOAT_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; case ClassFileConstants . DOUBLE_ARRAY : constantPoolName = new char [ ] { '<CHAR_LIT:[>' , '<CHAR_LIT>' } ; break ; } frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeIds . T_JavaLangObject , constantPoolName ) ; pc += <NUM_LIT:2> ; break ; case Opcodes . OPC_anewarray : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; int classNameLength = className . length ; if ( className [ <NUM_LIT:0> ] != '<CHAR_LIT:[>' ) { System . arraycopy ( className , <NUM_LIT:0> , ( constantPoolName = new char [ classNameLength + <NUM_LIT:3> ] ) , <NUM_LIT:2> , classNameLength ) ; constantPoolName [ <NUM_LIT:0> ] = '<CHAR_LIT:[>' ; constantPoolName [ <NUM_LIT:1> ] = '<CHAR_LIT>' ; constantPoolName [ classNameLength + <NUM_LIT:2> ] = '<CHAR_LIT:;>' ; } else { System . arraycopy ( className , <NUM_LIT:0> , ( constantPoolName = new char [ classNameLength + <NUM_LIT:1> ] ) , <NUM_LIT:1> , classNameLength ) ; constantPoolName [ <NUM_LIT:0> ] = '<CHAR_LIT:[>' ; } frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( <NUM_LIT:0> , constantPoolName ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_arraylength : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc ++ ; break ; case Opcodes . OPC_athrow : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_checkcast : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( <NUM_LIT:0> , className ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_instanceof : frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] = new VerificationTypeInfo ( TypeBinding . INT ) ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_monitorenter : case Opcodes . OPC_monitorexit : frame . numberOfStackItems -- ; pc ++ ; break ; case Opcodes . OPC_wide : opcode = ( byte ) u1At ( bytecodes , <NUM_LIT:1> , pc ) ; if ( opcode == Opcodes . OPC_iinc ) { pc += <NUM_LIT:6> ; } else { index = u2At ( bytecodes , <NUM_LIT:2> , pc ) ; switch ( opcode ) { case Opcodes . OPC_iload : frame . addStackItem ( TypeBinding . INT ) ; break ; case Opcodes . OPC_fload : frame . addStackItem ( TypeBinding . FLOAT ) ; break ; case Opcodes . OPC_aload : localsN = frame . locals [ index ] ; if ( localsN == null ) { localsN = retrieveLocal ( currentPC , index ) ; } frame . addStackItem ( localsN ) ; break ; case Opcodes . OPC_lload : frame . addStackItem ( TypeBinding . LONG ) ; break ; case Opcodes . OPC_dload : frame . addStackItem ( TypeBinding . DOUBLE ) ; break ; case Opcodes . OPC_istore : frame . numberOfStackItems -- ; break ; case Opcodes . OPC_fstore : frame . numberOfStackItems -- ; break ; case Opcodes . OPC_astore : frame . locals [ index ] = frame . stackItems [ frame . numberOfStackItems - <NUM_LIT:1> ] ; frame . numberOfStackItems -- ; break ; case Opcodes . OPC_lstore : frame . numberOfStackItems -- ; break ; case Opcodes . OPC_dstore : frame . numberOfStackItems -- ; break ; } pc += <NUM_LIT:4> ; } break ; case Opcodes . OPC_multianewarray : index = u2At ( bytecodes , <NUM_LIT:1> , pc ) ; utf8index = u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ index ] ) ; className = utf8At ( poolContents , constantPoolOffsets [ utf8index ] + <NUM_LIT:3> , u2At ( poolContents , <NUM_LIT:1> , constantPoolOffsets [ utf8index ] ) ) ; int dimensions = u1At ( bytecodes , <NUM_LIT:3> , pc ) ; frame . numberOfStackItems -= dimensions ; classNameLength = className . length ; constantPoolName = new char [ classNameLength + dimensions ] ; for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { constantPoolName [ i ] = '<CHAR_LIT:[>' ; } System . arraycopy ( className , <NUM_LIT:0> , constantPoolName , dimensions , classNameLength ) ; frame . addStackItem ( new VerificationTypeInfo ( <NUM_LIT:0> , constantPoolName ) ) ; pc += <NUM_LIT:4> ; break ; case Opcodes . OPC_ifnull : case Opcodes . OPC_ifnonnull : frame . numberOfStackItems -- ; pc += <NUM_LIT:3> ; break ; case Opcodes . OPC_goto_w : pc += <NUM_LIT:5> ; break ; default : this . codeStream . methodDeclaration . scope . problemReporter ( ) . abortDueToInternalError ( Messages . bind ( Messages . abort_invalidOpcode , new Object [ ] { new Byte ( opcode ) , new Integer ( pc ) , new String ( methodBinding . shortReadableName ( ) ) , } ) , this . codeStream . methodDeclaration ) ; break ; } if ( pc >= ( codeLength + codeOffset ) ) { break ; } } } private final int u1At ( byte [ ] reference , int relativeOffset , int structOffset ) { return ( reference [ relativeOffset + structOffset ] & <NUM_LIT> ) ; } private final int u2At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ; } private final long u4At ( byte [ ] reference , int relativeOffset , int structOffset ) { int position = relativeOffset + structOffset ; return ( ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:24> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:16> ) + ( ( reference [ position ++ ] & <NUM_LIT> ) << <NUM_LIT:8> ) + ( reference [ position ] & <NUM_LIT> ) ) ; } public char [ ] utf8At ( byte [ ] reference , int absoluteOffset , int bytesAvailable ) { int length = bytesAvailable ; char outputBuf [ ] = new char [ bytesAvailable ] ; int outputPos = <NUM_LIT:0> ; int readOffset = absoluteOffset ; while ( length != <NUM_LIT:0> ) { int x = reference [ readOffset ++ ] & <NUM_LIT> ; length -- ; if ( ( <NUM_LIT> & x ) != <NUM_LIT:0> ) { if ( ( x & <NUM_LIT> ) != <NUM_LIT:0> ) { length -= <NUM_LIT:2> ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:12> ) | ( ( reference [ readOffset ++ ] & <NUM_LIT> ) << <NUM_LIT:6> ) | ( reference [ readOffset ++ ] & <NUM_LIT> ) ; } else { length -- ; x = ( ( x & <NUM_LIT> ) << <NUM_LIT:6> ) | ( reference [ readOffset ++ ] & <NUM_LIT> ) ; } } outputBuf [ outputPos ++ ] = ( char ) x ; } if ( outputPos != bytesAvailable ) { System . arraycopy ( outputBuf , <NUM_LIT:0> , ( outputBuf = new char [ outputPos ] ) , <NUM_LIT:0> , outputPos ) ; } return outputBuf ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . lang . reflect . InvocationTargetException ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; public class ReadManager implements Runnable { ICompilationUnit [ ] units ; int nextFileToRead ; ICompilationUnit [ ] filesRead ; char [ ] [ ] contentsRead ; int readyToReadPosition ; int nextAvailablePosition ; Thread [ ] readingThreads ; char [ ] readInProcessMarker = new char [ <NUM_LIT:0> ] ; int sleepingThreadCount ; private Throwable caughtException ; static final int START_CUSHION = <NUM_LIT:5> ; public static final int THRESHOLD = <NUM_LIT:10> ; static final int CACHE_SIZE = <NUM_LIT:15> ; public ReadManager ( ICompilationUnit [ ] files , int length ) { int threadCount = <NUM_LIT:0> ; try { Class runtime = Class . forName ( "<STR_LIT>" ) ; java . lang . reflect . Method m = runtime . getDeclaredMethod ( "<STR_LIT>" , new Class [ <NUM_LIT:0> ] ) ; if ( m != null ) { Integer result = ( Integer ) m . invoke ( Runtime . getRuntime ( ) , null ) ; threadCount = result . intValue ( ) + <NUM_LIT:1> ; if ( threadCount < <NUM_LIT:2> ) threadCount = <NUM_LIT:0> ; else if ( threadCount > CACHE_SIZE ) threadCount = CACHE_SIZE ; } } catch ( IllegalAccessException ignored ) { } catch ( ClassNotFoundException e ) { } catch ( SecurityException e ) { } catch ( NoSuchMethodException e ) { } catch ( IllegalArgumentException e ) { } catch ( InvocationTargetException e ) { } if ( threadCount > <NUM_LIT:0> ) { synchronized ( this ) { this . units = new ICompilationUnit [ length ] ; System . arraycopy ( files , <NUM_LIT:0> , this . units , <NUM_LIT:0> , length ) ; this . nextFileToRead = START_CUSHION ; this . filesRead = new ICompilationUnit [ CACHE_SIZE ] ; this . contentsRead = new char [ CACHE_SIZE ] [ ] ; this . readyToReadPosition = <NUM_LIT:0> ; this . nextAvailablePosition = <NUM_LIT:0> ; this . sleepingThreadCount = <NUM_LIT:0> ; this . readingThreads = new Thread [ threadCount ] ; for ( int i = threadCount ; -- i >= <NUM_LIT:0> ; ) { this . readingThreads [ i ] = new Thread ( this , "<STR_LIT>" ) ; this . readingThreads [ i ] . setDaemon ( true ) ; this . readingThreads [ i ] . start ( ) ; } } } } public char [ ] getContents ( ICompilationUnit unit ) throws Error { if ( this . readingThreads == null || this . units . length == <NUM_LIT:0> ) { if ( this . caughtException != null ) { if ( this . caughtException instanceof Error ) throw ( Error ) this . caughtException ; throw ( RuntimeException ) this . caughtException ; } return unit . getContents ( ) ; } boolean yield = false ; char [ ] result = null ; synchronized ( this ) { if ( unit == this . filesRead [ this . readyToReadPosition ] ) { result = this . contentsRead [ this . readyToReadPosition ] ; while ( result == this . readInProcessMarker || result == null ) { this . contentsRead [ this . readyToReadPosition ] = null ; try { wait ( <NUM_LIT> ) ; } catch ( InterruptedException ignore ) { } if ( this . caughtException != null ) { if ( this . caughtException instanceof Error ) throw ( Error ) this . caughtException ; throw ( RuntimeException ) this . caughtException ; } result = this . contentsRead [ this . readyToReadPosition ] ; } this . filesRead [ this . readyToReadPosition ] = null ; this . contentsRead [ this . readyToReadPosition ] = null ; if ( ++ this . readyToReadPosition >= this . contentsRead . length ) this . readyToReadPosition = <NUM_LIT:0> ; if ( this . sleepingThreadCount > <NUM_LIT:0> ) { notify ( ) ; yield = this . sleepingThreadCount == this . readingThreads . length ; } } else { int unitIndex = <NUM_LIT:0> ; for ( int l = this . units . length ; unitIndex < l ; unitIndex ++ ) if ( this . units [ unitIndex ] == unit ) break ; if ( unitIndex == this . units . length ) { this . units = new ICompilationUnit [ <NUM_LIT:0> ] ; } else if ( unitIndex >= this . nextFileToRead ) { this . nextFileToRead = unitIndex + START_CUSHION ; this . readyToReadPosition = <NUM_LIT:0> ; this . nextAvailablePosition = <NUM_LIT:0> ; this . filesRead = new ICompilationUnit [ CACHE_SIZE ] ; this . contentsRead = new char [ CACHE_SIZE ] [ ] ; notifyAll ( ) ; } } } if ( yield ) Thread . yield ( ) ; if ( result != null ) return result ; return unit . getContents ( ) ; } public void run ( ) { try { while ( this . readingThreads != null && this . nextFileToRead < this . units . length ) { ICompilationUnit unit = null ; int position = - <NUM_LIT:1> ; synchronized ( this ) { if ( this . readingThreads == null ) return ; while ( this . filesRead [ this . nextAvailablePosition ] != null ) { this . sleepingThreadCount ++ ; try { wait ( <NUM_LIT> ) ; } catch ( InterruptedException e ) { } this . sleepingThreadCount -- ; if ( this . readingThreads == null ) return ; } if ( this . nextFileToRead >= this . units . length ) return ; unit = this . units [ this . nextFileToRead ++ ] ; position = this . nextAvailablePosition ; if ( ++ this . nextAvailablePosition >= this . contentsRead . length ) this . nextAvailablePosition = <NUM_LIT:0> ; this . filesRead [ position ] = unit ; this . contentsRead [ position ] = this . readInProcessMarker ; } char [ ] result = unit . getContents ( ) ; synchronized ( this ) { if ( this . filesRead [ position ] == unit ) { if ( this . contentsRead [ position ] == null ) notifyAll ( ) ; this . contentsRead [ position ] = result ; } } } } catch ( Error e ) { synchronized ( this ) { this . caughtException = e ; shutdown ( ) ; } return ; } catch ( RuntimeException e ) { synchronized ( this ) { this . caughtException = e ; shutdown ( ) ; } return ; } } public synchronized void shutdown ( ) { this . readingThreads = null ; notifyAll ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . env . ISourceType ; import org . eclipse . jdt . internal . compiler . lookup . PackageBinding ; public interface ITypeRequestor { void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) ; void accept ( ICompilationUnit unit , AccessRestriction accessRestriction ) ; void accept ( ISourceType [ ] sourceType , PackageBinding packageBinding , AccessRestriction accessRestriction ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class StringConstant extends Constant { private String value ; public static Constant fromValue ( String value ) { return new StringConstant ( value ) ; } private StringConstant ( String value ) { this . value = value ; } public String stringValue ( ) { return this . value ; } public String toString ( ) { return "<STR_LIT>" + this . value + "<STR_LIT:\">" ; } public int typeID ( ) { return T_JavaLangString ; } public int hashCode ( ) { final int prime = <NUM_LIT:31> ; int result = <NUM_LIT:1> ; result = prime * result + ( ( this . value == null ) ? <NUM_LIT:0> : this . value . hashCode ( ) ) ; return result ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } StringConstant other = ( StringConstant ) obj ; if ( this . value == null ) { return other . value == null ; } else { return this . value . equals ( other . value ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class IntConstant extends Constant { int value ; private static final IntConstant MIN_VALUE = new IntConstant ( Integer . MIN_VALUE ) ; private static final IntConstant MINUS_FOUR = new IntConstant ( - <NUM_LIT:4> ) ; private static final IntConstant MINUS_THREE = new IntConstant ( - <NUM_LIT:3> ) ; private static final IntConstant MINUS_TWO = new IntConstant ( - <NUM_LIT:2> ) ; private static final IntConstant MINUS_ONE = new IntConstant ( - <NUM_LIT:1> ) ; private static final IntConstant ZERO = new IntConstant ( <NUM_LIT:0> ) ; private static final IntConstant ONE = new IntConstant ( <NUM_LIT:1> ) ; private static final IntConstant TWO = new IntConstant ( <NUM_LIT:2> ) ; private static final IntConstant THREE = new IntConstant ( <NUM_LIT:3> ) ; private static final IntConstant FOUR = new IntConstant ( <NUM_LIT:4> ) ; private static final IntConstant FIVE = new IntConstant ( <NUM_LIT:5> ) ; private static final IntConstant SIX = new IntConstant ( <NUM_LIT:6> ) ; private static final IntConstant SEVEN = new IntConstant ( <NUM_LIT:7> ) ; private static final IntConstant EIGHT = new IntConstant ( <NUM_LIT:8> ) ; private static final IntConstant NINE = new IntConstant ( <NUM_LIT:9> ) ; private static final IntConstant TEN = new IntConstant ( <NUM_LIT:10> ) ; public static Constant fromValue ( int value ) { switch ( value ) { case Integer . MIN_VALUE : return IntConstant . MIN_VALUE ; case - <NUM_LIT:4> : return IntConstant . MINUS_FOUR ; case - <NUM_LIT:3> : return IntConstant . MINUS_THREE ; case - <NUM_LIT:2> : return IntConstant . MINUS_TWO ; case - <NUM_LIT:1> : return IntConstant . MINUS_ONE ; case <NUM_LIT:0> : return IntConstant . ZERO ; case <NUM_LIT:1> : return IntConstant . ONE ; case <NUM_LIT:2> : return IntConstant . TWO ; case <NUM_LIT:3> : return IntConstant . THREE ; case <NUM_LIT:4> : return IntConstant . FOUR ; case <NUM_LIT:5> : return IntConstant . FIVE ; case <NUM_LIT:6> : return IntConstant . SIX ; case <NUM_LIT:7> : return IntConstant . SEVEN ; case <NUM_LIT:8> : return IntConstant . EIGHT ; case <NUM_LIT:9> : return IntConstant . NINE ; case <NUM_LIT:10> : return IntConstant . TEN ; } return new IntConstant ( value ) ; } private IntConstant ( int value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_int ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } IntConstant other = ( IntConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class BooleanConstant extends Constant { private boolean value ; private static final BooleanConstant TRUE = new BooleanConstant ( true ) ; private static final BooleanConstant FALSE = new BooleanConstant ( false ) ; public static Constant fromValue ( boolean value ) { return value ? BooleanConstant . TRUE : BooleanConstant . FALSE ; } private BooleanConstant ( boolean value ) { this . value = value ; } public boolean booleanValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_boolean ; } public int hashCode ( ) { return this . value ? <NUM_LIT> : <NUM_LIT> ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } BooleanConstant other = ( BooleanConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; public class IrritantSet { public final static int GROUP_MASK = ASTNode . Bit32 | ASTNode . Bit31 | ASTNode . Bit30 ; public final static int GROUP_SHIFT = <NUM_LIT> ; public final static int GROUP_MAX = <NUM_LIT:3> ; public final static int GROUP0 = <NUM_LIT:0> << GROUP_SHIFT ; public final static int GROUP1 = <NUM_LIT:1> << GROUP_SHIFT ; public final static int GROUP2 = <NUM_LIT:2> << GROUP_SHIFT ; public static final IrritantSet ALL = new IrritantSet ( <NUM_LIT> & ~ GROUP_MASK ) ; public static final IrritantSet BOXING = new IrritantSet ( CompilerOptions . AutoBoxing ) ; public static final IrritantSet CAST = new IrritantSet ( CompilerOptions . UnnecessaryTypeCheck ) ; public static final IrritantSet DEPRECATION = new IrritantSet ( CompilerOptions . UsingDeprecatedAPI ) ; public static final IrritantSet DEP_ANN = new IrritantSet ( CompilerOptions . MissingDeprecatedAnnotation ) ; public static final IrritantSet FALLTHROUGH = new IrritantSet ( CompilerOptions . FallthroughCase ) ; public static final IrritantSet FINALLY = new IrritantSet ( CompilerOptions . FinallyBlockNotCompleting ) ; public static final IrritantSet HIDING = new IrritantSet ( CompilerOptions . MaskedCatchBlock ) ; public static final IrritantSet INCOMPLETE_SWITCH = new IrritantSet ( CompilerOptions . IncompleteEnumSwitch ) ; public static final IrritantSet NLS = new IrritantSet ( CompilerOptions . NonExternalizedString ) ; public static final IrritantSet NULL = new IrritantSet ( CompilerOptions . NullReference ) ; public static final IrritantSet RAW = new IrritantSet ( CompilerOptions . RawTypeReference ) ; public static final IrritantSet RESTRICTION = new IrritantSet ( CompilerOptions . ForbiddenReference ) ; public static final IrritantSet SERIAL = new IrritantSet ( CompilerOptions . MissingSerialVersion ) ; public static final IrritantSet STATIC_ACCESS = new IrritantSet ( CompilerOptions . IndirectStaticAccess ) ; public static final IrritantSet SYNTHETIC_ACCESS = new IrritantSet ( CompilerOptions . AccessEmulation ) ; public static final IrritantSet SUPER = new IrritantSet ( CompilerOptions . OverridingMethodWithoutSuperInvocation ) ; public static final IrritantSet UNUSED = new IrritantSet ( CompilerOptions . UnusedLocalVariable ) ; public static final IrritantSet UNCHECKED = new IrritantSet ( CompilerOptions . UncheckedTypeOperation ) ; public static final IrritantSet UNQUALIFIED_FIELD_ACCESS = new IrritantSet ( CompilerOptions . UnqualifiedFieldAccess ) ; public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet ( <NUM_LIT:0> ) ; public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet ( <NUM_LIT:0> ) ; static { COMPILER_DEFAULT_WARNINGS . set ( CompilerOptions . MethodWithConstructorName | CompilerOptions . OverriddenPackageDefaultMethod | CompilerOptions . UsingDeprecatedAPI | CompilerOptions . MaskedCatchBlock | CompilerOptions . UnusedLocalVariable | CompilerOptions . NoImplicitStringConversion | CompilerOptions . AssertUsedAsAnIdentifier | CompilerOptions . UnusedImport | CompilerOptions . NonStaticAccessToStatic | CompilerOptions . NoEffectAssignment | CompilerOptions . IncompatibleNonInheritedInterfaceMethod | CompilerOptions . UnusedPrivateMember | CompilerOptions . FinallyBlockNotCompleting ) . set ( CompilerOptions . UncheckedTypeOperation | CompilerOptions . FinalParameterBound | CompilerOptions . MissingSerialVersion | CompilerOptions . EnumUsedAsAnIdentifier | CompilerOptions . ForbiddenReference | CompilerOptions . VarargsArgumentNeedCast | CompilerOptions . NullReference | CompilerOptions . AnnotationSuperInterface | CompilerOptions . TypeHiding | CompilerOptions . DiscouragedReference | CompilerOptions . UnhandledWarningToken | CompilerOptions . RawTypeReference | CompilerOptions . UnusedLabel | CompilerOptions . UnusedTypeArguments | CompilerOptions . UnusedWarningToken | CompilerOptions . ComparingIdentical ) . set ( CompilerOptions . DeadCode | CompilerOptions . Tasks ) ; ALL . setAll ( ) ; HIDING . set ( CompilerOptions . FieldHiding ) . set ( CompilerOptions . LocalVariableHiding ) . set ( CompilerOptions . TypeHiding ) ; NULL . set ( CompilerOptions . PotentialNullReference ) . set ( CompilerOptions . RedundantNullCheck ) ; RESTRICTION . set ( CompilerOptions . DiscouragedReference ) ; STATIC_ACCESS . set ( CompilerOptions . NonStaticAccessToStatic ) ; UNUSED . set ( CompilerOptions . UnusedArgument ) . set ( CompilerOptions . UnusedPrivateMember ) . set ( CompilerOptions . UnusedDeclaredThrownException ) . set ( CompilerOptions . UnusedLabel ) . set ( CompilerOptions . UnusedImport ) . set ( CompilerOptions . UnusedTypeArguments ) . set ( CompilerOptions . RedundantSuperinterface ) . set ( CompilerOptions . DeadCode ) . set ( CompilerOptions . UnusedObjectAllocation ) ; String suppressRawWhenUnchecked = System . getProperty ( "<STR_LIT>" ) ; if ( suppressRawWhenUnchecked != null && "<STR_LIT:true>" . equalsIgnoreCase ( suppressRawWhenUnchecked ) ) { UNCHECKED . set ( CompilerOptions . RawTypeReference ) ; } } private int [ ] bits = new int [ GROUP_MAX ] ; public IrritantSet ( int singleGroupIrritants ) { initialize ( singleGroupIrritants ) ; } public IrritantSet ( IrritantSet other ) { initialize ( other ) ; } public boolean areAllSet ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( this . bits [ i ] != ( <NUM_LIT> & ~ GROUP_MASK ) ) return false ; } return true ; } public IrritantSet clear ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] &= ~ singleGroupIrritants ; return this ; } public IrritantSet clearAll ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { this . bits [ i ] = <NUM_LIT:0> ; } return this ; } public void initialize ( int singleGroupIrritants ) { if ( singleGroupIrritants == <NUM_LIT:0> ) return ; int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] = singleGroupIrritants & ~ GROUP_MASK ; } public void initialize ( IrritantSet other ) { if ( other == null ) return ; System . arraycopy ( other . bits , <NUM_LIT:0> , this . bits = new int [ GROUP_MAX ] , <NUM_LIT:0> , GROUP_MAX ) ; } public boolean isAnySet ( IrritantSet other ) { if ( other == null ) return false ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( ( this . bits [ i ] & other . bits [ i ] ) != <NUM_LIT:0> ) return true ; } return false ; } public boolean hasSameIrritants ( IrritantSet irritantSet ) { if ( irritantSet == null ) return false ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { if ( this . bits [ i ] != irritantSet . bits [ i ] ) return false ; } return true ; } public boolean isSet ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; return ( this . bits [ group ] & singleGroupIrritants ) != <NUM_LIT:0> ; } public IrritantSet set ( int singleGroupIrritants ) { int group = ( singleGroupIrritants & GROUP_MASK ) > > GROUP_SHIFT ; this . bits [ group ] |= ( singleGroupIrritants & ~ GROUP_MASK ) ; return this ; } public IrritantSet set ( IrritantSet other ) { if ( other == null ) return this ; boolean wasNoOp = true ; for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { int otherIrritant = other . bits [ i ] & ~ GROUP_MASK ; if ( ( this . bits [ i ] & otherIrritant ) != otherIrritant ) { wasNoOp = false ; this . bits [ i ] |= otherIrritant ; } } return wasNoOp ? null : this ; } public IrritantSet setAll ( ) { for ( int i = <NUM_LIT:0> ; i < GROUP_MAX ; i ++ ) { this . bits [ i ] |= <NUM_LIT> & ~ GROUP_MASK ; } return this ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class LongConstant extends Constant { private static final LongConstant ZERO = new LongConstant ( <NUM_LIT> ) ; private static final LongConstant MIN_VALUE = new LongConstant ( Long . MIN_VALUE ) ; private long value ; public static Constant fromValue ( long value ) { if ( value == <NUM_LIT> ) { return ZERO ; } else if ( value == Long . MIN_VALUE ) { return MIN_VALUE ; } return new LongConstant ( value ) ; } private LongConstant ( long value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_long ; } public int hashCode ( ) { return ( int ) ( this . value ^ ( this . value > > > <NUM_LIT:32> ) ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } LongConstant other = ( LongConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class DoubleConstant extends Constant { private double value ; public static Constant fromValue ( double value ) { return new DoubleConstant ( value ) ; } private DoubleConstant ( double value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return ( float ) this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return ( long ) this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { if ( this == NotAConstant ) return "<STR_LIT>" ; return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_double ; } public int hashCode ( ) { long temp = Double . doubleToLongBits ( this . value ) ; return ( int ) ( temp ^ ( temp > > > <NUM_LIT:32> ) ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } DoubleConstant other = ( DoubleConstant ) obj ; return Double . doubleToLongBits ( this . value ) == Double . doubleToLongBits ( other . value ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class CompilerStats implements Comparable { public long startTime ; public long endTime ; public long lineCount ; public long parseTime ; public long resolveTime ; public long analyzeTime ; public long generateTime ; public long elapsedTime ( ) { return this . endTime - this . startTime ; } public int compareTo ( Object o ) { CompilerStats otherStats = ( CompilerStats ) o ; long time1 = elapsedTime ( ) ; long time2 = otherStats . elapsedTime ( ) ; return time1 < time2 ? - <NUM_LIT:1> : ( time1 == time2 ? <NUM_LIT:0> : <NUM_LIT:1> ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class FloatConstant extends Constant { float value ; public static Constant fromValue ( float value ) { return new FloatConstant ( value ) ; } private FloatConstant ( float value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return ( int ) this . value ; } public long longValue ( ) { return ( long ) this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_float ; } public int hashCode ( ) { return Float . floatToIntBits ( this . value ) ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } FloatConstant other = ( FloatConstant ) obj ; return Float . floatToIntBits ( this . value ) == Float . floatToIntBits ( other . value ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class ShortConstant extends Constant { private short value ; public static Constant fromValue ( short value ) { return new ShortConstant ( value ) ; } private ShortConstant ( short value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_short ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ShortConstant other = ( ShortConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . problem . ShouldNotImplement ; import org . eclipse . jdt . internal . compiler . util . Messages ; public abstract class Constant implements TypeIds , OperatorIds { public static final Constant NotAConstant = DoubleConstant . fromValue ( Double . NaN ) ; public boolean booleanValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:boolean>" } ) ) ; } public byte byteValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public final Constant castTo ( int conversionToTargetType ) { if ( this == NotAConstant ) return NotAConstant ; switch ( conversionToTargetType ) { case T_undefined : return this ; case ( T_byte << <NUM_LIT:4> ) + T_byte : return this ; case ( T_byte << <NUM_LIT:4> ) + T_long : return ByteConstant . fromValue ( ( byte ) longValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_short : return ByteConstant . fromValue ( ( byte ) shortValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_double : return ByteConstant . fromValue ( ( byte ) doubleValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_float : return ByteConstant . fromValue ( ( byte ) floatValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_char : return ByteConstant . fromValue ( ( byte ) charValue ( ) ) ; case ( T_byte << <NUM_LIT:4> ) + T_int : return ByteConstant . fromValue ( ( byte ) intValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_byte : return LongConstant . fromValue ( byteValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_long : return this ; case ( T_long << <NUM_LIT:4> ) + T_short : return LongConstant . fromValue ( shortValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_double : return LongConstant . fromValue ( ( long ) doubleValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_float : return LongConstant . fromValue ( ( long ) floatValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_char : return LongConstant . fromValue ( charValue ( ) ) ; case ( T_long << <NUM_LIT:4> ) + T_int : return LongConstant . fromValue ( intValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_byte : return ShortConstant . fromValue ( byteValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_long : return ShortConstant . fromValue ( ( short ) longValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_short : return this ; case ( T_short << <NUM_LIT:4> ) + T_double : return ShortConstant . fromValue ( ( short ) doubleValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_float : return ShortConstant . fromValue ( ( short ) floatValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_char : return ShortConstant . fromValue ( ( short ) charValue ( ) ) ; case ( T_short << <NUM_LIT:4> ) + T_int : return ShortConstant . fromValue ( ( short ) intValue ( ) ) ; case ( T_JavaLangString << <NUM_LIT:4> ) + T_JavaLangString : return this ; case ( T_double << <NUM_LIT:4> ) + T_byte : return DoubleConstant . fromValue ( byteValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_long : return DoubleConstant . fromValue ( longValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_short : return DoubleConstant . fromValue ( shortValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_double : return this ; case ( T_double << <NUM_LIT:4> ) + T_float : return DoubleConstant . fromValue ( floatValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_char : return DoubleConstant . fromValue ( charValue ( ) ) ; case ( T_double << <NUM_LIT:4> ) + T_int : return DoubleConstant . fromValue ( intValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_byte : return FloatConstant . fromValue ( byteValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_long : return FloatConstant . fromValue ( longValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_short : return FloatConstant . fromValue ( shortValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_double : return FloatConstant . fromValue ( ( float ) doubleValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_float : return this ; case ( T_float << <NUM_LIT:4> ) + T_char : return FloatConstant . fromValue ( charValue ( ) ) ; case ( T_float << <NUM_LIT:4> ) + T_int : return FloatConstant . fromValue ( intValue ( ) ) ; case ( T_boolean << <NUM_LIT:4> ) + T_boolean : return this ; case ( T_char << <NUM_LIT:4> ) + T_byte : return CharConstant . fromValue ( ( char ) byteValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_long : return CharConstant . fromValue ( ( char ) longValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_short : return CharConstant . fromValue ( ( char ) shortValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_double : return CharConstant . fromValue ( ( char ) doubleValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_float : return CharConstant . fromValue ( ( char ) floatValue ( ) ) ; case ( T_char << <NUM_LIT:4> ) + T_char : return this ; case ( T_char << <NUM_LIT:4> ) + T_int : return CharConstant . fromValue ( ( char ) intValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_byte : return IntConstant . fromValue ( byteValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_long : return IntConstant . fromValue ( ( int ) longValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_short : return IntConstant . fromValue ( shortValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_double : return IntConstant . fromValue ( ( int ) doubleValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_float : return IntConstant . fromValue ( ( int ) floatValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_char : return IntConstant . fromValue ( charValue ( ) ) ; case ( T_int << <NUM_LIT:4> ) + T_int : return this ; } return NotAConstant ; } public char charValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public static final Constant computeConstantOperation ( Constant cst , int id , int operator ) { switch ( operator ) { case NOT : return BooleanConstant . fromValue ( ! cst . booleanValue ( ) ) ; case PLUS : return computeConstantOperationPLUS ( IntConstant . fromValue ( <NUM_LIT:0> ) , T_int , cst , id ) ; case MINUS : switch ( id ) { case T_float : float f ; if ( ( f = cst . floatValue ( ) ) == <NUM_LIT:0.0f> ) { if ( Float . floatToIntBits ( f ) == <NUM_LIT:0> ) return FloatConstant . fromValue ( - <NUM_LIT:0.0f> ) ; else return FloatConstant . fromValue ( <NUM_LIT:0.0f> ) ; } break ; case T_double : double d ; if ( ( d = cst . doubleValue ( ) ) == <NUM_LIT> ) { if ( Double . doubleToLongBits ( d ) == <NUM_LIT:0> ) return DoubleConstant . fromValue ( - <NUM_LIT> ) ; else return DoubleConstant . fromValue ( <NUM_LIT> ) ; } break ; } return computeConstantOperationMINUS ( IntConstant . fromValue ( <NUM_LIT:0> ) , T_int , cst , id ) ; case TWIDDLE : switch ( id ) { case T_char : return IntConstant . fromValue ( ~ cst . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( ~ cst . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( ~ cst . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( ~ cst . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( ~ cst . longValue ( ) ) ; default : return NotAConstant ; } default : return NotAConstant ; } } public static final Constant computeConstantOperation ( Constant left , int leftId , int operator , Constant right , int rightId ) { switch ( operator ) { case AND : return computeConstantOperationAND ( left , leftId , right , rightId ) ; case AND_AND : return computeConstantOperationAND_AND ( left , leftId , right , rightId ) ; case DIVIDE : return computeConstantOperationDIVIDE ( left , leftId , right , rightId ) ; case GREATER : return computeConstantOperationGREATER ( left , leftId , right , rightId ) ; case GREATER_EQUAL : return computeConstantOperationGREATER_EQUAL ( left , leftId , right , rightId ) ; case LEFT_SHIFT : return computeConstantOperationLEFT_SHIFT ( left , leftId , right , rightId ) ; case LESS : return computeConstantOperationLESS ( left , leftId , right , rightId ) ; case LESS_EQUAL : return computeConstantOperationLESS_EQUAL ( left , leftId , right , rightId ) ; case MINUS : return computeConstantOperationMINUS ( left , leftId , right , rightId ) ; case MULTIPLY : return computeConstantOperationMULTIPLY ( left , leftId , right , rightId ) ; case OR : return computeConstantOperationOR ( left , leftId , right , rightId ) ; case OR_OR : return computeConstantOperationOR_OR ( left , leftId , right , rightId ) ; case PLUS : return computeConstantOperationPLUS ( left , leftId , right , rightId ) ; case REMAINDER : return computeConstantOperationREMAINDER ( left , leftId , right , rightId ) ; case RIGHT_SHIFT : return computeConstantOperationRIGHT_SHIFT ( left , leftId , right , rightId ) ; case UNSIGNED_RIGHT_SHIFT : return computeConstantOperationUNSIGNED_RIGHT_SHIFT ( left , leftId , right , rightId ) ; case XOR : return computeConstantOperationXOR ( left , leftId , right , rightId ) ; default : return NotAConstant ; } } public static final Constant computeConstantOperationAND ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) & right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) & right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) & right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) & right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) & right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) & right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) & right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) & right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) & right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) & right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) & right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) & right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) & right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationAND_AND ( Constant left , int leftId , Constant right , int rightId ) { return BooleanConstant . fromValue ( left . booleanValue ( ) && right . booleanValue ( ) ) ; } public static final Constant computeConstantOperationDIVIDE ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) / right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) / right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) / right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) / right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) / right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) / right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) / right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) / right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) / right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) / right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) / right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) / right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) / right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) / right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) / right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) / right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) / right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) / right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) / right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) / right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationEQUAL_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : if ( rightId == T_boolean ) { return BooleanConstant . fromValue ( left . booleanValue ( ) == right . booleanValue ( ) ) ; } break ; case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) == right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) == right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) == right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) == right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) == right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) == right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) == right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) == right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) == right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) == right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) == right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) == right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) == right . longValue ( ) ) ; } break ; case T_JavaLangString : if ( rightId == T_JavaLangString ) { return BooleanConstant . fromValue ( ( ( StringConstant ) left ) . hasSameValue ( right ) ) ; } break ; case T_null : if ( rightId == T_JavaLangString ) { return BooleanConstant . fromValue ( false ) ; } else { if ( rightId == T_null ) { return BooleanConstant . fromValue ( true ) ; } } } return BooleanConstant . fromValue ( false ) ; } public static final Constant computeConstantOperationGREATER ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) > right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) > right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) > right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) > right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) > right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) > right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) > right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) > right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationGREATER_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) >= right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) >= right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) >= right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) >= right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) >= right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) >= right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) >= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) >= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) >= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) >= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) >= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) >= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) >= right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLEFT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) << right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) << right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) << right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) << right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) << right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) << right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) << right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) << right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) << right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) << right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) << right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) << right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) << right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLESS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) < right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) < right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) < right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) < right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) < right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) < right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) < right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) < right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) < right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) < right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) < right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) < right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) < right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationLESS_EQUAL ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . charValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . charValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . charValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . charValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . charValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . charValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . charValue ( ) <= right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . floatValue ( ) <= right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . doubleValue ( ) <= right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . byteValue ( ) <= right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . shortValue ( ) <= right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . intValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . intValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . intValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . intValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . intValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . intValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . intValue ( ) <= right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return BooleanConstant . fromValue ( left . longValue ( ) <= right . charValue ( ) ) ; case T_float : return BooleanConstant . fromValue ( left . longValue ( ) <= right . floatValue ( ) ) ; case T_double : return BooleanConstant . fromValue ( left . longValue ( ) <= right . doubleValue ( ) ) ; case T_byte : return BooleanConstant . fromValue ( left . longValue ( ) <= right . byteValue ( ) ) ; case T_short : return BooleanConstant . fromValue ( left . longValue ( ) <= right . shortValue ( ) ) ; case T_int : return BooleanConstant . fromValue ( left . longValue ( ) <= right . intValue ( ) ) ; case T_long : return BooleanConstant . fromValue ( left . longValue ( ) <= right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationMINUS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) - right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) - right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) - right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) - right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) - right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) - right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) - right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) - right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) - right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) - right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) - right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) - right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) - right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) - right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) - right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) - right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) - right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) - right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) - right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) - right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationMULTIPLY ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) * right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) * right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) * right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) * right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) * right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) * right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) * right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) * right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) * right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) * right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) * right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) * right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) * right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) * right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) * right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) * right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) * right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) * right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) * right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) * right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationOR ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) | right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) | right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) | right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) | right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) | right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) | right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) | right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) | right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) | right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) | right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) | right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) | right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) | right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationOR_OR ( Constant left , int leftId , Constant right , int rightId ) { return BooleanConstant . fromValue ( left . booleanValue ( ) || right . booleanValue ( ) ) ; } public static final Constant computeConstantOperationPLUS ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_JavaLangObject : if ( rightId == T_JavaLangString ) { return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_boolean : if ( rightId == T_JavaLangString ) { return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) + right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) + right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) + right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) + right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) + right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) + right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) + right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) + right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) + right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) + right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) + right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) + right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) + right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) + right . longValue ( ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; } break ; case T_JavaLangString : switch ( rightId ) { case T_char : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . charValue ( ) ) ) ; case T_float : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . floatValue ( ) ) ) ; case T_double : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . doubleValue ( ) ) ) ; case T_byte : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . byteValue ( ) ) ) ; case T_short : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . shortValue ( ) ) ) ; case T_int : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . intValue ( ) ) ) ; case T_long : return StringConstant . fromValue ( left . stringValue ( ) + String . valueOf ( right . longValue ( ) ) ) ; case T_JavaLangString : return StringConstant . fromValue ( left . stringValue ( ) + right . stringValue ( ) ) ; case T_boolean : return StringConstant . fromValue ( left . stringValue ( ) + right . booleanValue ( ) ) ; } break ; } return NotAConstant ; } public static final Constant computeConstantOperationREMAINDER ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . charValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . charValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) % right . longValue ( ) ) ; } break ; case T_float : switch ( rightId ) { case T_char : return FloatConstant . fromValue ( left . floatValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . floatValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . floatValue ( ) % right . doubleValue ( ) ) ; case T_byte : return FloatConstant . fromValue ( left . floatValue ( ) % right . byteValue ( ) ) ; case T_short : return FloatConstant . fromValue ( left . floatValue ( ) % right . shortValue ( ) ) ; case T_int : return FloatConstant . fromValue ( left . floatValue ( ) % right . intValue ( ) ) ; case T_long : return FloatConstant . fromValue ( left . floatValue ( ) % right . longValue ( ) ) ; } break ; case T_double : switch ( rightId ) { case T_char : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . charValue ( ) ) ; case T_float : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . doubleValue ( ) ) ; case T_byte : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . byteValue ( ) ) ; case T_short : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . shortValue ( ) ) ; case T_int : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . intValue ( ) ) ; case T_long : return DoubleConstant . fromValue ( left . doubleValue ( ) % right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . byteValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . byteValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) % right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . shortValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . shortValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) % right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . intValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . intValue ( ) % right . doubleValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) % right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) % right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) % right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) % right . charValue ( ) ) ; case T_float : return FloatConstant . fromValue ( left . longValue ( ) % right . floatValue ( ) ) ; case T_double : return DoubleConstant . fromValue ( left . longValue ( ) % right . doubleValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) % right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) % right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) % right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) % right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationRIGHT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) > > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) > > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) > > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) > > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) > > right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) > > right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) > > right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) > > right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) > > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationUNSIGNED_RIGHT_SHIFT ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . charValue ( ) > > > right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . byteValue ( ) > > > right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . shortValue ( ) > > > right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) > > > right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) > > > right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) > > > right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) > > > right . intValue ( ) ) ; case T_long : return IntConstant . fromValue ( left . intValue ( ) > > > right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) > > > right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) > > > right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) > > > right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) > > > right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) > > > right . longValue ( ) ) ; } } return NotAConstant ; } public static final Constant computeConstantOperationXOR ( Constant left , int leftId , Constant right , int rightId ) { switch ( leftId ) { case T_boolean : return BooleanConstant . fromValue ( left . booleanValue ( ) ^ right . booleanValue ( ) ) ; case T_char : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . charValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . charValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . charValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . charValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . charValue ( ) ^ right . longValue ( ) ) ; } break ; case T_byte : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . byteValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . byteValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . byteValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . byteValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . byteValue ( ) ^ right . longValue ( ) ) ; } break ; case T_short : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . shortValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . shortValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . shortValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . shortValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . shortValue ( ) ^ right . longValue ( ) ) ; } break ; case T_int : switch ( rightId ) { case T_char : return IntConstant . fromValue ( left . intValue ( ) ^ right . charValue ( ) ) ; case T_byte : return IntConstant . fromValue ( left . intValue ( ) ^ right . byteValue ( ) ) ; case T_short : return IntConstant . fromValue ( left . intValue ( ) ^ right . shortValue ( ) ) ; case T_int : return IntConstant . fromValue ( left . intValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . intValue ( ) ^ right . longValue ( ) ) ; } break ; case T_long : switch ( rightId ) { case T_char : return LongConstant . fromValue ( left . longValue ( ) ^ right . charValue ( ) ) ; case T_byte : return LongConstant . fromValue ( left . longValue ( ) ^ right . byteValue ( ) ) ; case T_short : return LongConstant . fromValue ( left . longValue ( ) ^ right . shortValue ( ) ) ; case T_int : return LongConstant . fromValue ( left . longValue ( ) ^ right . intValue ( ) ) ; case T_long : return LongConstant . fromValue ( left . longValue ( ) ^ right . longValue ( ) ) ; } } return NotAConstant ; } public double doubleValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:double>" } ) ) ; } public float floatValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:float>" } ) ) ; } public boolean hasSameValue ( Constant otherConstant ) { if ( this == otherConstant ) return true ; int typeID ; if ( ( typeID = typeID ( ) ) != otherConstant . typeID ( ) ) return false ; switch ( typeID ) { case TypeIds . T_boolean : return booleanValue ( ) == otherConstant . booleanValue ( ) ; case TypeIds . T_byte : return byteValue ( ) == otherConstant . byteValue ( ) ; case TypeIds . T_char : return charValue ( ) == otherConstant . charValue ( ) ; case TypeIds . T_double : return doubleValue ( ) == otherConstant . doubleValue ( ) ; case TypeIds . T_float : return floatValue ( ) == otherConstant . floatValue ( ) ; case TypeIds . T_int : return intValue ( ) == otherConstant . intValue ( ) ; case TypeIds . T_short : return shortValue ( ) == otherConstant . shortValue ( ) ; case TypeIds . T_long : return longValue ( ) == otherConstant . longValue ( ) ; case TypeIds . T_JavaLangString : String value = stringValue ( ) ; return value == null ? otherConstant . stringValue ( ) == null : value . equals ( otherConstant . stringValue ( ) ) ; } return false ; } public int intValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:int>" } ) ) ; } public long longValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotCastedInto , new String [ ] { typeName ( ) , "<STR_LIT:long>" } ) ) ; } public short shortValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotConvertedTo , new String [ ] { typeName ( ) , "<STR_LIT>" } ) ) ; } public String stringValue ( ) { throw new ShouldNotImplement ( Messages . bind ( Messages . constant_cannotConvertedTo , new String [ ] { typeName ( ) , "<STR_LIT:String>" } ) ) ; } public String toString ( ) { if ( this == NotAConstant ) return "<STR_LIT>" ; return super . toString ( ) ; } public abstract int typeID ( ) ; public String typeName ( ) { switch ( typeID ( ) ) { case T_int : return "<STR_LIT:int>" ; case T_byte : return "<STR_LIT>" ; case T_short : return "<STR_LIT>" ; case T_char : return "<STR_LIT>" ; case T_float : return "<STR_LIT:float>" ; case T_double : return "<STR_LIT:double>" ; case T_boolean : return "<STR_LIT:boolean>" ; case T_long : return "<STR_LIT:long>" ; case T_JavaLangString : return "<STR_LIT>" ; case T_null : return "<STR_LIT:null>" ; default : return "<STR_LIT:unknown>" ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class ByteConstant extends Constant { private byte value ; public static Constant fromValue ( byte value ) { return new ByteConstant ( value ) ; } private ByteConstant ( byte value ) { this . value = value ; } public byte byteValue ( ) { return this . value ; } public char charValue ( ) { return ( char ) this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_byte ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } ByteConstant other = ( ByteConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import org . eclipse . jdt . core . compiler . CategorizedProblem ; import org . eclipse . jdt . internal . compiler . CompilationResult ; public interface ReferenceContext { void abort ( int abortLevel , CategorizedProblem problem ) ; CompilationResult compilationResult ( ) ; boolean hasErrors ( ) ; void tagAsHavingErrors ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; public class CharConstant extends Constant { private char value ; public static Constant fromValue ( char value ) { return new CharConstant ( value ) ; } private CharConstant ( char value ) { this . value = value ; } public byte byteValue ( ) { return ( byte ) this . value ; } public char charValue ( ) { return this . value ; } public double doubleValue ( ) { return this . value ; } public float floatValue ( ) { return this . value ; } public int intValue ( ) { return this . value ; } public long longValue ( ) { return this . value ; } public short shortValue ( ) { return ( short ) this . value ; } public String stringValue ( ) { return String . valueOf ( this . value ) ; } public String toString ( ) { return "<STR_LIT>" + this . value ; } public int typeID ( ) { return T_char ; } public int hashCode ( ) { return this . value ; } public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } CharConstant other = ( CharConstant ) obj ; return this . value == other . value ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . impl ; import java . io . ByteArrayInputStream ; import java . io . InputStreamReader ; import java . io . UnsupportedEncodingException ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . Compiler ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilerOptions { public static final String OPTION_LocalVariableAttribute = "<STR_LIT>" ; public static final String OPTION_LineNumberAttribute = "<STR_LIT>" ; public static final String OPTION_SourceFileAttribute = "<STR_LIT>" ; public static final String OPTION_PreserveUnusedLocal = "<STR_LIT>" ; public static final String OPTION_DocCommentSupport = "<STR_LIT>" ; public static final String OPTION_ReportMethodWithConstructorName = "<STR_LIT>" ; public static final String OPTION_ReportOverridingPackageDefaultMethod = "<STR_LIT>" ; public static final String OPTION_ReportDeprecation = "<STR_LIT>" ; public static final String OPTION_ReportDeprecationInDeprecatedCode = "<STR_LIT>" ; public static final String OPTION_ReportDeprecationWhenOverridingDeprecatedMethod = "<STR_LIT>" ; public static final String OPTION_ReportHiddenCatchBlock = "<STR_LIT>" ; public static final String OPTION_ReportUnusedLocal = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameter = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "<STR_LIT>" ; public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "<STR_LIT>" ; public static final String OPTION_ReportUnusedImport = "<STR_LIT>" ; public static final String OPTION_ReportSyntheticAccessEmulation = "<STR_LIT>" ; public static final String OPTION_ReportNoEffectAssignment = "<STR_LIT>" ; public static final String OPTION_ReportLocalVariableHiding = "<STR_LIT>" ; public static final String OPTION_ReportSpecialParameterHidingField = "<STR_LIT>" ; public static final String OPTION_ReportFieldHiding = "<STR_LIT>" ; public static final String OPTION_ReportTypeParameterHiding = "<STR_LIT>" ; public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "<STR_LIT>" ; public static final String OPTION_ReportNonExternalizedStringLiteral = "<STR_LIT>" ; public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "<STR_LIT>" ; public static final String OPTION_ReportUnusedPrivateMember = "<STR_LIT>" ; public static final String OPTION_ReportNoImplicitStringConversion = "<STR_LIT>" ; public static final String OPTION_ReportAssertIdentifier = "<STR_LIT>" ; public static final String OPTION_ReportEnumIdentifier = "<STR_LIT>" ; public static final String OPTION_ReportNonStaticAccessToStatic = "<STR_LIT>" ; public static final String OPTION_ReportIndirectStaticAccess = "<STR_LIT>" ; public static final String OPTION_ReportEmptyStatement = "<STR_LIT>" ; public static final String OPTION_ReportUnnecessaryTypeCheck = "<STR_LIT>" ; public static final String OPTION_ReportUnnecessaryElse = "<STR_LIT>" ; public static final String OPTION_ReportUndocumentedEmptyBlock = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadoc = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTags = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsDeprecatedRef = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsNotVisibleRef = "<STR_LIT>" ; public static final String OPTION_ReportInvalidJavadocTagsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTags = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagsOverriding = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocComments = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocTagDescription = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocCommentsVisibility = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadocCommentsOverriding = "<STR_LIT>" ; public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownException = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference = "<STR_LIT>" ; public static final String OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = "<STR_LIT>" ; public static final String OPTION_ReportUnqualifiedFieldAccess = "<STR_LIT>" ; public static final String OPTION_ReportUncheckedTypeOperation = "<STR_LIT>" ; public static final String OPTION_ReportRawTypeReference = "<STR_LIT>" ; public static final String OPTION_ReportFinalParameterBound = "<STR_LIT>" ; public static final String OPTION_ReportMissingSerialVersion = "<STR_LIT>" ; public static final String OPTION_ReportVarargsArgumentNeedCast = "<STR_LIT>" ; public static final String OPTION_ReportUnusedTypeArgumentsForMethodInvocation = "<STR_LIT>" ; public static final String OPTION_Source = "<STR_LIT>" ; public static final String OPTION_TargetPlatform = "<STR_LIT>" ; public static final String OPTION_Compliance = "<STR_LIT>" ; public static final String OPTION_Encoding = "<STR_LIT>" ; public static final String OPTION_MaxProblemPerUnit = "<STR_LIT>" ; public static final String OPTION_TaskTags = "<STR_LIT>" ; public static final String OPTION_TaskPriorities = "<STR_LIT>" ; public static final String OPTION_TaskCaseSensitive = "<STR_LIT>" ; public static final String OPTION_InlineJsr = "<STR_LIT>" ; public static final String OPTION_ReportNullReference = "<STR_LIT>" ; public static final String OPTION_ReportPotentialNullReference = "<STR_LIT>" ; public static final String OPTION_ReportRedundantNullCheck = "<STR_LIT>" ; public static final String OPTION_ReportAutoboxing = "<STR_LIT>" ; public static final String OPTION_ReportAnnotationSuperInterface = "<STR_LIT>" ; public static final String OPTION_ReportMissingOverrideAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation = "<STR_LIT>" ; public static final String OPTION_ReportMissingDeprecatedAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportIncompleteEnumSwitch = "<STR_LIT>" ; public static final String OPTION_ReportForbiddenReference = "<STR_LIT>" ; public static final String OPTION_ReportDiscouragedReference = "<STR_LIT>" ; public static final String OPTION_SuppressWarnings = "<STR_LIT>" ; public static final String OPTION_SuppressOptionalErrors = "<STR_LIT>" ; public static final String OPTION_ReportUnhandledWarningToken = "<STR_LIT>" ; public static final String OPTION_ReportUnusedWarningToken = "<STR_LIT>" ; public static final String OPTION_ReportUnusedLabel = "<STR_LIT>" ; public static final String OPTION_FatalOptionalError = "<STR_LIT>" ; public static final String OPTION_ReportParameterAssignment = "<STR_LIT>" ; public static final String OPTION_ReportFallthroughCase = "<STR_LIT>" ; public static final String OPTION_ReportOverridingMethodWithoutSuperInvocation = "<STR_LIT>" ; public static final String OPTION_GenerateClassFiles = "<STR_LIT>" ; public static final String OPTION_Process_Annotations = "<STR_LIT>" ; public static final String OPTION_ReportRedundantSuperinterface = "<STR_LIT>" ; public static final String OPTION_ReportComparingIdentical = "<STR_LIT>" ; public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "<STR_LIT>" ; public static final String OPTION_ReportMissingHashCodeMethod = "<STR_LIT>" ; public static final String OPTION_ReportDeadCode = "<STR_LIT>" ; public static final String OPTION_ReportDeadCodeInTrivialIfStatement = "<STR_LIT>" ; public static final String OPTION_ReportTasks = "<STR_LIT>" ; public static final String OPTION_ReportUnusedObjectAllocation = "<STR_LIT>" ; public static final String OPTIONG_BuildGroovyFiles = "<STR_LIT>" ; public static final String OPTIONG_GroovyFlags = "<STR_LIT>" ; public static final String OPTIONG_GroovyClassLoaderPath = "<STR_LIT>" ; public static final String OPTIONG_GroovyProjectName = "<STR_LIT>" ; public static final String OPTIONG_GroovyExtraImports = "<STR_LIT>" ; public static final String OPTIONG_GroovyTransformsToRunOnReconcile = "<STR_LIT>" ; public static final String OPTION_ReportInvalidAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportMissingAnnotation = "<STR_LIT>" ; public static final String OPTION_ReportMissingJavadoc = "<STR_LIT>" ; public static final String GENERATE = "<STR_LIT>" ; public static final String DO_NOT_GENERATE = "<STR_LIT>" ; public static final String PRESERVE = "<STR_LIT>" ; public static final String OPTIMIZE_OUT = "<STR_LIT>" ; public static final String VERSION_1_1 = "<STR_LIT>" ; public static final String VERSION_1_2 = "<STR_LIT>" ; public static final String VERSION_1_3 = "<STR_LIT>" ; public static final String VERSION_1_4 = "<STR_LIT>" ; public static final String VERSION_JSR14 = "<STR_LIT>" ; public static final String VERSION_CLDC1_1 = "<STR_LIT>" ; public static final String VERSION_1_5 = "<STR_LIT>" ; public static final String VERSION_1_6 = "<STR_LIT>" ; public static final String VERSION_1_7 = "<STR_LIT>" ; public static final String ERROR = "<STR_LIT:error>" ; public static final String WARNING = "<STR_LIT>" ; public static final String IGNORE = "<STR_LIT>" ; public static final String ENABLED = "<STR_LIT>" ; public static final String DISABLED = "<STR_LIT>" ; public static final String PUBLIC = "<STR_LIT>" ; public static final String PROTECTED = "<STR_LIT>" ; public static final String DEFAULT = "<STR_LIT:default>" ; public static final String PRIVATE = "<STR_LIT>" ; public static final String RETURN_TAG = "<STR_LIT>" ; public static final String NO_TAG = "<STR_LIT>" ; public static final String ALL_STANDARD_TAGS = "<STR_LIT>" ; public static final int MethodWithConstructorName = IrritantSet . GROUP0 | ASTNode . Bit1 ; public static final int OverriddenPackageDefaultMethod = IrritantSet . GROUP0 | ASTNode . Bit2 ; public static final int UsingDeprecatedAPI = IrritantSet . GROUP0 | ASTNode . Bit3 ; public static final int MaskedCatchBlock = IrritantSet . GROUP0 | ASTNode . Bit4 ; public static final int UnusedLocalVariable = IrritantSet . GROUP0 | ASTNode . Bit5 ; public static final int UnusedArgument = IrritantSet . GROUP0 | ASTNode . Bit6 ; public static final int NoImplicitStringConversion = IrritantSet . GROUP0 | ASTNode . Bit7 ; public static final int AccessEmulation = IrritantSet . GROUP0 | ASTNode . Bit8 ; public static final int NonExternalizedString = IrritantSet . GROUP0 | ASTNode . Bit9 ; public static final int AssertUsedAsAnIdentifier = IrritantSet . GROUP0 | ASTNode . Bit10 ; public static final int UnusedImport = IrritantSet . GROUP0 | ASTNode . Bit11 ; public static final int NonStaticAccessToStatic = IrritantSet . GROUP0 | ASTNode . Bit12 ; public static final int Task = IrritantSet . GROUP0 | ASTNode . Bit13 ; public static final int NoEffectAssignment = IrritantSet . GROUP0 | ASTNode . Bit14 ; public static final int IncompatibleNonInheritedInterfaceMethod = IrritantSet . GROUP0 | ASTNode . Bit15 ; public static final int UnusedPrivateMember = IrritantSet . GROUP0 | ASTNode . Bit16 ; public static final int LocalVariableHiding = IrritantSet . GROUP0 | ASTNode . Bit17 ; public static final int FieldHiding = IrritantSet . GROUP0 | ASTNode . Bit18 ; public static final int AccidentalBooleanAssign = IrritantSet . GROUP0 | ASTNode . Bit19 ; public static final int EmptyStatement = IrritantSet . GROUP0 | ASTNode . Bit20 ; public static final int MissingJavadocComments = IrritantSet . GROUP0 | ASTNode . Bit21 ; public static final int MissingJavadocTags = IrritantSet . GROUP0 | ASTNode . Bit22 ; public static final int UnqualifiedFieldAccess = IrritantSet . GROUP0 | ASTNode . Bit23 ; public static final int UnusedDeclaredThrownException = IrritantSet . GROUP0 | ASTNode . Bit24 ; public static final int FinallyBlockNotCompleting = IrritantSet . GROUP0 | ASTNode . Bit25 ; public static final int InvalidJavadoc = IrritantSet . GROUP0 | ASTNode . Bit26 ; public static final int UnnecessaryTypeCheck = IrritantSet . GROUP0 | ASTNode . Bit27 ; public static final int UndocumentedEmptyBlock = IrritantSet . GROUP0 | ASTNode . Bit28 ; public static final int IndirectStaticAccess = IrritantSet . GROUP0 | ASTNode . Bit29 ; public static final int UnnecessaryElse = IrritantSet . GROUP1 | ASTNode . Bit1 ; public static final int UncheckedTypeOperation = IrritantSet . GROUP1 | ASTNode . Bit2 ; public static final int FinalParameterBound = IrritantSet . GROUP1 | ASTNode . Bit3 ; public static final int MissingSerialVersion = IrritantSet . GROUP1 | ASTNode . Bit4 ; public static final int EnumUsedAsAnIdentifier = IrritantSet . GROUP1 | ASTNode . Bit5 ; public static final int ForbiddenReference = IrritantSet . GROUP1 | ASTNode . Bit6 ; public static final int VarargsArgumentNeedCast = IrritantSet . GROUP1 | ASTNode . Bit7 ; public static final int NullReference = IrritantSet . GROUP1 | ASTNode . Bit8 ; public static final int AutoBoxing = IrritantSet . GROUP1 | ASTNode . Bit9 ; public static final int AnnotationSuperInterface = IrritantSet . GROUP1 | ASTNode . Bit10 ; public static final int TypeHiding = IrritantSet . GROUP1 | ASTNode . Bit11 ; public static final int MissingOverrideAnnotation = IrritantSet . GROUP1 | ASTNode . Bit12 ; public static final int IncompleteEnumSwitch = IrritantSet . GROUP1 | ASTNode . Bit13 ; public static final int MissingDeprecatedAnnotation = IrritantSet . GROUP1 | ASTNode . Bit14 ; public static final int DiscouragedReference = IrritantSet . GROUP1 | ASTNode . Bit15 ; public static final int UnhandledWarningToken = IrritantSet . GROUP1 | ASTNode . Bit16 ; public static final int RawTypeReference = IrritantSet . GROUP1 | ASTNode . Bit17 ; public static final int UnusedLabel = IrritantSet . GROUP1 | ASTNode . Bit18 ; public static final int ParameterAssignment = IrritantSet . GROUP1 | ASTNode . Bit19 ; public static final int FallthroughCase = IrritantSet . GROUP1 | ASTNode . Bit20 ; public static final int OverridingMethodWithoutSuperInvocation = IrritantSet . GROUP1 | ASTNode . Bit21 ; public static final int PotentialNullReference = IrritantSet . GROUP1 | ASTNode . Bit22 ; public static final int RedundantNullCheck = IrritantSet . GROUP1 | ASTNode . Bit23 ; public static final int MissingJavadocTagDescription = IrritantSet . GROUP1 | ASTNode . Bit24 ; public static final int UnusedTypeArguments = IrritantSet . GROUP1 | ASTNode . Bit25 ; public static final int UnusedWarningToken = IrritantSet . GROUP1 | ASTNode . Bit26 ; public static final int RedundantSuperinterface = IrritantSet . GROUP1 | ASTNode . Bit27 ; public static final int ComparingIdentical = IrritantSet . GROUP1 | ASTNode . Bit28 ; public static final int MissingSynchronizedModifierInInheritedMethod = IrritantSet . GROUP1 | ASTNode . Bit29 ; public static final int ShouldImplementHashcode = IrritantSet . GROUP2 | ASTNode . Bit1 ; public static final int DeadCode = IrritantSet . GROUP2 | ASTNode . Bit2 ; public static final int Tasks = IrritantSet . GROUP2 | ASTNode . Bit3 ; public static final int UnusedObjectAllocation = IrritantSet . GROUP2 | ASTNode . Bit4 ; protected IrritantSet errorThreshold ; protected IrritantSet warningThreshold ; public int produceDebugAttributes ; public long complianceLevel ; public long sourceLevel ; public long targetJDK ; public String defaultEncoding ; public boolean verbose ; public boolean produceReferenceInfo ; public boolean preserveAllLocalVariables ; public boolean parseLiteralExpressionsAsConstants ; public int maxProblemsPerUnit ; public char [ ] [ ] taskTags ; public char [ ] [ ] taskPriorities ; public boolean isTaskCaseSensitive ; public boolean reportDeprecationInsideDeprecatedCode ; public boolean reportDeprecationWhenOverridingDeprecatedMethod ; public boolean reportUnusedParameterWhenImplementingAbstract ; public boolean reportUnusedParameterWhenOverridingConcrete ; public boolean reportUnusedParameterIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionWhenOverriding ; public boolean reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ; public boolean reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ; public boolean reportSpecialParameterHidingField ; public boolean reportDeadCodeInTrivialIfStatement ; public boolean docCommentSupport ; public boolean reportInvalidJavadocTags ; public int reportInvalidJavadocTagsVisibility ; public boolean reportInvalidJavadocTagsDeprecatedRef ; public boolean reportInvalidJavadocTagsNotVisibleRef ; public String reportMissingJavadocTagDescription ; public int reportMissingJavadocTagsVisibility ; public boolean reportMissingJavadocTagsOverriding ; public int reportMissingJavadocCommentsVisibility ; public boolean reportMissingJavadocCommentsOverriding ; public boolean inlineJsrBytecode ; public boolean suppressWarnings ; public boolean suppressOptionalErrors ; public boolean treatOptionalErrorAsFatal ; public boolean performMethodsFullRecovery ; public boolean performStatementsRecovery ; public boolean processAnnotations ; public boolean storeAnnotations ; public boolean reportMissingOverrideAnnotationForInterfaceMethodImplementation ; public boolean generateClassFiles ; public boolean ignoreMethodBodies ; public int buildGroovyFiles = <NUM_LIT:0> ; public int groovyFlags = <NUM_LIT:0> ; public String groovyClassLoaderPath = null ; public String groovyExtraImports = null ; public String groovyProjectName = null ; public String groovyTransformsToRunOnReconcile = null ; public final static String [ ] warningTokens = { "<STR_LIT:all>" , "<STR_LIT>" , "<STR_LIT:cast>" , "<STR_LIT>" , "<STR_LIT:deprecation>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:null>" , "<STR_LIT>" , "<STR_LIT:rawtypes>" , "<STR_LIT:serial>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:unchecked>" , "<STR_LIT>" , "<STR_LIT:unused>" , } ; public CompilerOptions ( ) { this ( null ) ; } public CompilerOptions ( Map settings ) { resetDefaults ( ) ; if ( settings != null ) { set ( settings ) ; } } public CompilerOptions ( Map settings , boolean parseLiteralExpressionsAsConstants ) { this ( settings ) ; this . parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants ; } public static String optionKeyFromIrritant ( int irritant ) { switch ( irritant ) { case MethodWithConstructorName : return OPTION_ReportMethodWithConstructorName ; case OverriddenPackageDefaultMethod : return OPTION_ReportOverridingPackageDefaultMethod ; case UsingDeprecatedAPI : case ( InvalidJavadoc | UsingDeprecatedAPI ) : return OPTION_ReportDeprecation ; case MaskedCatchBlock : return OPTION_ReportHiddenCatchBlock ; case UnusedLocalVariable : return OPTION_ReportUnusedLocal ; case UnusedArgument : return OPTION_ReportUnusedParameter ; case NoImplicitStringConversion : return OPTION_ReportNoImplicitStringConversion ; case AccessEmulation : return OPTION_ReportSyntheticAccessEmulation ; case NonExternalizedString : return OPTION_ReportNonExternalizedStringLiteral ; case AssertUsedAsAnIdentifier : return OPTION_ReportAssertIdentifier ; case UnusedImport : return OPTION_ReportUnusedImport ; case NonStaticAccessToStatic : return OPTION_ReportNonStaticAccessToStatic ; case Task : return OPTION_TaskTags ; case NoEffectAssignment : return OPTION_ReportNoEffectAssignment ; case IncompatibleNonInheritedInterfaceMethod : return OPTION_ReportIncompatibleNonInheritedInterfaceMethod ; case UnusedPrivateMember : return OPTION_ReportUnusedPrivateMember ; case LocalVariableHiding : return OPTION_ReportLocalVariableHiding ; case FieldHiding : return OPTION_ReportFieldHiding ; case AccidentalBooleanAssign : return OPTION_ReportPossibleAccidentalBooleanAssignment ; case EmptyStatement : return OPTION_ReportEmptyStatement ; case MissingJavadocComments : return OPTION_ReportMissingJavadocComments ; case MissingJavadocTags : return OPTION_ReportMissingJavadocTags ; case UnqualifiedFieldAccess : return OPTION_ReportUnqualifiedFieldAccess ; case UnusedDeclaredThrownException : return OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ; case FinallyBlockNotCompleting : return OPTION_ReportFinallyBlockNotCompletingNormally ; case InvalidJavadoc : return OPTION_ReportInvalidJavadoc ; case UnnecessaryTypeCheck : return OPTION_ReportUnnecessaryTypeCheck ; case UndocumentedEmptyBlock : return OPTION_ReportUndocumentedEmptyBlock ; case IndirectStaticAccess : return OPTION_ReportIndirectStaticAccess ; case UnnecessaryElse : return OPTION_ReportUnnecessaryElse ; case UncheckedTypeOperation : return OPTION_ReportUncheckedTypeOperation ; case FinalParameterBound : return OPTION_ReportFinalParameterBound ; case MissingSerialVersion : return OPTION_ReportMissingSerialVersion ; case EnumUsedAsAnIdentifier : return OPTION_ReportEnumIdentifier ; case ForbiddenReference : return OPTION_ReportForbiddenReference ; case VarargsArgumentNeedCast : return OPTION_ReportVarargsArgumentNeedCast ; case NullReference : return OPTION_ReportNullReference ; case PotentialNullReference : return OPTION_ReportPotentialNullReference ; case RedundantNullCheck : return OPTION_ReportRedundantNullCheck ; case AutoBoxing : return OPTION_ReportAutoboxing ; case AnnotationSuperInterface : return OPTION_ReportAnnotationSuperInterface ; case TypeHiding : return OPTION_ReportTypeParameterHiding ; case MissingOverrideAnnotation : return OPTION_ReportMissingOverrideAnnotation ; case IncompleteEnumSwitch : return OPTION_ReportIncompleteEnumSwitch ; case MissingDeprecatedAnnotation : return OPTION_ReportMissingDeprecatedAnnotation ; case DiscouragedReference : return OPTION_ReportDiscouragedReference ; case UnhandledWarningToken : return OPTION_ReportUnhandledWarningToken ; case RawTypeReference : return OPTION_ReportRawTypeReference ; case UnusedLabel : return OPTION_ReportUnusedLabel ; case ParameterAssignment : return OPTION_ReportParameterAssignment ; case FallthroughCase : return OPTION_ReportFallthroughCase ; case OverridingMethodWithoutSuperInvocation : return OPTION_ReportOverridingMethodWithoutSuperInvocation ; case MissingJavadocTagDescription : return OPTION_ReportMissingJavadocTagDescription ; case UnusedTypeArguments : return OPTION_ReportUnusedTypeArgumentsForMethodInvocation ; case UnusedWarningToken : return OPTION_ReportUnusedWarningToken ; case RedundantSuperinterface : return OPTION_ReportRedundantSuperinterface ; case ComparingIdentical : return OPTION_ReportComparingIdentical ; case MissingSynchronizedModifierInInheritedMethod : return OPTION_ReportMissingSynchronizedOnInheritedMethod ; case ShouldImplementHashcode : return OPTION_ReportMissingHashCodeMethod ; case DeadCode : return OPTION_ReportDeadCode ; case UnusedObjectAllocation : return OPTION_ReportUnusedObjectAllocation ; } return null ; } public static String versionFromJdkLevel ( long jdkLevel ) { switch ( ( int ) ( jdkLevel > > <NUM_LIT:16> ) ) { case ClassFileConstants . MAJOR_VERSION_1_1 : if ( jdkLevel == ClassFileConstants . JDK1_1 ) return VERSION_1_1 ; break ; case ClassFileConstants . MAJOR_VERSION_1_2 : if ( jdkLevel == ClassFileConstants . JDK1_2 ) return VERSION_1_2 ; break ; case ClassFileConstants . MAJOR_VERSION_1_3 : if ( jdkLevel == ClassFileConstants . JDK1_3 ) return VERSION_1_3 ; break ; case ClassFileConstants . MAJOR_VERSION_1_4 : if ( jdkLevel == ClassFileConstants . JDK1_4 ) return VERSION_1_4 ; break ; case ClassFileConstants . MAJOR_VERSION_1_5 : if ( jdkLevel == ClassFileConstants . JDK1_5 ) return VERSION_1_5 ; break ; case ClassFileConstants . MAJOR_VERSION_1_6 : if ( jdkLevel == ClassFileConstants . JDK1_6 ) return VERSION_1_6 ; break ; case ClassFileConstants . MAJOR_VERSION_1_7 : if ( jdkLevel == ClassFileConstants . JDK1_7 ) return VERSION_1_7 ; break ; } return Util . EMPTY_STRING ; } public static long versionToJdkLevel ( Object versionID ) { if ( versionID instanceof String ) { String version = ( String ) versionID ; if ( version . length ( ) == <NUM_LIT:3> && version . charAt ( <NUM_LIT:0> ) == '<CHAR_LIT:1>' && version . charAt ( <NUM_LIT:1> ) == '<CHAR_LIT:.>' ) { switch ( version . charAt ( <NUM_LIT:2> ) ) { case '<CHAR_LIT:1>' : return ClassFileConstants . JDK1_1 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_2 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_3 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_4 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_5 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_6 ; case '<CHAR_LIT>' : return ClassFileConstants . JDK1_7 ; default : return <NUM_LIT:0> ; } } if ( VERSION_JSR14 . equals ( versionID ) ) { return ClassFileConstants . JDK1_4 ; } if ( VERSION_CLDC1_1 . equals ( versionID ) ) { return ClassFileConstants . CLDC_1_1 ; } } return <NUM_LIT:0> ; } public static String [ ] warningOptionNames ( ) { String [ ] result = { OPTION_ReportAnnotationSuperInterface , OPTION_ReportAssertIdentifier , OPTION_ReportAutoboxing , OPTION_ReportDeadCode , OPTION_ReportDeprecation , OPTION_ReportDiscouragedReference , OPTION_ReportEmptyStatement , OPTION_ReportEnumIdentifier , OPTION_ReportFallthroughCase , OPTION_ReportFieldHiding , OPTION_ReportFinalParameterBound , OPTION_ReportFinallyBlockNotCompletingNormally , OPTION_ReportForbiddenReference , OPTION_ReportHiddenCatchBlock , OPTION_ReportIncompatibleNonInheritedInterfaceMethod , OPTION_ReportIncompleteEnumSwitch , OPTION_ReportIndirectStaticAccess , OPTION_ReportInvalidJavadoc , OPTION_ReportLocalVariableHiding , OPTION_ReportMethodWithConstructorName , OPTION_ReportMissingDeprecatedAnnotation , OPTION_ReportMissingJavadocComments , OPTION_ReportMissingJavadocTagDescription , OPTION_ReportMissingJavadocTags , OPTION_ReportMissingOverrideAnnotation , OPTION_ReportMissingSerialVersion , OPTION_ReportNoEffectAssignment , OPTION_ReportNoImplicitStringConversion , OPTION_ReportNonExternalizedStringLiteral , OPTION_ReportNonStaticAccessToStatic , OPTION_ReportNullReference , OPTION_ReportPotentialNullReference , OPTION_ReportRedundantNullCheck , OPTION_ReportRedundantSuperinterface , OPTION_ReportOverridingPackageDefaultMethod , OPTION_ReportParameterAssignment , OPTION_ReportPossibleAccidentalBooleanAssignment , OPTION_ReportSyntheticAccessEmulation , OPTION_ReportTypeParameterHiding , OPTION_ReportUncheckedTypeOperation , OPTION_ReportUndocumentedEmptyBlock , OPTION_ReportUnnecessaryElse , OPTION_ReportUnnecessaryTypeCheck , OPTION_ReportUnqualifiedFieldAccess , OPTION_ReportUnusedDeclaredThrownException , OPTION_ReportUnusedImport , OPTION_ReportUnusedLocal , OPTION_ReportUnusedObjectAllocation , OPTION_ReportUnusedParameter , OPTION_ReportUnusedPrivateMember , OPTION_ReportVarargsArgumentNeedCast , OPTION_ReportUnhandledWarningToken , OPTION_ReportUnusedWarningToken , OPTION_ReportOverridingMethodWithoutSuperInvocation , OPTION_ReportUnusedTypeArgumentsForMethodInvocation , } ; return result ; } public static String warningTokenFromIrritant ( int irritant ) { switch ( irritant ) { case ( InvalidJavadoc | UsingDeprecatedAPI ) : case UsingDeprecatedAPI : return "<STR_LIT:deprecation>" ; case FinallyBlockNotCompleting : return "<STR_LIT>" ; case FieldHiding : case LocalVariableHiding : case MaskedCatchBlock : return "<STR_LIT>" ; case NonExternalizedString : return "<STR_LIT>" ; case UnnecessaryTypeCheck : return "<STR_LIT:cast>" ; case IndirectStaticAccess : case NonStaticAccessToStatic : return "<STR_LIT>" ; case AccessEmulation : return "<STR_LIT>" ; case UnqualifiedFieldAccess : return "<STR_LIT>" ; case UncheckedTypeOperation : return "<STR_LIT:unchecked>" ; case MissingSerialVersion : return "<STR_LIT:serial>" ; case AutoBoxing : return "<STR_LIT>" ; case TypeHiding : return "<STR_LIT>" ; case IncompleteEnumSwitch : return "<STR_LIT>" ; case MissingDeprecatedAnnotation : return "<STR_LIT>" ; case RawTypeReference : return "<STR_LIT:rawtypes>" ; case UnusedLabel : case UnusedTypeArguments : case RedundantSuperinterface : case UnusedLocalVariable : case UnusedArgument : case UnusedImport : case UnusedPrivateMember : case UnusedDeclaredThrownException : case DeadCode : case UnusedObjectAllocation : return "<STR_LIT:unused>" ; case DiscouragedReference : case ForbiddenReference : return "<STR_LIT>" ; case NullReference : case PotentialNullReference : case RedundantNullCheck : return "<STR_LIT:null>" ; case FallthroughCase : return "<STR_LIT>" ; case OverridingMethodWithoutSuperInvocation : return "<STR_LIT>" ; } return null ; } public static IrritantSet warningTokenToIrritants ( String warningToken ) { if ( warningToken == null || warningToken . length ( ) == <NUM_LIT:0> ) return null ; switch ( warningToken . charAt ( <NUM_LIT:0> ) ) { case '<CHAR_LIT:a>' : if ( "<STR_LIT:all>" . equals ( warningToken ) ) return IrritantSet . ALL ; break ; case '<CHAR_LIT:b>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . BOXING ; break ; case '<CHAR_LIT:c>' : if ( "<STR_LIT:cast>" . equals ( warningToken ) ) return IrritantSet . CAST ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:deprecation>" . equals ( warningToken ) ) return IrritantSet . DEPRECATION ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . DEP_ANN ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . FALLTHROUGH ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . FINALLY ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . HIDING ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . INCOMPLETE_SWITCH ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . NLS ; if ( "<STR_LIT:null>" . equals ( warningToken ) ) return IrritantSet . NULL ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:rawtypes>" . equals ( warningToken ) ) return IrritantSet . RAW ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . RESTRICTION ; break ; case '<CHAR_LIT>' : if ( "<STR_LIT:serial>" . equals ( warningToken ) ) return IrritantSet . SERIAL ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . STATIC_ACCESS ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . SYNTHETIC_ACCESS ; if ( "<STR_LIT>" . equals ( warningToken ) ) { return IrritantSet . SUPER ; } break ; case '<CHAR_LIT>' : if ( "<STR_LIT:unused>" . equals ( warningToken ) ) return IrritantSet . UNUSED ; if ( "<STR_LIT:unchecked>" . equals ( warningToken ) ) return IrritantSet . UNCHECKED ; if ( "<STR_LIT>" . equals ( warningToken ) ) return IrritantSet . UNQUALIFIED_FIELD_ACCESS ; break ; } return null ; } public Map getMap ( ) { Map optionsMap = new HashMap ( <NUM_LIT:30> ) ; optionsMap . put ( OPTION_LocalVariableAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_LineNumberAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_SourceFileAttribute , ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ? GENERATE : DO_NOT_GENERATE ) ; optionsMap . put ( OPTION_PreserveUnusedLocal , this . preserveAllLocalVariables ? PRESERVE : OPTIMIZE_OUT ) ; optionsMap . put ( OPTION_DocCommentSupport , this . docCommentSupport ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMethodWithConstructorName , getSeverityString ( MethodWithConstructorName ) ) ; optionsMap . put ( OPTION_ReportOverridingPackageDefaultMethod , getSeverityString ( OverriddenPackageDefaultMethod ) ) ; optionsMap . put ( OPTION_ReportDeprecation , getSeverityString ( UsingDeprecatedAPI ) ) ; optionsMap . put ( OPTION_ReportDeprecationInDeprecatedCode , this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportHiddenCatchBlock , getSeverityString ( MaskedCatchBlock ) ) ; optionsMap . put ( OPTION_ReportUnusedLocal , getSeverityString ( UnusedLocalVariable ) ) ; optionsMap . put ( OPTION_ReportUnusedParameter , getSeverityString ( UnusedArgument ) ) ; optionsMap . put ( OPTION_ReportUnusedImport , getSeverityString ( UnusedImport ) ) ; optionsMap . put ( OPTION_ReportSyntheticAccessEmulation , getSeverityString ( AccessEmulation ) ) ; optionsMap . put ( OPTION_ReportNoEffectAssignment , getSeverityString ( NoEffectAssignment ) ) ; optionsMap . put ( OPTION_ReportNonExternalizedStringLiteral , getSeverityString ( NonExternalizedString ) ) ; optionsMap . put ( OPTION_ReportNoImplicitStringConversion , getSeverityString ( NoImplicitStringConversion ) ) ; optionsMap . put ( OPTION_ReportNonStaticAccessToStatic , getSeverityString ( NonStaticAccessToStatic ) ) ; optionsMap . put ( OPTION_ReportIndirectStaticAccess , getSeverityString ( IndirectStaticAccess ) ) ; optionsMap . put ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod , getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; optionsMap . put ( OPTION_ReportUnusedPrivateMember , getSeverityString ( UnusedPrivateMember ) ) ; optionsMap . put ( OPTION_ReportLocalVariableHiding , getSeverityString ( LocalVariableHiding ) ) ; optionsMap . put ( OPTION_ReportFieldHiding , getSeverityString ( FieldHiding ) ) ; optionsMap . put ( OPTION_ReportTypeParameterHiding , getSeverityString ( TypeHiding ) ) ; optionsMap . put ( OPTION_ReportPossibleAccidentalBooleanAssignment , getSeverityString ( AccidentalBooleanAssign ) ) ; optionsMap . put ( OPTION_ReportEmptyStatement , getSeverityString ( EmptyStatement ) ) ; optionsMap . put ( OPTION_ReportAssertIdentifier , getSeverityString ( AssertUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportEnumIdentifier , getSeverityString ( EnumUsedAsAnIdentifier ) ) ; optionsMap . put ( OPTION_ReportUndocumentedEmptyBlock , getSeverityString ( UndocumentedEmptyBlock ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryTypeCheck , getSeverityString ( UnnecessaryTypeCheck ) ) ; optionsMap . put ( OPTION_ReportUnnecessaryElse , getSeverityString ( UnnecessaryElse ) ) ; optionsMap . put ( OPTION_ReportAutoboxing , getSeverityString ( AutoBoxing ) ) ; optionsMap . put ( OPTION_ReportAnnotationSuperInterface , getSeverityString ( AnnotationSuperInterface ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( IncompleteEnumSwitch ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadoc , getSeverityString ( InvalidJavadoc ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsVisibility , getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTags , this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsDeprecatedRef , this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportInvalidJavadocTagsNotVisibleRef , this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocTags , getSeverityString ( MissingJavadocTags ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsVisibility , getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagsOverriding , this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingJavadocComments , getSeverityString ( MissingJavadocComments ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocTagDescription , this . reportMissingJavadocTagDescription ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsVisibility , getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; optionsMap . put ( OPTION_ReportMissingJavadocCommentsOverriding , this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportFinallyBlockNotCompletingNormally , getSeverityString ( FinallyBlockNotCompleting ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownException , getSeverityString ( UnusedDeclaredThrownException ) ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference , this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable , this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnqualifiedFieldAccess , getSeverityString ( UnqualifiedFieldAccess ) ) ; optionsMap . put ( OPTION_ReportUncheckedTypeOperation , getSeverityString ( UncheckedTypeOperation ) ) ; optionsMap . put ( OPTION_ReportRawTypeReference , getSeverityString ( RawTypeReference ) ) ; optionsMap . put ( OPTION_ReportFinalParameterBound , getSeverityString ( FinalParameterBound ) ) ; optionsMap . put ( OPTION_ReportMissingSerialVersion , getSeverityString ( MissingSerialVersion ) ) ; optionsMap . put ( OPTION_ReportForbiddenReference , getSeverityString ( ForbiddenReference ) ) ; optionsMap . put ( OPTION_ReportDiscouragedReference , getSeverityString ( DiscouragedReference ) ) ; optionsMap . put ( OPTION_ReportVarargsArgumentNeedCast , getSeverityString ( VarargsArgumentNeedCast ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotation , getSeverityString ( MissingOverrideAnnotation ) ) ; optionsMap . put ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation , this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportMissingDeprecatedAnnotation , getSeverityString ( MissingDeprecatedAnnotation ) ) ; optionsMap . put ( OPTION_ReportIncompleteEnumSwitch , getSeverityString ( IncompleteEnumSwitch ) ) ; optionsMap . put ( OPTION_ReportUnusedLabel , getSeverityString ( UnusedLabel ) ) ; optionsMap . put ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation , getSeverityString ( UnusedTypeArguments ) ) ; optionsMap . put ( OPTION_Compliance , versionFromJdkLevel ( this . complianceLevel ) ) ; optionsMap . put ( OPTION_Source , versionFromJdkLevel ( this . sourceLevel ) ) ; optionsMap . put ( OPTION_TargetPlatform , versionFromJdkLevel ( this . targetJDK ) ) ; optionsMap . put ( OPTION_FatalOptionalError , this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; if ( this . defaultEncoding != null ) { optionsMap . put ( OPTION_Encoding , this . defaultEncoding ) ; } optionsMap . put ( OPTION_TaskTags , this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; optionsMap . put ( OPTION_TaskPriorities , this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; optionsMap . put ( OPTION_TaskCaseSensitive , this . isTaskCaseSensitive ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenImplementingAbstract , this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterWhenOverridingConcrete , this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnusedParameterIncludeDocCommentReference , this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportSpecialParameterHidingField , this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_MaxProblemPerUnit , String . valueOf ( this . maxProblemsPerUnit ) ) ; optionsMap . put ( OPTION_InlineJsr , this . inlineJsrBytecode ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportNullReference , getSeverityString ( NullReference ) ) ; optionsMap . put ( OPTION_ReportPotentialNullReference , getSeverityString ( PotentialNullReference ) ) ; optionsMap . put ( OPTION_ReportRedundantNullCheck , getSeverityString ( RedundantNullCheck ) ) ; optionsMap . put ( OPTION_SuppressWarnings , this . suppressWarnings ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_SuppressOptionalErrors , this . suppressOptionalErrors ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportUnhandledWarningToken , getSeverityString ( UnhandledWarningToken ) ) ; optionsMap . put ( OPTION_ReportUnusedWarningToken , getSeverityString ( UnusedWarningToken ) ) ; optionsMap . put ( OPTION_ReportParameterAssignment , getSeverityString ( ParameterAssignment ) ) ; optionsMap . put ( OPTION_ReportFallthroughCase , getSeverityString ( FallthroughCase ) ) ; optionsMap . put ( OPTION_ReportOverridingMethodWithoutSuperInvocation , getSeverityString ( OverridingMethodWithoutSuperInvocation ) ) ; optionsMap . put ( OPTION_GenerateClassFiles , this . generateClassFiles ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_Process_Annotations , this . processAnnotations ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportRedundantSuperinterface , getSeverityString ( RedundantSuperinterface ) ) ; optionsMap . put ( OPTION_ReportComparingIdentical , getSeverityString ( ComparingIdentical ) ) ; optionsMap . put ( OPTION_ReportMissingSynchronizedOnInheritedMethod , getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; optionsMap . put ( OPTION_ReportMissingHashCodeMethod , getSeverityString ( ShouldImplementHashcode ) ) ; optionsMap . put ( OPTION_ReportDeadCode , getSeverityString ( DeadCode ) ) ; optionsMap . put ( OPTION_ReportDeadCodeInTrivialIfStatement , this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; optionsMap . put ( OPTION_ReportTasks , getSeverityString ( Tasks ) ) ; optionsMap . put ( OPTION_ReportUnusedObjectAllocation , getSeverityString ( UnusedObjectAllocation ) ) ; return optionsMap ; } public int getSeverity ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) { if ( ( irritant & ( IrritantSet . GROUP_MASK | UnusedWarningToken ) ) == UnusedWarningToken ) { return ProblemSeverities . Error | ProblemSeverities . Optional ; } return this . treatOptionalErrorAsFatal ? ProblemSeverities . Error | ProblemSeverities . Optional | ProblemSeverities . Fatal : ProblemSeverities . Error | ProblemSeverities . Optional ; } if ( this . warningThreshold . isSet ( irritant ) ) { return ProblemSeverities . Warning | ProblemSeverities . Optional ; } return ProblemSeverities . Ignore ; } public String getSeverityString ( int irritant ) { if ( this . errorThreshold . isSet ( irritant ) ) return ERROR ; if ( this . warningThreshold . isSet ( irritant ) ) return WARNING ; return IGNORE ; } public String getVisibilityString ( int level ) { switch ( level & ExtraCompilerModifiers . AccVisibilityMASK ) { case ClassFileConstants . AccPublic : return PUBLIC ; case ClassFileConstants . AccProtected : return PROTECTED ; case ClassFileConstants . AccPrivate : return PRIVATE ; default : return DEFAULT ; } } public boolean isAnyEnabled ( IrritantSet irritants ) { return this . warningThreshold . isAnySet ( irritants ) || this . errorThreshold . isAnySet ( irritants ) ; } protected void resetDefaults ( ) { this . errorThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_ERRORS ) ; this . warningThreshold = new IrritantSet ( IrritantSet . COMPILER_DEFAULT_WARNINGS ) ; this . produceDebugAttributes = ClassFileConstants . ATTR_SOURCE | ClassFileConstants . ATTR_LINES ; this . complianceLevel = ClassFileConstants . JDK1_4 ; this . sourceLevel = ClassFileConstants . JDK1_3 ; this . targetJDK = ClassFileConstants . JDK1_2 ; this . defaultEncoding = null ; this . verbose = Compiler . DEBUG ; this . produceReferenceInfo = false ; this . preserveAllLocalVariables = false ; this . parseLiteralExpressionsAsConstants = true ; this . maxProblemsPerUnit = <NUM_LIT:100> ; this . taskTags = null ; this . taskPriorities = null ; this . isTaskCaseSensitive = true ; this . reportDeprecationInsideDeprecatedCode = false ; this . reportDeprecationWhenOverridingDeprecatedMethod = false ; this . reportUnusedParameterWhenImplementingAbstract = false ; this . reportUnusedParameterWhenOverridingConcrete = false ; this . reportUnusedParameterIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; this . reportSpecialParameterHidingField = false ; this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportInvalidJavadocTags = false ; this . reportInvalidJavadocTagsDeprecatedRef = false ; this . reportInvalidJavadocTagsNotVisibleRef = false ; this . reportMissingJavadocTagDescription = RETURN_TAG ; this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocTagsOverriding = false ; this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; this . reportMissingJavadocCommentsOverriding = false ; this . inlineJsrBytecode = false ; this . docCommentSupport = false ; this . suppressWarnings = true ; this . suppressOptionalErrors = false ; this . treatOptionalErrorAsFatal = false ; this . performMethodsFullRecovery = true ; this . performStatementsRecovery = true ; this . storeAnnotations = false ; this . generateClassFiles = true ; this . processAnnotations = false ; this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; this . reportDeadCodeInTrivialIfStatement = false ; this . ignoreMethodBodies = false ; } public void set ( Map optionsMap ) { Object optionValue ; if ( ( optionValue = optionsMap . get ( OPTION_LocalVariableAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_VARS ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_VARS ; } } if ( ( optionValue = optionsMap . get ( OPTION_LineNumberAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_LINES ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_LINES ; } } if ( ( optionValue = optionsMap . get ( OPTION_SourceFileAttribute ) ) != null ) { if ( GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes |= ClassFileConstants . ATTR_SOURCE ; } else if ( DO_NOT_GENERATE . equals ( optionValue ) ) { this . produceDebugAttributes &= ~ ClassFileConstants . ATTR_SOURCE ; } } if ( ( optionValue = optionsMap . get ( OPTION_PreserveUnusedLocal ) ) != null ) { if ( PRESERVE . equals ( optionValue ) ) { this . preserveAllLocalVariables = true ; } else if ( OPTIMIZE_OUT . equals ( optionValue ) ) { this . preserveAllLocalVariables = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationInDeprecatedCode ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationInsideDeprecatedCode = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecationWhenOverridingDeprecatedMethod ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeprecationWhenOverridingDeprecatedMethod = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionWhenOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Compliance ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) this . complianceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_Source ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) this . sourceLevel = level ; } if ( ( optionValue = optionsMap . get ( OPTION_TargetPlatform ) ) != null ) { long level = versionToJdkLevel ( optionValue ) ; if ( level != <NUM_LIT:0> ) { this . targetJDK = level ; } if ( this . targetJDK >= ClassFileConstants . JDK1_5 ) this . inlineJsrBytecode = true ; } if ( ( optionValue = optionsMap . get ( OPTION_Encoding ) ) != null ) { if ( optionValue instanceof String ) { this . defaultEncoding = null ; String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > <NUM_LIT:0> ) { try { new InputStreamReader ( new ByteArrayInputStream ( new byte [ <NUM_LIT:0> ] ) , stringValue ) ; this . defaultEncoding = stringValue ; } catch ( UnsupportedEncodingException e ) { } } } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenImplementingAbstract ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenImplementingAbstract = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterWhenOverridingConcrete ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterWhenOverridingConcrete = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameterIncludeDocCommentReference ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportUnusedParameterIncludeDocCommentReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportSpecialParameterHidingField ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportSpecialParameterHidingField = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCodeInTrivialIfStatement ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportDeadCodeInTrivialIfStatement = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_MaxProblemPerUnit ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; try { int val = Integer . parseInt ( stringValue ) ; if ( val >= <NUM_LIT:0> ) this . maxProblemsPerUnit = val ; } catch ( NumberFormatException e ) { } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskTags ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { this . taskTags = null ; } else { this . taskTags = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskPriorities ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) == <NUM_LIT:0> ) { this . taskPriorities = null ; } else { this . taskPriorities = CharOperation . splitAndTrimOn ( '<CHAR_LIT:U+002C>' , stringValue . toCharArray ( ) ) ; } } } if ( ( optionValue = optionsMap . get ( OPTION_TaskCaseSensitive ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . isTaskCaseSensitive = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_InlineJsr ) ) != null ) { if ( this . targetJDK < ClassFileConstants . JDK1_5 ) { if ( ENABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . inlineJsrBytecode = false ; } } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressWarnings ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressWarnings = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressWarnings = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_SuppressOptionalErrors ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suppressOptionalErrors = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_FatalOptionalError ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . treatOptionalErrorAsFatal = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingOverrideAnnotationForInterfaceMethodImplementation = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMethodWithConstructorName ) ) != null ) updateSeverity ( MethodWithConstructorName , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingPackageDefaultMethod ) ) != null ) updateSeverity ( OverriddenPackageDefaultMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeprecation ) ) != null ) updateSeverity ( UsingDeprecatedAPI , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportHiddenCatchBlock ) ) != null ) updateSeverity ( MaskedCatchBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLocal ) ) != null ) updateSeverity ( UnusedLocalVariable , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedParameter ) ) != null ) updateSeverity ( UnusedArgument , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedImport ) ) != null ) updateSeverity ( UnusedImport , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedPrivateMember ) ) != null ) updateSeverity ( UnusedPrivateMember , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedDeclaredThrownException ) ) != null ) updateSeverity ( UnusedDeclaredThrownException , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoImplicitStringConversion ) ) != null ) updateSeverity ( NoImplicitStringConversion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportSyntheticAccessEmulation ) ) != null ) updateSeverity ( AccessEmulation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportLocalVariableHiding ) ) != null ) updateSeverity ( LocalVariableHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFieldHiding ) ) != null ) updateSeverity ( FieldHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTypeParameterHiding ) ) != null ) updateSeverity ( TypeHiding , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPossibleAccidentalBooleanAssignment ) ) != null ) updateSeverity ( AccidentalBooleanAssign , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEmptyStatement ) ) != null ) updateSeverity ( EmptyStatement , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonExternalizedStringLiteral ) ) != null ) updateSeverity ( NonExternalizedString , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAssertIdentifier ) ) != null ) updateSeverity ( AssertUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportEnumIdentifier ) ) != null ) updateSeverity ( EnumUsedAsAnIdentifier , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNonStaticAccessToStatic ) ) != null ) updateSeverity ( NonStaticAccessToStatic , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIndirectStaticAccess ) ) != null ) updateSeverity ( IndirectStaticAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompatibleNonInheritedInterfaceMethod ) ) != null ) updateSeverity ( IncompatibleNonInheritedInterfaceMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUndocumentedEmptyBlock ) ) != null ) updateSeverity ( UndocumentedEmptyBlock , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryTypeCheck ) ) != null ) updateSeverity ( UnnecessaryTypeCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnnecessaryElse ) ) != null ) updateSeverity ( UnnecessaryElse , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinallyBlockNotCompletingNormally ) ) != null ) updateSeverity ( FinallyBlockNotCompleting , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnqualifiedFieldAccess ) ) != null ) updateSeverity ( UnqualifiedFieldAccess , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNoEffectAssignment ) ) != null ) updateSeverity ( NoEffectAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUncheckedTypeOperation ) ) != null ) updateSeverity ( UncheckedTypeOperation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRawTypeReference ) ) != null ) updateSeverity ( RawTypeReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFinalParameterBound ) ) != null ) updateSeverity ( FinalParameterBound , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSerialVersion ) ) != null ) updateSeverity ( MissingSerialVersion , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportForbiddenReference ) ) != null ) updateSeverity ( ForbiddenReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDiscouragedReference ) ) != null ) updateSeverity ( DiscouragedReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportVarargsArgumentNeedCast ) ) != null ) updateSeverity ( VarargsArgumentNeedCast , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportNullReference ) ) != null ) updateSeverity ( NullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportPotentialNullReference ) ) != null ) updateSeverity ( PotentialNullReference , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantNullCheck ) ) != null ) updateSeverity ( RedundantNullCheck , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAutoboxing ) ) != null ) updateSeverity ( AutoBoxing , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportAnnotationSuperInterface ) ) != null ) updateSeverity ( AnnotationSuperInterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingOverrideAnnotation ) ) != null ) updateSeverity ( MissingOverrideAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingDeprecatedAnnotation ) ) != null ) updateSeverity ( MissingDeprecatedAnnotation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportIncompleteEnumSwitch ) ) != null ) updateSeverity ( IncompleteEnumSwitch , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnhandledWarningToken ) ) != null ) updateSeverity ( UnhandledWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedWarningToken ) ) != null ) updateSeverity ( UnusedWarningToken , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedLabel ) ) != null ) updateSeverity ( UnusedLabel , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportParameterAssignment ) ) != null ) updateSeverity ( ParameterAssignment , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportFallthroughCase ) ) != null ) updateSeverity ( FallthroughCase , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportOverridingMethodWithoutSuperInvocation ) ) != null ) updateSeverity ( OverridingMethodWithoutSuperInvocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedTypeArgumentsForMethodInvocation ) ) != null ) updateSeverity ( UnusedTypeArguments , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportRedundantSuperinterface ) ) != null ) updateSeverity ( RedundantSuperinterface , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportComparingIdentical ) ) != null ) updateSeverity ( ComparingIdentical , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingSynchronizedOnInheritedMethod ) ) != null ) updateSeverity ( MissingSynchronizedModifierInInheritedMethod , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingHashCodeMethod ) ) != null ) updateSeverity ( ShouldImplementHashcode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportDeadCode ) ) != null ) updateSeverity ( DeadCode , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportTasks ) ) != null ) updateSeverity ( Tasks , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_ReportUnusedObjectAllocation ) ) != null ) updateSeverity ( UnusedObjectAllocation , optionValue ) ; if ( ( optionValue = optionsMap . get ( OPTION_DocCommentSupport ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . docCommentSupport = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . docCommentSupport = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadoc ) ) != null ) { updateSeverity ( InvalidJavadoc , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportInvalidJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTags ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTags = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsDeprecatedRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsDeprecatedRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportInvalidJavadocTagsNotVisibleRef ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportInvalidJavadocTagsNotVisibleRef = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTags ) ) != null ) { updateSeverity ( MissingJavadocTags , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocTagsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocTagsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocComments ) ) != null ) { updateSeverity ( MissingJavadocComments , optionValue ) ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocTagDescription ) ) != null ) { this . reportMissingJavadocTagDescription = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsVisibility ) ) != null ) { if ( PUBLIC . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPublic ; } else if ( PROTECTED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccProtected ; } else if ( DEFAULT . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccDefault ; } else if ( PRIVATE . equals ( optionValue ) ) { this . reportMissingJavadocCommentsVisibility = ClassFileConstants . AccPrivate ; } } if ( ( optionValue = optionsMap . get ( OPTION_ReportMissingJavadocCommentsOverriding ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . reportMissingJavadocCommentsOverriding = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_GenerateClassFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . generateClassFiles = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . generateClassFiles = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_Process_Annotations ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . processAnnotations = true ; this . storeAnnotations = true ; this . docCommentSupport = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . processAnnotations = false ; this . storeAnnotations = false ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_BuildGroovyFiles ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . buildGroovyFiles = <NUM_LIT:2> ; this . storeAnnotations = true ; String s = ( String ) optionsMap . get ( OPTIONG_GroovyFlags ) ; if ( s != null && s . equals ( "<STR_LIT:1>" ) ) { this . groovyFlags = <NUM_LIT> ; } else { this . groovyFlags = <NUM_LIT:0> ; } } else if ( DISABLED . equals ( optionValue ) ) { this . buildGroovyFiles = <NUM_LIT:1> ; this . groovyFlags = <NUM_LIT:0> ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyClassLoaderPath ) ) != null ) { this . groovyClassLoaderPath = ( String ) optionValue ; } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyExtraImports ) ) != null ) { this . groovyExtraImports = ( String ) optionValue ; } else { if ( sysPropConfiguredExtraImports != null ) { this . groovyExtraImports = sysPropConfiguredExtraImports ; } } if ( ( optionValue = optionsMap . get ( OPTIONG_GroovyProjectName ) ) != null ) { groovyProjectName = ( String ) optionValue ; } } static String sysPropConfiguredExtraImports = null ; static { try { sysPropConfiguredExtraImports = System . getProperty ( "<STR_LIT>" ) ; } catch ( Exception e ) { sysPropConfiguredExtraImports = null ; } } public String toString ( ) { StringBuffer buf = new StringBuffer ( "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_VARS ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_LINES ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( ( this . produceDebugAttributes & ClassFileConstants . ATTR_SOURCE ) != <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . preserveAllLocalVariables ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MethodWithConstructorName ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( OverriddenPackageDefaultMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UsingDeprecatedAPI ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MaskedCatchBlock ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedLocalVariable ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedArgument ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedImport ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AccessEmulation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NoEffectAssignment ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NonExternalizedString ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NonStaticAccessToStatic ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IndirectStaticAccess ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IncompatibleNonInheritedInterfaceMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedPrivateMember ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( LocalVariableHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FieldHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( TypeHiding ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AccidentalBooleanAssign ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( EmptyStatement ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UndocumentedEmptyBlock ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnnecessaryTypeCheck ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . docCommentSupport ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( InvalidJavadoc ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTags ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTagsDeprecatedRef ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportInvalidJavadocTagsNotVisibleRef ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportInvalidJavadocTagsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingJavadocTags ) ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportMissingJavadocTagsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagsOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingJavadocComments ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocTagDescription ) ; buf . append ( "<STR_LIT>" ) . append ( getVisibilityString ( this . reportMissingJavadocCommentsVisibility ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FinallyBlockNotCompleting ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedDeclaredThrownException ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnnecessaryElse ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . complianceLevel ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . sourceLevel ) ) ; buf . append ( "<STR_LIT>" + versionFromJdkLevel ( this . targetJDK ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . verbose ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . produceReferenceInfo ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . parseLiteralExpressionsAsConstants ? "<STR_LIT>" : "<STR_LIT>" ) ; buf . append ( "<STR_LIT>" ) . append ( this . defaultEncoding == null ? "<STR_LIT>" : this . defaultEncoding ) ; buf . append ( "<STR_LIT>" ) . append ( this . taskTags == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskTags , '<CHAR_LIT:U+002C>' ) ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . taskPriorities == null ? Util . EMPTY_STRING : new String ( CharOperation . concatWith ( this . taskPriorities , '<CHAR_LIT:U+002C>' ) ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeprecationInsideDeprecatedCode ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportUnusedParameterIncludeDocCommentReference ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportSpecialParameterHidingField ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . inlineJsrBytecode ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UncheckedTypeOperation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RawTypeReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( FinalParameterBound ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingSerialVersion ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( VarargsArgumentNeedCast ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ForbiddenReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( DiscouragedReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( NullReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( PotentialNullReference ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantNullCheck ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AutoBoxing ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( AnnotationSuperInterface ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingOverrideAnnotation ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingDeprecatedAnnotation ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( IncompleteEnumSwitch ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . suppressWarnings ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . suppressOptionalErrors ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnhandledWarningToken ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedWarningToken ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedLabel ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . treatOptionalErrorAsFatal ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ParameterAssignment ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . generateClassFiles ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( this . processAnnotations ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedTypeArguments ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( RedundantSuperinterface ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ComparingIdentical ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( MissingSynchronizedModifierInInheritedMethod ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( ShouldImplementHashcode ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( DeadCode ) ) ; buf . append ( "<STR_LIT>" ) . append ( this . reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( Tasks ) ) ; buf . append ( "<STR_LIT>" ) . append ( getSeverityString ( UnusedObjectAllocation ) ) ; buf . append ( "<STR_LIT>" ) . append ( ( buildGroovyFiles == <NUM_LIT:0> ) ? "<STR_LIT>" : ( buildGroovyFiles == <NUM_LIT:1> ? "<STR_LIT>" : "<STR_LIT:yes>" ) ) ; buf . append ( "<STR_LIT>" ) . append ( Integer . toHexString ( groovyFlags ) ) ; buf . append ( "<STR_LIT>" ) . append ( groovyClassLoaderPath ) ; buf . append ( "<STR_LIT>" ) . append ( groovyProjectName ) ; return buf . toString ( ) ; } protected void updateSeverity ( int irritant , Object severityString ) { if ( ERROR . equals ( severityString ) ) { this . errorThreshold . set ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } else if ( WARNING . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . set ( irritant ) ; } else if ( IGNORE . equals ( severityString ) ) { this . errorThreshold . clear ( irritant ) ; this . warningThreshold . clear ( irritant ) ; } } } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import java . io . PrintWriter ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . lookup . ReferenceBinding ; public abstract class AbstractAnnotationProcessorManager { public abstract void configure ( Object batchCompiler , String [ ] options ) ; public abstract void configureFromPlatform ( Compiler compiler , Object compilationUnitLocator , Object javaProject ) ; public abstract void setOut ( PrintWriter out ) ; public abstract void setErr ( PrintWriter err ) ; public abstract ICompilationUnit [ ] getNewUnits ( ) ; public abstract ReferenceBinding [ ] getNewClassFiles ( ) ; public abstract ICompilationUnit [ ] getDeletedUnits ( ) ; public abstract void reset ( ) ; public abstract void processAnnotations ( CompilationUnitDeclaration [ ] units , ReferenceBinding [ ] referenceBindings , boolean isLastRound ) ; public abstract void setProcessors ( Object [ ] processors ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; public interface IDebugRequestor { void acceptDebugResult ( CompilationResult result ) ; boolean isActive ( ) ; void activate ( ) ; void deactivate ( ) ; void reset ( ) ; } </s>
|
<s> package org . eclipse . jdt . internal . compiler ; import org . codehaus . jdt . groovy . integration . LanguageSupportFactory ; import org . eclipse . jdt . core . compiler . * ; import org . eclipse . jdt . internal . compiler . env . * ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . * ; import org . eclipse . jdt . internal . compiler . problem . * ; import org . eclipse . jdt . internal . compiler . util . * ; import java . io . * ; import java . util . * ; public class Compiler implements ITypeRequestor , ProblemSeverities { public Parser parser ; public ICompilerRequestor requestor ; public CompilerOptions options ; public ProblemReporter problemReporter ; protected PrintWriter out ; public CompilerStats stats ; public CompilationProgress progress ; public int remainingIterations = <NUM_LIT:1> ; public CompilationUnitDeclaration [ ] unitsToProcess ; public int totalUnits ; public LookupEnvironment lookupEnvironment ; public static boolean DEBUG = false ; public int parseThreshold = - <NUM_LIT:1> ; public AbstractAnnotationProcessorManager annotationProcessorManager ; public int annotationProcessorStartIndex = <NUM_LIT:0> ; public ReferenceBinding [ ] referenceBindings ; public boolean useSingleThread = true ; public static IDebugRequestor DebugRequestor = null ; public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { this ( environment , policy , new CompilerOptions ( settings ) , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory , boolean parseLiteralExpressionsAsConstants ) { this ( environment , policy , new CompilerOptions ( settings , parseLiteralExpressionsAsConstants ) , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { this ( environment , policy , options , requestor , problemFactory , null , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out ) { this ( environment , policy , options , requestor , problemFactory , out , null ) ; } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out , CompilationProgress progress ) { this . options = options ; this . progress = progress ; if ( this . options . buildGroovyFiles == <NUM_LIT:0> ) { System . err . println ( "<STR_LIT>" ) ; this . options . buildGroovyFiles = <NUM_LIT:1> ; this . options . groovyFlags = <NUM_LIT:0> ; } if ( DebugRequestor == null ) { this . requestor = requestor ; } else { this . requestor = new ICompilerRequestor ( ) { public void acceptResult ( CompilationResult result ) { if ( DebugRequestor . isActive ( ) ) { DebugRequestor . acceptDebugResult ( result ) ; } requestor . acceptResult ( result ) ; } } ; } this . problemReporter = new ProblemReporter ( policy , this . options , problemFactory ) ; this . lookupEnvironment = new LookupEnvironment ( this , this . options , this . problemReporter , environment ) ; this . out = out == null ? new PrintWriter ( System . out , true ) : out ; this . stats = new CompilerStats ( ) ; initializeParser ( ) ; } public void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { if ( this . options . verbose ) { this . out . println ( Messages . bind ( Messages . compilation_loadBinary , new String ( binaryType . getName ( ) ) ) ) ; } this . lookupEnvironment . createBinaryTypeFrom ( binaryType , packageBinding , accessRestriction ) ; } public void accept ( ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { CompilationResult unitResult = new CompilationResult ( sourceUnit , this . totalUnits , this . totalUnits , this . options . maxProblemsPerUnit ) ; unitResult . checkSecondaryTypes = true ; try { if ( this . options . verbose ) { String count = String . valueOf ( this . totalUnits + <NUM_LIT:1> ) ; this . out . println ( Messages . bind ( Messages . compilation_request , new String [ ] { count , count , new String ( sourceUnit . getFileName ( ) ) } ) ) ; } CompilationUnitDeclaration parsedUnit ; if ( this . totalUnits < this . parseThreshold ) { parsedUnit = this . parser . parse ( sourceUnit , unitResult ) ; } else { parsedUnit = this . parser . dietParse ( sourceUnit , unitResult ) ; } parsedUnit . bits |= ASTNode . IsImplicitUnit ; this . lookupEnvironment . buildTypeBindings ( parsedUnit , accessRestriction ) ; addCompilationUnit ( sourceUnit , parsedUnit ) ; this . lookupEnvironment . completeTypeBindings ( parsedUnit ) ; } catch ( AbortCompilationUnit e ) { if ( unitResult . compilationUnit == sourceUnit ) { this . requestor . acceptResult ( unitResult . tagAsAccepted ( ) ) ; } else { throw e ; } } } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { this . problemReporter . abortDueToInternalError ( Messages . bind ( Messages . abort_againstSourceModel , new String [ ] { String . valueOf ( sourceTypes [ <NUM_LIT:0> ] . getName ( ) ) , String . valueOf ( sourceTypes [ <NUM_LIT:0> ] . getFileName ( ) ) } ) ) ; } protected synchronized void addCompilationUnit ( ICompilationUnit sourceUnit , CompilationUnitDeclaration parsedUnit ) { int size = this . unitsToProcess . length ; if ( this . totalUnits == size ) System . arraycopy ( this . unitsToProcess , <NUM_LIT:0> , ( this . unitsToProcess = new CompilationUnitDeclaration [ size * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . totalUnits ) ; this . unitsToProcess [ this . totalUnits ++ ] = parsedUnit ; } protected void beginToCompile ( ICompilationUnit [ ] sourceUnits ) { int maxUnits = sourceUnits . length ; this . totalUnits = <NUM_LIT:0> ; this . unitsToProcess = new CompilationUnitDeclaration [ maxUnits ] ; internalBeginToCompile ( sourceUnits , maxUnits ) ; } protected void reportProgress ( String taskDecription ) { if ( this . progress != null ) { if ( this . progress . isCanceled ( ) ) { throw new AbortCompilation ( true , null ) ; } this . progress . setTaskName ( taskDecription ) ; } } protected void reportWorked ( int workIncrement , int currentUnitIndex ) { if ( this . progress != null ) { if ( this . progress . isCanceled ( ) ) { throw new AbortCompilation ( true , null ) ; } this . progress . worked ( workIncrement , ( this . totalUnits * this . remainingIterations ) - currentUnitIndex - <NUM_LIT:1> ) ; } } public void compile ( ICompilationUnit [ ] sourceUnits ) { this . stats . startTime = System . currentTimeMillis ( ) ; if ( this . options . buildGroovyFiles == <NUM_LIT:2> ) { int groovyFileIndex = - <NUM_LIT:1> ; for ( int u = <NUM_LIT:0> , max = sourceUnits . length ; u < max ; u ++ ) { char [ ] fn = sourceUnits [ u ] . getFileName ( ) ; boolean isDotJava = fn [ fn . length - <NUM_LIT:1> ] == '<CHAR_LIT:a>' ; if ( isDotJava ) { if ( groovyFileIndex != - <NUM_LIT:1> ) { ICompilationUnit swap = sourceUnits [ groovyFileIndex ] ; sourceUnits [ groovyFileIndex ] = sourceUnits [ u ] ; sourceUnits [ u ] = swap ; int newGroovyFileIndex = - <NUM_LIT:1> ; for ( int g = groovyFileIndex ; g <= u ; g ++ ) { char [ ] fn2 = sourceUnits [ g ] . getFileName ( ) ; boolean isDotGroovy = fn2 [ fn2 . length - <NUM_LIT:1> ] == '<CHAR_LIT>' ; if ( isDotGroovy ) { newGroovyFileIndex = g ; break ; } } groovyFileIndex = newGroovyFileIndex ; } } else { if ( groovyFileIndex == - <NUM_LIT:1> ) { groovyFileIndex = u ; } } } } CompilationUnitDeclaration unit = null ; ProcessTaskManager processingTask = null ; try { reportProgress ( Messages . compilation_beginningToCompile ) ; if ( this . annotationProcessorManager == null ) { beginToCompile ( sourceUnits ) ; } else { ICompilationUnit [ ] originalUnits = ( ICompilationUnit [ ] ) sourceUnits . clone ( ) ; try { beginToCompile ( sourceUnits ) ; processAnnotations ( ) ; if ( ! this . options . generateClassFiles ) { return ; } } catch ( SourceTypeCollisionException e ) { reset ( ) ; int originalLength = originalUnits . length ; int newProcessedLength = e . newAnnotationProcessorUnits . length ; ICompilationUnit [ ] combinedUnits = new ICompilationUnit [ originalLength + newProcessedLength ] ; System . arraycopy ( originalUnits , <NUM_LIT:0> , combinedUnits , <NUM_LIT:0> , originalLength ) ; System . arraycopy ( e . newAnnotationProcessorUnits , <NUM_LIT:0> , combinedUnits , originalLength , newProcessedLength ) ; this . annotationProcessorStartIndex = originalLength ; compile ( combinedUnits ) ; return ; } } if ( this . useSingleThread ) { for ( int i = <NUM_LIT:0> ; i < this . totalUnits ; i ++ ) { unit = this . unitsToProcess [ i ] ; reportProgress ( Messages . bind ( Messages . compilation_processing , new String ( unit . getFileName ( ) ) ) ) ; try { if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_process , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( this . totalUnits ) , new String ( this . unitsToProcess [ i ] . getFileName ( ) ) } ) ) ; process ( unit , i ) ; } finally { unit . cleanUp ( ) ; } this . unitsToProcess [ i ] = null ; reportWorked ( <NUM_LIT:1> , i ) ; this . stats . lineCount += unit . compilationResult . lineSeparatorPositions . length ; long acceptStart = System . currentTimeMillis ( ) ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; this . stats . generateTime += System . currentTimeMillis ( ) - acceptStart ; if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_done , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( this . totalUnits ) , new String ( unit . getFileName ( ) ) } ) ) ; } } else { processingTask = new ProcessTaskManager ( this ) ; int acceptedCount = <NUM_LIT:0> ; while ( true ) { try { unit = processingTask . removeNextUnit ( ) ; } catch ( Error e ) { unit = processingTask . unitToProcess ; throw e ; } catch ( RuntimeException e ) { unit = processingTask . unitToProcess ; throw e ; } if ( unit == null ) break ; reportWorked ( <NUM_LIT:1> , acceptedCount ++ ) ; this . stats . lineCount += unit . compilationResult . lineSeparatorPositions . length ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; if ( this . options . verbose ) this . out . println ( Messages . bind ( Messages . compilation_done , new String [ ] { String . valueOf ( acceptedCount ) , String . valueOf ( this . totalUnits ) , new String ( unit . getFileName ( ) ) } ) ) ; } } } catch ( AbortCompilation e ) { this . handleInternalException ( e , unit ) ; } catch ( Error e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } catch ( RuntimeException e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } finally { if ( processingTask != null ) { processingTask . shutdown ( ) ; processingTask = null ; } reset ( ) ; this . annotationProcessorStartIndex = <NUM_LIT:0> ; this . stats . endTime = System . currentTimeMillis ( ) ; } if ( this . options . verbose ) { if ( this . totalUnits > <NUM_LIT:1> ) { this . out . println ( Messages . bind ( Messages . compilation_units , String . valueOf ( this . totalUnits ) ) ) ; } else { this . out . println ( Messages . bind ( Messages . compilation_unit , String . valueOf ( this . totalUnits ) ) ) ; } } } public synchronized CompilationUnitDeclaration getUnitToProcess ( int next ) { if ( next < this . totalUnits ) { CompilationUnitDeclaration unit = this . unitsToProcess [ next ] ; this . unitsToProcess [ next ] = null ; return unit ; } return null ; } public void setBinaryTypes ( ReferenceBinding [ ] binaryTypes ) { this . referenceBindings = binaryTypes ; } protected void handleInternalException ( Throwable internalException , CompilationUnitDeclaration unit , CompilationResult result ) { if ( result == null && unit != null ) { result = unit . compilationResult ; } if ( result == null && this . lookupEnvironment . unitBeingCompleted != null ) { result = this . lookupEnvironment . unitBeingCompleted . compilationResult ; } if ( result == null ) { synchronized ( this ) { if ( this . unitsToProcess != null && this . totalUnits > <NUM_LIT:0> ) result = this . unitsToProcess [ this . totalUnits - <NUM_LIT:1> ] . compilationResult ; } } boolean needToPrint = true ; if ( result != null ) { String [ ] pbArguments = new String [ ] { Messages . bind ( Messages . compilation_internalError , Util . getExceptionSummary ( internalException ) ) , } ; result . record ( this . problemReporter . createProblem ( result . getFileName ( ) , IProblem . Unclassified , pbArguments , pbArguments , Error , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) , unit ) ; if ( ! result . hasBeenAccepted ) { this . requestor . acceptResult ( result . tagAsAccepted ( ) ) ; needToPrint = false ; } } if ( needToPrint ) { internalException . printStackTrace ( ) ; } } protected void handleInternalException ( AbortCompilation abortException , CompilationUnitDeclaration unit ) { if ( abortException . isSilent ) { if ( abortException . silentException == null ) { return ; } throw abortException . silentException ; } CompilationResult result = abortException . compilationResult ; if ( result == null && unit != null ) { result = unit . compilationResult ; } if ( result == null && this . lookupEnvironment . unitBeingCompleted != null ) { result = this . lookupEnvironment . unitBeingCompleted . compilationResult ; } if ( result == null ) { synchronized ( this ) { if ( this . unitsToProcess != null && this . totalUnits > <NUM_LIT:0> ) result = this . unitsToProcess [ this . totalUnits - <NUM_LIT:1> ] . compilationResult ; } } if ( result != null && ! result . hasBeenAccepted ) { if ( abortException . problem != null ) { recordDistantProblem : { CategorizedProblem distantProblem = abortException . problem ; CategorizedProblem [ ] knownProblems = result . problems ; for ( int i = <NUM_LIT:0> ; i < result . problemCount ; i ++ ) { if ( knownProblems [ i ] == distantProblem ) { break recordDistantProblem ; } } if ( distantProblem instanceof DefaultProblem ) { ( ( DefaultProblem ) distantProblem ) . setOriginatingFileName ( result . getFileName ( ) ) ; } result . record ( distantProblem , unit ) ; } } else { if ( abortException . exception != null ) { this . handleInternalException ( abortException . exception , null , result ) ; return ; } } if ( ! result . hasBeenAccepted ) { this . requestor . acceptResult ( result . tagAsAccepted ( ) ) ; } } else { abortException . printStackTrace ( ) ; } } public void initializeParser ( ) { this . parser = LanguageSupportFactory . getParser ( this , this . lookupEnvironment == null ? null : this . lookupEnvironment . globalOptions , this . problemReporter , this . options . parseLiteralExpressionsAsConstants , <NUM_LIT:1> ) ; } protected void internalBeginToCompile ( ICompilationUnit [ ] sourceUnits , int maxUnits ) { if ( ! this . useSingleThread && maxUnits >= ReadManager . THRESHOLD ) this . parser . readManager = new ReadManager ( sourceUnits , maxUnits ) ; for ( int i = <NUM_LIT:0> ; i < maxUnits ; i ++ ) { try { if ( this . options . verbose ) { this . out . println ( Messages . bind ( Messages . compilation_request , new String [ ] { String . valueOf ( i + <NUM_LIT:1> ) , String . valueOf ( maxUnits ) , new String ( sourceUnits [ i ] . getFileName ( ) ) } ) ) ; } CompilationUnitDeclaration parsedUnit ; CompilationResult unitResult = new CompilationResult ( sourceUnits [ i ] , i , maxUnits , this . options . maxProblemsPerUnit ) ; long parseStart = System . currentTimeMillis ( ) ; if ( this . totalUnits < this . parseThreshold ) { parsedUnit = this . parser . parse ( sourceUnits [ i ] , unitResult ) ; } else { parsedUnit = this . parser . dietParse ( sourceUnits [ i ] , unitResult ) ; } long resolveStart = System . currentTimeMillis ( ) ; this . stats . parseTime += resolveStart - parseStart ; this . lookupEnvironment . buildTypeBindings ( parsedUnit , null ) ; this . stats . resolveTime += System . currentTimeMillis ( ) - resolveStart ; addCompilationUnit ( sourceUnits [ i ] , parsedUnit ) ; ImportReference currentPackage = parsedUnit . currentPackage ; if ( currentPackage != null ) { unitResult . recordPackageName ( currentPackage . tokens ) ; } } finally { sourceUnits [ i ] = null ; } } if ( this . parser . readManager != null ) { this . parser . readManager . shutdown ( ) ; this . parser . readManager = null ; } this . lookupEnvironment . completeTypeBindings ( ) ; } public void process ( CompilationUnitDeclaration unit , int i ) { this . lookupEnvironment . unitBeingCompleted = unit ; long parseStart = System . currentTimeMillis ( ) ; this . parser . getMethodBodies ( unit ) ; long resolveStart = System . currentTimeMillis ( ) ; this . stats . parseTime += resolveStart - parseStart ; if ( unit . scope != null ) unit . scope . faultInTypes ( ) ; if ( unit . scope != null ) unit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; unit . resolve ( ) ; long analyzeStart = System . currentTimeMillis ( ) ; this . stats . resolveTime += analyzeStart - resolveStart ; if ( ! this . options . ignoreMethodBodies ) unit . analyseCode ( ) ; long generateStart = System . currentTimeMillis ( ) ; this . stats . analyzeTime += generateStart - analyzeStart ; if ( ! this . options . ignoreMethodBodies ) unit . generateCode ( ) ; if ( this . options . produceReferenceInfo && unit . scope != null ) unit . scope . storeDependencyInfo ( ) ; unit . finalizeProblems ( ) ; this . stats . generateTime += System . currentTimeMillis ( ) - generateStart ; unit . compilationResult . totalUnitsKnown = this . totalUnits ; this . lookupEnvironment . unitBeingCompleted = null ; } protected void processAnnotations ( ) { int newUnitSize = <NUM_LIT:0> ; int newClassFilesSize = <NUM_LIT:0> ; int bottom = this . annotationProcessorStartIndex ; int top = this . totalUnits ; ReferenceBinding [ ] binaryTypeBindingsTemp = this . referenceBindings ; if ( top == <NUM_LIT:0> && binaryTypeBindingsTemp == null ) return ; this . referenceBindings = null ; do { int length = top - bottom ; CompilationUnitDeclaration [ ] currentUnits = new CompilationUnitDeclaration [ length ] ; int index = <NUM_LIT:0> ; for ( int i = bottom ; i < top ; i ++ ) { CompilationUnitDeclaration currentUnit = this . unitsToProcess [ i ] ; if ( ( currentUnit . bits & ASTNode . IsImplicitUnit ) == <NUM_LIT:0> ) { currentUnits [ index ++ ] = currentUnit ; } } if ( index != length ) { System . arraycopy ( currentUnits , <NUM_LIT:0> , ( currentUnits = new CompilationUnitDeclaration [ index ] ) , <NUM_LIT:0> , index ) ; } this . annotationProcessorManager . processAnnotations ( currentUnits , binaryTypeBindingsTemp , false ) ; ICompilationUnit [ ] newUnits = this . annotationProcessorManager . getNewUnits ( ) ; newUnitSize = newUnits . length ; ReferenceBinding [ ] newClassFiles = this . annotationProcessorManager . getNewClassFiles ( ) ; binaryTypeBindingsTemp = newClassFiles ; newClassFilesSize = newClassFiles . length ; if ( newUnitSize != <NUM_LIT:0> ) { ICompilationUnit [ ] newProcessedUnits = ( ICompilationUnit [ ] ) newUnits . clone ( ) ; try { this . lookupEnvironment . isProcessingAnnotations = true ; internalBeginToCompile ( newUnits , newUnitSize ) ; } catch ( SourceTypeCollisionException e ) { e . newAnnotationProcessorUnits = newProcessedUnits ; throw e ; } finally { this . lookupEnvironment . isProcessingAnnotations = false ; this . annotationProcessorManager . reset ( ) ; } bottom = top ; top = this . totalUnits ; } else { bottom = top ; this . annotationProcessorManager . reset ( ) ; } } while ( newUnitSize != <NUM_LIT:0> || newClassFilesSize != <NUM_LIT:0> ) ; this . annotationProcessorManager . processAnnotations ( null , null , true ) ; } public void reset ( ) { this . lookupEnvironment . reset ( ) ; parser . reset ( ) ; this . parser . scanner . source = null ; this . unitsToProcess = null ; if ( DebugRequestor != null ) DebugRequestor . reset ( ) ; this . problemReporter . reset ( ) ; } public CompilationUnitDeclaration resolve ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { try { if ( unit == null ) { this . parseThreshold = <NUM_LIT:0> ; beginToCompile ( new ICompilationUnit [ ] { sourceUnit } ) ; unit = this . unitsToProcess [ <NUM_LIT:0> ] ; } else { this . lookupEnvironment . buildTypeBindings ( unit , null ) ; this . lookupEnvironment . completeTypeBindings ( ) ; } this . lookupEnvironment . unitBeingCompleted = unit ; this . parser . getMethodBodies ( unit ) ; if ( unit . scope != null ) { unit . scope . faultInTypes ( ) ; if ( unit . scope != null && verifyMethods ) { unit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; } unit . resolve ( ) ; if ( analyzeCode ) unit . analyseCode ( ) ; if ( generateCode ) unit . generateCode ( ) ; unit . finalizeProblems ( ) ; } if ( this . unitsToProcess != null ) this . unitsToProcess [ <NUM_LIT:0> ] = null ; this . requestor . acceptResult ( unit . compilationResult . tagAsAccepted ( ) ) ; return unit ; } catch ( AbortCompilation e ) { this . handleInternalException ( e , unit ) ; return unit == null ? this . unitsToProcess [ <NUM_LIT:0> ] : unit ; } catch ( Error e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } catch ( RuntimeException e ) { this . handleInternalException ( e , unit , null ) ; throw e ; } finally { } } public CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { return resolve ( null , sourceUnit , verifyMethods , analyzeCode , generateCode ) ; } } </s>
|
<s> package org . eclipse . jdt . core . formatter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Map ; import org . eclipse . jdt . core . formatter . DefaultCodeFormatterConstants ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . util . Util ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . DefaultLineTracker ; import org . eclipse . jface . text . ILineTracker ; import org . eclipse . jface . text . IRegion ; import org . eclipse . text . edits . ReplaceEdit ; public final class IndentManipulation { private IndentManipulation ( ) { } public static boolean isIndentChar ( char ch ) { return ScannerHelper . isWhitespace ( ch ) && ! isLineDelimiterChar ( ch ) ; } public static boolean isLineDelimiterChar ( char ch ) { return ch == '<STR_LIT:\n>' || ch == '<STR_LIT>' ; } public static int measureIndentUnits ( CharSequence line , int tabWidth , int indentWidth ) { if ( indentWidth < <NUM_LIT:0> || tabWidth < <NUM_LIT:0> || line == null ) { throw new IllegalArgumentException ( ) ; } if ( indentWidth == <NUM_LIT:0> ) return <NUM_LIT:0> ; int visualLength = measureIndentInSpaces ( line , tabWidth ) ; return visualLength / indentWidth ; } public static int measureIndentInSpaces ( CharSequence line , int tabWidth ) { if ( tabWidth < <NUM_LIT:0> || line == null ) { throw new IllegalArgumentException ( ) ; } int length = <NUM_LIT:0> ; int max = line . length ( ) ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { char ch = line . charAt ( i ) ; if ( ch == '<STR_LIT:\t>' ) { length = calculateSpaceEquivalents ( tabWidth , length ) ; } else if ( isIndentChar ( ch ) ) { length ++ ; } else { return length ; } } return length ; } public static String extractIndentString ( String line , int tabWidth , int indentWidth ) { if ( tabWidth < <NUM_LIT:0> || indentWidth < <NUM_LIT:0> || line == null ) { throw new IllegalArgumentException ( ) ; } int size = line . length ( ) ; int end = <NUM_LIT:0> ; int spaceEquivs = <NUM_LIT:0> ; int characters = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { char c = line . charAt ( i ) ; if ( c == '<STR_LIT:\t>' ) { spaceEquivs = calculateSpaceEquivalents ( tabWidth , spaceEquivs ) ; characters ++ ; } else if ( isIndentChar ( c ) ) { spaceEquivs ++ ; characters ++ ; } else { break ; } if ( spaceEquivs >= indentWidth ) { end += characters ; characters = <NUM_LIT:0> ; if ( indentWidth == <NUM_LIT:0> ) { spaceEquivs = <NUM_LIT:0> ; } else { spaceEquivs = spaceEquivs % indentWidth ; } } } if ( end == <NUM_LIT:0> ) { return Util . EMPTY_STRING ; } else if ( end == size ) { return line ; } else { return line . substring ( <NUM_LIT:0> , end ) ; } } public static String trimIndent ( String line , int indentUnitsToRemove , int tabWidth , int indentWidth ) { if ( tabWidth < <NUM_LIT:0> || indentWidth < <NUM_LIT:0> || line == null ) { throw new IllegalArgumentException ( ) ; } if ( indentUnitsToRemove <= <NUM_LIT:0> || indentWidth == <NUM_LIT:0> ) { return line ; } final int spaceEquivalentsToRemove = indentUnitsToRemove * indentWidth ; int start = <NUM_LIT:0> ; int spaceEquivalents = <NUM_LIT:0> ; int size = line . length ( ) ; String prefix = null ; for ( int i = <NUM_LIT:0> ; i < size ; i ++ ) { char c = line . charAt ( i ) ; if ( c == '<STR_LIT:\t>' ) { spaceEquivalents = calculateSpaceEquivalents ( tabWidth , spaceEquivalents ) ; } else if ( isIndentChar ( c ) ) { spaceEquivalents ++ ; } else { start = i ; break ; } if ( spaceEquivalents == spaceEquivalentsToRemove ) { start = i + <NUM_LIT:1> ; break ; } if ( spaceEquivalents > spaceEquivalentsToRemove ) { start = i + <NUM_LIT:1> ; char [ ] missing = new char [ spaceEquivalents - spaceEquivalentsToRemove ] ; Arrays . fill ( missing , '<CHAR_LIT:U+0020>' ) ; prefix = new String ( missing ) ; break ; } } String trimmed ; if ( start == size ) trimmed = Util . EMPTY_STRING ; else trimmed = line . substring ( start ) ; if ( prefix == null ) return trimmed ; return prefix + trimmed ; } public static String changeIndent ( String code , int indentUnitsToRemove , int tabWidth , int indentWidth , String newIndentString , String lineDelim ) { if ( tabWidth < <NUM_LIT:0> || indentWidth < <NUM_LIT:0> || code == null || indentUnitsToRemove < <NUM_LIT:0> || newIndentString == null || lineDelim == null ) { throw new IllegalArgumentException ( ) ; } try { ILineTracker tracker = new DefaultLineTracker ( ) ; tracker . set ( code ) ; int nLines = tracker . getNumberOfLines ( ) ; if ( nLines == <NUM_LIT:1> ) { return code ; } StringBuffer buf = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < nLines ; i ++ ) { IRegion region = tracker . getLineInformation ( i ) ; int start = region . getOffset ( ) ; int end = start + region . getLength ( ) ; String line = code . substring ( start , end ) ; if ( i == <NUM_LIT:0> ) { buf . append ( line ) ; } else { buf . append ( lineDelim ) ; buf . append ( newIndentString ) ; if ( indentWidth != <NUM_LIT:0> ) { buf . append ( trimIndent ( line , indentUnitsToRemove , tabWidth , indentWidth ) ) ; } else { buf . append ( line ) ; } } } return buf . toString ( ) ; } catch ( BadLocationException e ) { return code ; } } public static ReplaceEdit [ ] getChangeIndentEdits ( String source , int indentUnitsToRemove , int tabWidth , int indentWidth , String newIndentString ) { if ( tabWidth < <NUM_LIT:0> || indentWidth < <NUM_LIT:0> || source == null || indentUnitsToRemove < <NUM_LIT:0> || newIndentString == null ) { throw new IllegalArgumentException ( ) ; } ArrayList result = new ArrayList ( ) ; try { ILineTracker tracker = new DefaultLineTracker ( ) ; tracker . set ( source ) ; int nLines = tracker . getNumberOfLines ( ) ; if ( nLines == <NUM_LIT:1> ) return ( ReplaceEdit [ ] ) result . toArray ( new ReplaceEdit [ result . size ( ) ] ) ; for ( int i = <NUM_LIT:1> ; i < nLines ; i ++ ) { IRegion region = tracker . getLineInformation ( i ) ; int offset = region . getOffset ( ) ; String line = source . substring ( offset , offset + region . getLength ( ) ) ; int length = indexOfIndent ( line , indentUnitsToRemove , tabWidth , indentWidth ) ; if ( length >= <NUM_LIT:0> ) { result . add ( new ReplaceEdit ( offset , length , newIndentString ) ) ; } else { length = measureIndentUnits ( line , tabWidth , indentWidth ) ; result . add ( new ReplaceEdit ( offset , length , "<STR_LIT>" ) ) ; } } } catch ( BadLocationException cannotHappen ) { } return ( ReplaceEdit [ ] ) result . toArray ( new ReplaceEdit [ result . size ( ) ] ) ; } private static int indexOfIndent ( CharSequence line , int numberOfIndentUnits , int tabWidth , int indentWidth ) { int spaceEquivalents = numberOfIndentUnits * indentWidth ; int size = line . length ( ) ; int result = - <NUM_LIT:1> ; int blanks = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < size && blanks < spaceEquivalents ; i ++ ) { char c = line . charAt ( i ) ; if ( c == '<STR_LIT:\t>' ) { blanks = calculateSpaceEquivalents ( tabWidth , blanks ) ; } else if ( isIndentChar ( c ) ) { blanks ++ ; } else { break ; } result = i ; } if ( blanks < spaceEquivalents ) return - <NUM_LIT:1> ; return result + <NUM_LIT:1> ; } private static int calculateSpaceEquivalents ( int tabWidth , int spaceEquivalents ) { if ( tabWidth == <NUM_LIT:0> ) { return spaceEquivalents ; } int remainder = spaceEquivalents % tabWidth ; spaceEquivalents += tabWidth - remainder ; return spaceEquivalents ; } public static int getTabWidth ( Map options ) { if ( options == null ) { throw new IllegalArgumentException ( ) ; } return getIntValue ( options , DefaultCodeFormatterConstants . FORMATTER_TAB_SIZE , <NUM_LIT:4> ) ; } public static int getIndentWidth ( Map options ) { if ( options == null ) { throw new IllegalArgumentException ( ) ; } int tabWidth = getTabWidth ( options ) ; boolean isMixedMode = DefaultCodeFormatterConstants . MIXED . equals ( options . get ( DefaultCodeFormatterConstants . FORMATTER_TAB_CHAR ) ) ; if ( isMixedMode ) { return getIntValue ( options , DefaultCodeFormatterConstants . FORMATTER_INDENTATION_SIZE , tabWidth ) ; } return tabWidth ; } private static int getIntValue ( Map options , String key , int def ) { try { return Integer . parseInt ( ( String ) options . get ( key ) ) ; } catch ( NumberFormatException e ) { return def ; } } } </s>
|
<s> package org . eclipse . jdt . core . formatter ; import org . eclipse . jdt . internal . compiler . util . Util ; import org . eclipse . jface . text . IRegion ; import org . eclipse . text . edits . TextEdit ; public abstract class CodeFormatter { public static final int K_UNKNOWN = <NUM_LIT:0x00> ; public static final int K_EXPRESSION = <NUM_LIT> ; public static final int K_STATEMENTS = <NUM_LIT> ; public static final int K_CLASS_BODY_DECLARATIONS = <NUM_LIT> ; public static final int K_COMPILATION_UNIT = <NUM_LIT> ; public static final int K_SINGLE_LINE_COMMENT = <NUM_LIT> ; public static final int K_MULTI_LINE_COMMENT = <NUM_LIT> ; public static final int K_JAVA_DOC = <NUM_LIT> ; public static final int F_INCLUDE_COMMENTS = <NUM_LIT> ; public abstract TextEdit format ( int kind , String source , int offset , int length , int indentationLevel , String lineSeparator ) ; public abstract TextEdit format ( int kind , String source , IRegion [ ] regions , int indentationLevel , String lineSeparator ) ; public String createIndentationString ( int indentationLevel ) { return Util . EMPTY_STRING ; } } </s>
|
<s> package org . eclipse . jdt . core . formatter ; import java . io . BufferedInputStream ; import java . io . BufferedWriter ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileWriter ; import java . io . IOException ; import java . text . MessageFormat ; import java . util . ArrayList ; import java . util . Map ; import java . util . Properties ; import org . eclipse . equinox . app . IApplication ; import org . eclipse . equinox . app . IApplicationContext ; import org . eclipse . jdt . core . ToolFactory ; import org . eclipse . jdt . internal . core . util . Util ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . Document ; import org . eclipse . jface . text . IDocument ; import org . eclipse . osgi . util . NLS ; import org . eclipse . text . edits . TextEdit ; public class CodeFormatterApplication implements IApplication { private final static class Messages extends NLS { private static final String BUNDLE_NAME = "<STR_LIT>" ; public static String CommandLineConfigFile ; public static String CommandLineDone ; public static String CommandLineErrorConfig ; public static String CommandLineErrorFile ; public static String CommandLineErrorFileDir ; public static String CommandLineErrorQuietVerbose ; public static String CommandLineErrorNoConfigFile ; public static String CommandLineFormatting ; public static String CommandLineStart ; public static String CommandLineUsage ; public static String ConfigFileReadingError ; public static String FormatProblem ; public static String CaughtException ; public static String ExceptionSkip ; static { NLS . initializeMessages ( BUNDLE_NAME , Messages . class ) ; } public static String bind ( String message ) { return bind ( message , null ) ; } public static String bind ( String message , Object binding ) { return bind ( message , new Object [ ] { binding } ) ; } public static String bind ( String message , Object binding1 , Object binding2 ) { return bind ( message , new Object [ ] { binding1 , binding2 } ) ; } public static String bind ( String message , Object [ ] bindings ) { return MessageFormat . format ( message , bindings ) ; } } private static final String ARG_CONFIG = "<STR_LIT>" ; private static final String ARG_HELP = "<STR_LIT>" ; private static final String ARG_QUIET = "<STR_LIT>" ; private static final String ARG_VERBOSE = "<STR_LIT>" ; private String configName ; private Map options = null ; private static final String PDE_LAUNCH = "<STR_LIT>" ; private boolean quiet = false ; private boolean verbose = false ; private void displayHelp ( ) { System . out . println ( Messages . bind ( Messages . CommandLineUsage ) ) ; } private void displayHelp ( String message ) { System . err . println ( message ) ; System . out . println ( ) ; displayHelp ( ) ; } private void formatDirTree ( File dir , CodeFormatter codeFormatter ) { File [ ] files = dir . listFiles ( ) ; if ( files == null ) return ; for ( int i = <NUM_LIT:0> ; i < files . length ; i ++ ) { File file = files [ i ] ; if ( file . isDirectory ( ) ) { formatDirTree ( file , codeFormatter ) ; } else if ( Util . isJavaLikeFileName ( file . getPath ( ) ) ) { formatFile ( file , codeFormatter ) ; } } } private void formatFile ( File file , CodeFormatter codeFormatter ) { IDocument doc = new Document ( ) ; try { if ( this . verbose ) { System . out . println ( Messages . bind ( Messages . CommandLineFormatting , file . getAbsolutePath ( ) ) ) ; } String contents = new String ( org . eclipse . jdt . internal . compiler . util . Util . getFileCharContent ( file , null ) ) ; doc . set ( contents ) ; TextEdit edit = codeFormatter . format ( CodeFormatter . K_COMPILATION_UNIT | CodeFormatter . F_INCLUDE_COMMENTS , contents , <NUM_LIT:0> , contents . length ( ) , <NUM_LIT:0> , null ) ; if ( edit != null ) { edit . apply ( doc ) ; } else { System . err . println ( Messages . bind ( Messages . FormatProblem , file . getAbsolutePath ( ) ) ) ; return ; } final BufferedWriter out = new BufferedWriter ( new FileWriter ( file ) ) ; try { out . write ( doc . get ( ) ) ; out . flush ( ) ; } finally { try { out . close ( ) ; } catch ( IOException e ) { } } } catch ( IOException e ) { String errorMessage = Messages . bind ( Messages . CaughtException , "<STR_LIT>" , e . getLocalizedMessage ( ) ) ; Util . log ( e , errorMessage ) ; System . err . println ( Messages . bind ( Messages . ExceptionSkip , errorMessage ) ) ; } catch ( BadLocationException e ) { String errorMessage = Messages . bind ( Messages . CaughtException , "<STR_LIT>" , e . getLocalizedMessage ( ) ) ; Util . log ( e , errorMessage ) ; System . err . println ( Messages . bind ( Messages . ExceptionSkip , errorMessage ) ) ; } } private File [ ] processCommandLine ( String [ ] argsArray ) { ArrayList args = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> , max = argsArray . length ; i < max ; i ++ ) { args . add ( argsArray [ i ] ) ; } int index = <NUM_LIT:0> ; final int argCount = argsArray . length ; final int DEFAULT_MODE = <NUM_LIT:0> ; final int CONFIG_MODE = <NUM_LIT:1> ; int mode = DEFAULT_MODE ; final int INITIAL_SIZE = <NUM_LIT:1> ; int fileCounter = <NUM_LIT:0> ; File [ ] filesToFormat = new File [ INITIAL_SIZE ] ; loop : while ( index < argCount ) { String currentArg = argsArray [ index ++ ] ; switch ( mode ) { case DEFAULT_MODE : if ( PDE_LAUNCH . equals ( currentArg ) ) { continue loop ; } if ( ARG_HELP . equals ( currentArg ) ) { displayHelp ( ) ; return null ; } if ( ARG_VERBOSE . equals ( currentArg ) ) { this . verbose = true ; continue loop ; } if ( ARG_QUIET . equals ( currentArg ) ) { this . quiet = true ; continue loop ; } if ( ARG_CONFIG . equals ( currentArg ) ) { mode = CONFIG_MODE ; continue loop ; } File file = new File ( currentArg ) ; if ( file . exists ( ) ) { if ( filesToFormat . length == fileCounter ) { System . arraycopy ( filesToFormat , <NUM_LIT:0> , ( filesToFormat = new File [ fileCounter * <NUM_LIT:2> ] ) , <NUM_LIT:0> , fileCounter ) ; } filesToFormat [ fileCounter ++ ] = file ; } else { displayHelp ( Messages . bind ( Messages . CommandLineErrorFile , currentArg ) ) ; return null ; } break ; case CONFIG_MODE : this . configName = currentArg ; this . options = readConfig ( currentArg ) ; if ( this . options == null ) { displayHelp ( Messages . bind ( Messages . CommandLineErrorConfig , currentArg ) ) ; return null ; } mode = DEFAULT_MODE ; continue loop ; } } if ( mode == CONFIG_MODE || this . options == null ) { displayHelp ( Messages . bind ( Messages . CommandLineErrorNoConfigFile ) ) ; return null ; } if ( this . quiet && this . verbose ) { displayHelp ( Messages . bind ( Messages . CommandLineErrorQuietVerbose , new String [ ] { ARG_QUIET , ARG_VERBOSE } ) ) ; return null ; } if ( fileCounter == <NUM_LIT:0> ) { displayHelp ( Messages . bind ( Messages . CommandLineErrorFileDir ) ) ; return null ; } if ( filesToFormat . length != fileCounter ) { System . arraycopy ( filesToFormat , <NUM_LIT:0> , ( filesToFormat = new File [ fileCounter ] ) , <NUM_LIT:0> , fileCounter ) ; } return filesToFormat ; } private Properties readConfig ( String filename ) { BufferedInputStream stream = null ; try { stream = new BufferedInputStream ( new FileInputStream ( new File ( filename ) ) ) ; final Properties formatterOptions = new Properties ( ) ; formatterOptions . load ( stream ) ; return formatterOptions ; } catch ( IOException e ) { Util . log ( e , Messages . bind ( Messages . ConfigFileReadingError ) ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } return null ; } public Object start ( IApplicationContext context ) throws Exception { File [ ] filesToFormat = processCommandLine ( ( String [ ] ) context . getArguments ( ) . get ( IApplicationContext . APPLICATION_ARGS ) ) ; if ( filesToFormat == null ) { return IApplication . EXIT_OK ; } if ( ! this . quiet ) { if ( this . configName != null ) { System . out . println ( Messages . bind ( Messages . CommandLineConfigFile , this . configName ) ) ; } System . out . println ( Messages . bind ( Messages . CommandLineStart ) ) ; } final CodeFormatter codeFormatter = ToolFactory . createCodeFormatter ( this . options ) ; for ( int i = <NUM_LIT:0> , max = filesToFormat . length ; i < max ; i ++ ) { final File file = filesToFormat [ i ] ; if ( file . isDirectory ( ) ) { formatDirTree ( file , codeFormatter ) ; } else if ( Util . isJavaLikeFileName ( file . getPath ( ) ) ) { formatFile ( file , codeFormatter ) ; } } if ( ! this . quiet ) { System . out . println ( Messages . bind ( Messages . CommandLineDone ) ) ; } return IApplication . EXIT_OK ; } public void stop ( ) { } } </s>
|
<s> package org . eclipse . jdt . core . formatter ; import java . util . Map ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . ToolFactory ; import org . eclipse . jdt . internal . formatter . DefaultCodeFormatterOptions ; import org . eclipse . jdt . internal . formatter . align . Alignment ; public class DefaultCodeFormatterConstants { public static final String END_OF_LINE = "<STR_LIT>" ; public static final String FALSE = "<STR_LIT:false>" ; public static final String FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ASSIGNMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_COMPACT_IF = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_AFTER_IMPORTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_AFTER_PACKAGE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_IMPORTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BEFORE_PACKAGE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_ANNOTATION_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_SWITCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT_LINE_COMMENT = "<STR_LIT>" ; public static final String FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT_HEADER = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT_HTML = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_FORMAT_SOURCE = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_INDENT_ROOT_TAGS = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_LINE_LENGTH = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_NEW_LINES_AT_BLOCK_BOUNDARIES = "<STR_LIT>" ; public final static String FORMATTER_COMMENT_NEW_LINES_AT_JAVADOC_BOUNDARIES = "<STR_LIT>" ; public static final String FORMATTER_COMPACT_ELSE_IF = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_CONTINUATION_INDENTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_USE_ON_OFF_TAGS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_DISABLING_TAG = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_ENABLING_TAG = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_EMPTY_LINES = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INDENTATION_SIZE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AFTER_LABEL = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_LINE_SPLIT = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_JOIN_WRAPPED_LINES = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_JOIN_LINES_IN_COMMENTS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_TAB_CHAR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_TAB_SIZE = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_WRAP_BEFORE_BINARY_OPERATOR = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final String FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED = JavaCore . PLUGIN_ID + "<STR_LIT>" ; public static final int INDENT_BY_ONE = <NUM_LIT:2> ; public static final int INDENT_DEFAULT = <NUM_LIT:0> ; public static final int INDENT_ON_COLUMN = <NUM_LIT:1> ; public static final String MIXED = "<STR_LIT>" ; public static final String NEXT_LINE = "<STR_LIT>" ; public static final String NEXT_LINE_ON_WRAP = "<STR_LIT>" ; public static final String NEXT_LINE_SHIFTED = "<STR_LIT>" ; public static final String TRUE = "<STR_LIT:true>" ; public static final int WRAP_COMPACT = <NUM_LIT:1> ; public static final int WRAP_COMPACT_FIRST_BREAK = <NUM_LIT:2> ; public static final int WRAP_NEXT_PER_LINE = <NUM_LIT:5> ; public static final int WRAP_NEXT_SHIFTED = <NUM_LIT:4> ; public static final int WRAP_NO_SPLIT = <NUM_LIT:0> ; public static final int WRAP_ONE_PER_LINE = <NUM_LIT:3> ; private static final IllegalArgumentException WRONG_ARGUMENT = new IllegalArgumentException ( ) ; public static String createAlignmentValue ( boolean forceSplit , int wrapStyle , int indentStyle ) { int alignmentValue = <NUM_LIT:0> ; switch ( wrapStyle ) { case WRAP_COMPACT : alignmentValue |= Alignment . M_COMPACT_SPLIT ; break ; case WRAP_COMPACT_FIRST_BREAK : alignmentValue |= Alignment . M_COMPACT_FIRST_BREAK_SPLIT ; break ; case WRAP_NEXT_PER_LINE : alignmentValue |= Alignment . M_NEXT_PER_LINE_SPLIT ; break ; case WRAP_NEXT_SHIFTED : alignmentValue |= Alignment . M_NEXT_SHIFTED_SPLIT ; break ; case WRAP_ONE_PER_LINE : alignmentValue |= Alignment . M_ONE_PER_LINE_SPLIT ; break ; } if ( forceSplit ) { alignmentValue |= Alignment . M_FORCE ; } switch ( indentStyle ) { case INDENT_BY_ONE : alignmentValue |= Alignment . M_INDENT_BY_ONE ; break ; case INDENT_ON_COLUMN : alignmentValue |= Alignment . M_INDENT_ON_COLUMN ; } return String . valueOf ( alignmentValue ) ; } public static Map getEclipse21Settings ( ) { return DefaultCodeFormatterOptions . getDefaultSettings ( ) . getMap ( ) ; } public static Map getEclipseDefaultSettings ( ) { return DefaultCodeFormatterOptions . getEclipseDefaultSettings ( ) . getMap ( ) ; } public static boolean getForceWrapping ( String value ) { if ( value == null ) { throw WRONG_ARGUMENT ; } try { int existingValue = Integer . parseInt ( value ) ; return ( existingValue & Alignment . M_FORCE ) != <NUM_LIT:0> ; } catch ( NumberFormatException e ) { throw WRONG_ARGUMENT ; } } public static int getIndentStyle ( String value ) { if ( value == null ) { throw WRONG_ARGUMENT ; } try { int existingValue = Integer . parseInt ( value ) ; if ( ( existingValue & Alignment . M_INDENT_BY_ONE ) != <NUM_LIT:0> ) { return INDENT_BY_ONE ; } else if ( ( existingValue & Alignment . M_INDENT_ON_COLUMN ) != <NUM_LIT:0> ) { return INDENT_ON_COLUMN ; } else { return INDENT_DEFAULT ; } } catch ( NumberFormatException e ) { throw WRONG_ARGUMENT ; } } public static Map getJavaConventionsSettings ( ) { return DefaultCodeFormatterOptions . getJavaConventionsSettings ( ) . getMap ( ) ; } public static int getWrappingStyle ( String value ) { if ( value == null ) { throw WRONG_ARGUMENT ; } try { int existingValue = Integer . parseInt ( value ) & Alignment . SPLIT_MASK ; switch ( existingValue ) { case Alignment . M_COMPACT_SPLIT : return WRAP_COMPACT ; case Alignment . M_COMPACT_FIRST_BREAK_SPLIT : return WRAP_COMPACT_FIRST_BREAK ; case Alignment . M_NEXT_PER_LINE_SPLIT : return WRAP_NEXT_PER_LINE ; case Alignment . M_NEXT_SHIFTED_SPLIT : return WRAP_NEXT_SHIFTED ; case Alignment . M_ONE_PER_LINE_SPLIT : return WRAP_ONE_PER_LINE ; default : return WRAP_NO_SPLIT ; } } catch ( NumberFormatException e ) { throw WRONG_ARGUMENT ; } } public static String setForceWrapping ( String value , boolean force ) { if ( value == null ) { throw WRONG_ARGUMENT ; } try { int existingValue = Integer . parseInt ( value ) ; existingValue &= ~ Alignment . M_FORCE ; if ( force ) { existingValue |= Alignment . M_FORCE ; } return String . valueOf ( existingValue ) ; } catch ( NumberFormatException e ) { throw WRONG_ARGUMENT ; } } public static String setIndentStyle ( String value , int indentStyle ) { if ( value == null ) { throw WRONG_ARGUMENT ; } switch ( indentStyle ) { case INDENT_BY_ONE : case INDENT_DEFAULT : case INDENT_ON_COLUMN : break ; default : throw WRONG_ARGUMENT ; } try { int existingValue = Integer . parseInt ( value ) ; existingValue &= ~ ( Alignment . M_INDENT_BY_ONE | Alignment . M_INDENT_ON_COLUMN ) ; switch ( indentStyle ) { case INDENT_BY_ONE : existingValue |= Alignment . M_INDENT_BY_ONE ; break ; case INDENT_ON_COLUMN : existingValue |= Alignment . M_INDENT_ON_COLUMN ; } return String . valueOf ( existingValue ) ; } catch ( NumberFormatException e ) { throw WRONG_ARGUMENT ; } } public static String setWrappingStyle ( String value , int wrappingStyle ) { if ( value == null ) { throw WRONG_ARGUMENT ; } switch ( wrappingStyle ) { case WRAP_COMPACT : case WRAP_COMPACT_FIRST_BREAK : case WRAP_NEXT_PER_LINE : case WRAP_NEXT_SHIFTED : case WRAP_NO_SPLIT : case WRAP_ONE_PER_LINE : break ; default : throw WRONG_ARGUMENT ; } try { int existingValue = Integer . parseInt ( value ) ; existingValue &= ~ ( Alignment . SPLIT_MASK ) ; switch ( wrappingStyle ) { case WRAP_COMPACT : existingValue |= Alignment . M_COMPACT_SPLIT ; break ; case WRAP_COMPACT_FIRST_BREAK : existingValue |= Alignment . M_COMPACT_FIRST_BREAK_SPLIT ; break ; case WRAP_NEXT_PER_LINE : existingValue |= Alignment . M_NEXT_PER_LINE_SPLIT ; break ; case WRAP_NEXT_SHIFTED : existingValue |= Alignment . M_NEXT_SHIFTED_SPLIT ; break ; case WRAP_ONE_PER_LINE : existingValue |= Alignment . M_ONE_PER_LINE_SPLIT ; break ; } return String . valueOf ( existingValue ) ; } catch ( NumberFormatException e ) { throw WRONG_ARGUMENT ; } } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . compiler . ITerminalSymbols ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . core . formatter . CodeFormatter ; import org . eclipse . jdt . core . formatter . DefaultCodeFormatterConstants ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ConstructorDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . util . Util ; import org . eclipse . jdt . internal . core . util . CodeSnippetParsingUtil ; import org . eclipse . jface . text . IRegion ; import org . eclipse . jface . text . Region ; import org . eclipse . text . edits . TextEdit ; public class DefaultCodeFormatter extends CodeFormatter { public static boolean DEBUG = false ; private static final int K_MASK = K_UNKNOWN | K_EXPRESSION | K_STATEMENTS | K_CLASS_BODY_DECLARATIONS | K_COMPILATION_UNIT | K_SINGLE_LINE_COMMENT | K_MULTI_LINE_COMMENT | K_JAVA_DOC ; private static Scanner PROBING_SCANNER ; private CodeSnippetParsingUtil codeSnippetParsingUtil ; private Map defaultCompilerOptions ; private CodeFormatterVisitor newCodeFormatter ; private Map options ; private DefaultCodeFormatterOptions preferences ; public DefaultCodeFormatter ( ) { this ( new DefaultCodeFormatterOptions ( DefaultCodeFormatterConstants . getJavaConventionsSettings ( ) ) , null ) ; } public DefaultCodeFormatter ( DefaultCodeFormatterOptions preferences ) { this ( preferences , null ) ; } public DefaultCodeFormatter ( DefaultCodeFormatterOptions defaultCodeFormatterOptions , Map options ) { if ( options != null ) { this . options = options ; this . preferences = new DefaultCodeFormatterOptions ( options ) ; } else { this . options = JavaCore . getOptions ( ) ; this . preferences = new DefaultCodeFormatterOptions ( DefaultCodeFormatterConstants . getJavaConventionsSettings ( ) ) ; } this . defaultCompilerOptions = getDefaultCompilerOptions ( ) ; if ( defaultCodeFormatterOptions != null ) { this . preferences . set ( defaultCodeFormatterOptions . getMap ( ) ) ; } } public DefaultCodeFormatter ( Map options ) { this ( null , options ) ; } public String createIndentationString ( final int indentationLevel ) { if ( indentationLevel < <NUM_LIT:0> ) { throw new IllegalArgumentException ( ) ; } int tabs = <NUM_LIT:0> ; int spaces = <NUM_LIT:0> ; switch ( this . preferences . tab_char ) { case DefaultCodeFormatterOptions . SPACE : spaces = indentationLevel * this . preferences . tab_size ; break ; case DefaultCodeFormatterOptions . TAB : tabs = indentationLevel ; break ; case DefaultCodeFormatterOptions . MIXED : int tabSize = this . preferences . tab_size ; if ( tabSize != <NUM_LIT:0> ) { int spaceEquivalents = indentationLevel * this . preferences . indentation_size ; tabs = spaceEquivalents / tabSize ; spaces = spaceEquivalents % tabSize ; } break ; default : return Util . EMPTY_STRING ; } if ( tabs == <NUM_LIT:0> && spaces == <NUM_LIT:0> ) { return Util . EMPTY_STRING ; } StringBuffer buffer = new StringBuffer ( tabs + spaces ) ; for ( int i = <NUM_LIT:0> ; i < tabs ; i ++ ) { buffer . append ( '<STR_LIT:\t>' ) ; } for ( int i = <NUM_LIT:0> ; i < spaces ; i ++ ) { buffer . append ( '<CHAR_LIT:U+0020>' ) ; } return buffer . toString ( ) ; } public TextEdit format ( int kind , String source , int offset , int length , int indentationLevel , String lineSeparator ) { if ( offset < <NUM_LIT:0> || length < <NUM_LIT:0> || length > source . length ( ) ) { throw new IllegalArgumentException ( ) ; } switch ( kind & K_MASK ) { case K_JAVA_DOC : return formatComment ( kind & K_MASK , source , indentationLevel , lineSeparator , new IRegion [ ] { new Region ( offset , length ) } ) ; case K_MULTI_LINE_COMMENT : case K_SINGLE_LINE_COMMENT : return formatComment ( kind & K_MASK , source , indentationLevel , lineSeparator , new IRegion [ ] { new Region ( offset , length ) } ) ; } return format ( kind , source , new IRegion [ ] { new Region ( offset , length ) } , indentationLevel , lineSeparator ) ; } public TextEdit format ( int kind , String source , IRegion [ ] regions , int indentationLevel , String lineSeparator ) { if ( ! regionsSatisfiesPreconditions ( regions , source . length ( ) ) ) { throw new IllegalArgumentException ( ) ; } this . codeSnippetParsingUtil = new CodeSnippetParsingUtil ( ) ; boolean includeComments = ( kind & F_INCLUDE_COMMENTS ) != <NUM_LIT:0> ; switch ( kind & K_MASK ) { case K_CLASS_BODY_DECLARATIONS : return formatClassBodyDeclarations ( source , indentationLevel , lineSeparator , regions , includeComments ) ; case K_COMPILATION_UNIT : return formatCompilationUnit ( source , indentationLevel , lineSeparator , regions , includeComments ) ; case K_EXPRESSION : return formatExpression ( source , indentationLevel , lineSeparator , regions , includeComments ) ; case K_STATEMENTS : return formatStatements ( source , indentationLevel , lineSeparator , regions , includeComments ) ; case K_UNKNOWN : return probeFormatting ( source , indentationLevel , lineSeparator , regions , includeComments ) ; case K_JAVA_DOC : case K_MULTI_LINE_COMMENT : case K_SINGLE_LINE_COMMENT : throw new IllegalArgumentException ( ) ; } return null ; } private TextEdit formatClassBodyDeclarations ( String source , int indentationLevel , String lineSeparator , IRegion [ ] regions , boolean includeComments ) { ASTNode [ ] bodyDeclarations = this . codeSnippetParsingUtil . parseClassBodyDeclarations ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true ) ; if ( bodyDeclarations == null ) { return null ; } return internalFormatClassBodyDeclarations ( source , indentationLevel , lineSeparator , bodyDeclarations , regions , includeComments ) ; } private TextEdit formatComment ( int kind , String source , int indentationLevel , String lineSeparator , IRegion [ ] regions ) { Object oldOption = oldCommentFormatOption ( ) ; boolean isFormattingComments = false ; if ( oldOption == null ) { switch ( kind & K_MASK ) { case K_SINGLE_LINE_COMMENT : isFormattingComments = DefaultCodeFormatterConstants . TRUE . equals ( this . options . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_LINE_COMMENT ) ) ; break ; case K_MULTI_LINE_COMMENT : isFormattingComments = DefaultCodeFormatterConstants . TRUE . equals ( this . options . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT ) ) ; break ; case K_JAVA_DOC : isFormattingComments = DefaultCodeFormatterConstants . TRUE . equals ( this . options . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT ) ) ; } } else { isFormattingComments = DefaultCodeFormatterConstants . TRUE . equals ( oldOption ) ; } if ( isFormattingComments ) { if ( lineSeparator != null ) { this . preferences . line_separator = lineSeparator ; } else { this . preferences . line_separator = Util . LINE_SEPARATOR ; } this . preferences . initial_indentation_level = indentationLevel ; if ( this . codeSnippetParsingUtil == null ) this . codeSnippetParsingUtil = new CodeSnippetParsingUtil ( ) ; this . codeSnippetParsingUtil . parseCompilationUnit ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true ) ; this . newCodeFormatter = new CodeFormatterVisitor ( this . preferences , this . options , regions , this . codeSnippetParsingUtil , true ) ; IRegion coveredRegion = getCoveredRegion ( regions ) ; int start = coveredRegion . getOffset ( ) ; int end = start + coveredRegion . getLength ( ) ; this . newCodeFormatter . formatComment ( kind , source , start , end , indentationLevel ) ; return this . newCodeFormatter . scribe . getRootEdit ( ) ; } return null ; } private TextEdit formatCompilationUnit ( String source , int indentationLevel , String lineSeparator , IRegion [ ] regions , boolean includeComments ) { CompilationUnitDeclaration compilationUnitDeclaration = this . codeSnippetParsingUtil . parseCompilationUnit ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true ) ; if ( lineSeparator != null ) { this . preferences . line_separator = lineSeparator ; } else { this . preferences . line_separator = Util . LINE_SEPARATOR ; } this . preferences . initial_indentation_level = indentationLevel ; this . newCodeFormatter = new CodeFormatterVisitor ( this . preferences , this . options , regions , this . codeSnippetParsingUtil , includeComments ) ; return this . newCodeFormatter . format ( source , compilationUnitDeclaration ) ; } private TextEdit formatExpression ( String source , int indentationLevel , String lineSeparator , IRegion [ ] regions , boolean includeComments ) { Expression expression = this . codeSnippetParsingUtil . parseExpression ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true ) ; if ( expression == null ) { return null ; } return internalFormatExpression ( source , indentationLevel , lineSeparator , expression , regions , includeComments ) ; } private TextEdit formatStatements ( String source , int indentationLevel , String lineSeparator , IRegion [ ] regions , boolean includeComments ) { ConstructorDeclaration constructorDeclaration = this . codeSnippetParsingUtil . parseStatements ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true , false ) ; if ( constructorDeclaration . statements == null ) { return null ; } return internalFormatStatements ( source , indentationLevel , lineSeparator , constructorDeclaration , regions , includeComments ) ; } private IRegion getCoveredRegion ( IRegion [ ] regions ) { int length = regions . length ; if ( length == <NUM_LIT:1> ) { return regions [ <NUM_LIT:0> ] ; } int offset = regions [ <NUM_LIT:0> ] . getOffset ( ) ; IRegion lastRegion = regions [ length - <NUM_LIT:1> ] ; return new Region ( offset , lastRegion . getOffset ( ) + lastRegion . getLength ( ) - offset ) ; } public String getDebugOutput ( ) { return this . newCodeFormatter . scribe . toString ( ) ; } private Map getDefaultCompilerOptions ( ) { if ( this . defaultCompilerOptions == null ) { Map optionsMap = new HashMap ( <NUM_LIT:30> ) ; optionsMap . put ( CompilerOptions . OPTION_LocalVariableAttribute , CompilerOptions . DO_NOT_GENERATE ) ; optionsMap . put ( CompilerOptions . OPTION_LineNumberAttribute , CompilerOptions . DO_NOT_GENERATE ) ; optionsMap . put ( CompilerOptions . OPTION_SourceFileAttribute , CompilerOptions . DO_NOT_GENERATE ) ; optionsMap . put ( CompilerOptions . OPTION_PreserveUnusedLocal , CompilerOptions . PRESERVE ) ; optionsMap . put ( CompilerOptions . OPTION_DocCommentSupport , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMethodWithConstructorName , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportOverridingPackageDefaultMethod , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportOverridingMethodWithoutSuperInvocation , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportDeprecation , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportDeprecationInDeprecatedCode , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportDeprecationWhenOverridingDeprecatedMethod , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportHiddenCatchBlock , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedLocal , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedObjectAllocation , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedParameter , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedImport , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportSyntheticAccessEmulation , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportNoEffectAssignment , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportNonExternalizedStringLiteral , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportNoImplicitStringConversion , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportNonStaticAccessToStatic , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportIndirectStaticAccess , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportIncompatibleNonInheritedInterfaceMethod , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedPrivateMember , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportLocalVariableHiding , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportFieldHiding , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportPossibleAccidentalBooleanAssignment , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportEmptyStatement , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportAssertIdentifier , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportEnumIdentifier , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUndocumentedEmptyBlock , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnnecessaryTypeCheck , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportInvalidJavadoc , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportInvalidJavadocTagsVisibility , CompilerOptions . PUBLIC ) ; optionsMap . put ( CompilerOptions . OPTION_ReportInvalidJavadocTags , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocTagDescription , CompilerOptions . RETURN_TAG ) ; optionsMap . put ( CompilerOptions . OPTION_ReportInvalidJavadocTagsDeprecatedRef , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportInvalidJavadocTagsNotVisibleRef , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocTags , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocTagsVisibility , CompilerOptions . PUBLIC ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocTagsOverriding , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocComments , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocCommentsVisibility , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportMissingJavadocCommentsOverriding , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportFinallyBlockNotCompletingNormally , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedDeclaredThrownException , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnqualifiedFieldAccess , CompilerOptions . IGNORE ) ; optionsMap . put ( CompilerOptions . OPTION_Compliance , CompilerOptions . VERSION_1_4 ) ; optionsMap . put ( CompilerOptions . OPTION_TargetPlatform , CompilerOptions . VERSION_1_2 ) ; optionsMap . put ( CompilerOptions . OPTION_TaskTags , Util . EMPTY_STRING ) ; optionsMap . put ( CompilerOptions . OPTION_TaskPriorities , Util . EMPTY_STRING ) ; optionsMap . put ( CompilerOptions . OPTION_TaskCaseSensitive , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedParameterWhenImplementingAbstract , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportUnusedParameterWhenOverridingConcrete , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_ReportSpecialParameterHidingField , CompilerOptions . DISABLED ) ; optionsMap . put ( CompilerOptions . OPTION_MaxProblemPerUnit , String . valueOf ( <NUM_LIT:100> ) ) ; optionsMap . put ( CompilerOptions . OPTION_InlineJsr , CompilerOptions . DISABLED ) ; this . defaultCompilerOptions = optionsMap ; } Object sourceOption = this . options . get ( CompilerOptions . OPTION_Source ) ; if ( sourceOption != null ) { this . defaultCompilerOptions . put ( CompilerOptions . OPTION_Source , sourceOption ) ; } else { this . defaultCompilerOptions . put ( CompilerOptions . OPTION_Source , CompilerOptions . VERSION_1_3 ) ; } return this . defaultCompilerOptions ; } private TextEdit internalFormatClassBodyDeclarations ( String source , int indentationLevel , String lineSeparator , ASTNode [ ] bodyDeclarations , IRegion [ ] regions , boolean includeComments ) { if ( lineSeparator != null ) { this . preferences . line_separator = lineSeparator ; } else { this . preferences . line_separator = Util . LINE_SEPARATOR ; } this . preferences . initial_indentation_level = indentationLevel ; this . newCodeFormatter = new CodeFormatterVisitor ( this . preferences , this . options , regions , this . codeSnippetParsingUtil , includeComments ) ; return this . newCodeFormatter . format ( source , bodyDeclarations ) ; } private TextEdit internalFormatExpression ( String source , int indentationLevel , String lineSeparator , Expression expression , IRegion [ ] regions , boolean includeComments ) { if ( lineSeparator != null ) { this . preferences . line_separator = lineSeparator ; } else { this . preferences . line_separator = Util . LINE_SEPARATOR ; } this . preferences . initial_indentation_level = indentationLevel ; this . newCodeFormatter = new CodeFormatterVisitor ( this . preferences , this . options , regions , this . codeSnippetParsingUtil , includeComments ) ; TextEdit textEdit = this . newCodeFormatter . format ( source , expression ) ; return textEdit ; } private TextEdit internalFormatStatements ( String source , int indentationLevel , String lineSeparator , ConstructorDeclaration constructorDeclaration , IRegion [ ] regions , boolean includeComments ) { if ( lineSeparator != null ) { this . preferences . line_separator = lineSeparator ; } else { this . preferences . line_separator = Util . LINE_SEPARATOR ; } this . preferences . initial_indentation_level = indentationLevel ; this . newCodeFormatter = new CodeFormatterVisitor ( this . preferences , this . options , regions , this . codeSnippetParsingUtil , includeComments ) ; return this . newCodeFormatter . format ( source , constructorDeclaration ) ; } private Object oldCommentFormatOption ( ) { return this . options . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT ) ; } private TextEdit probeFormatting ( String source , int indentationLevel , String lineSeparator , IRegion [ ] regions , boolean includeComments ) { if ( PROBING_SCANNER == null ) { PROBING_SCANNER = new Scanner ( true , false , false , ClassFileConstants . JDK1_6 , ClassFileConstants . JDK1_6 , null , null , true ) ; } PROBING_SCANNER . setSource ( source . toCharArray ( ) ) ; IRegion coveredRegion = getCoveredRegion ( regions ) ; int offset = coveredRegion . getOffset ( ) ; int length = coveredRegion . getLength ( ) ; PROBING_SCANNER . resetTo ( offset , offset + length - <NUM_LIT:1> ) ; try { int kind = - <NUM_LIT:1> ; switch ( PROBING_SCANNER . getNextToken ( ) ) { case ITerminalSymbols . TokenNameCOMMENT_BLOCK : if ( PROBING_SCANNER . getNextToken ( ) == TerminalTokens . TokenNameEOF ) { kind = K_MULTI_LINE_COMMENT ; } break ; case ITerminalSymbols . TokenNameCOMMENT_LINE : if ( PROBING_SCANNER . getNextToken ( ) == TerminalTokens . TokenNameEOF ) { kind = K_SINGLE_LINE_COMMENT ; } break ; case ITerminalSymbols . TokenNameCOMMENT_JAVADOC : if ( PROBING_SCANNER . getNextToken ( ) == TerminalTokens . TokenNameEOF ) { kind = K_JAVA_DOC ; } break ; } if ( kind != - <NUM_LIT:1> ) { return formatComment ( kind , source , indentationLevel , lineSeparator , regions ) ; } } catch ( InvalidInputException e ) { } PROBING_SCANNER . setSource ( ( char [ ] ) null ) ; Expression expression = this . codeSnippetParsingUtil . parseExpression ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true ) ; if ( expression != null ) { return internalFormatExpression ( source , indentationLevel , lineSeparator , expression , regions , includeComments ) ; } ASTNode [ ] bodyDeclarations = this . codeSnippetParsingUtil . parseClassBodyDeclarations ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true ) ; if ( bodyDeclarations != null ) { return internalFormatClassBodyDeclarations ( source , indentationLevel , lineSeparator , bodyDeclarations , regions , includeComments ) ; } ConstructorDeclaration constructorDeclaration = this . codeSnippetParsingUtil . parseStatements ( source . toCharArray ( ) , getDefaultCompilerOptions ( ) , true , false ) ; if ( constructorDeclaration . statements != null ) { return internalFormatStatements ( source , indentationLevel , lineSeparator , constructorDeclaration , regions , includeComments ) ; } return formatCompilationUnit ( source , indentationLevel , lineSeparator , regions , includeComments ) ; } private boolean regionsSatisfiesPreconditions ( IRegion [ ] regions , int maxLength ) { int regionsLength = regions == null ? <NUM_LIT:0> : regions . length ; if ( regionsLength == <NUM_LIT:0> ) { return false ; } IRegion first = regions [ <NUM_LIT:0> ] ; if ( first . getOffset ( ) < <NUM_LIT:0> || first . getLength ( ) < <NUM_LIT:0> || first . getOffset ( ) + first . getLength ( ) > maxLength ) { return false ; } int lastOffset = first . getOffset ( ) + first . getLength ( ) - <NUM_LIT:1> ; for ( int i = <NUM_LIT:1> ; i < regionsLength ; i ++ ) { IRegion current = regions [ i ] ; if ( lastOffset > current . getOffset ( ) ) { return false ; } if ( current . getOffset ( ) < <NUM_LIT:0> || current . getLength ( ) < <NUM_LIT:0> || current . getOffset ( ) + current . getLength ( ) > maxLength ) { return false ; } lastOffset = current . getOffset ( ) + current . getLength ( ) - <NUM_LIT:1> ; } return true ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . util . ArrayList ; import java . util . Map ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . compiler . IProblem ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . core . formatter . CodeFormatter ; import org . eclipse . jdt . core . formatter . DefaultCodeFormatterConstants ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ast . AND_AND_Expression ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . AbstractMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AbstractVariableDeclaration ; import org . eclipse . jdt . internal . compiler . ast . AllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . AnnotationMethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . Argument ; import org . eclipse . jdt . internal . compiler . ast . ArrayAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . ArrayInitializer ; import org . eclipse . jdt . internal . compiler . ast . ArrayQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayTypeReference ; import org . eclipse . jdt . internal . compiler . ast . AssertStatement ; import org . eclipse . jdt . internal . compiler . ast . Assignment ; import org . eclipse . jdt . internal . compiler . ast . BinaryExpression ; import org . eclipse . jdt . internal . compiler . ast . Block ; import org . eclipse . jdt . internal . compiler . ast . BreakStatement ; import org . eclipse . jdt . internal . compiler . ast . CaseStatement ; import org . eclipse . jdt . internal . compiler . ast . CastExpression ; import org . eclipse . jdt . internal . compiler . ast . CharLiteral ; import org . eclipse . jdt . internal . compiler . ast . ClassLiteralAccess ; import org . eclipse . jdt . internal . compiler . ast . Clinit ; import org . eclipse . jdt . internal . compiler . ast . CombinedBinaryExpression ; import org . eclipse . jdt . internal . compiler . ast . CompilationUnitDeclaration ; import org . eclipse . jdt . internal . compiler . ast . CompoundAssignment ; import org . eclipse . jdt . internal . compiler . ast . ConditionalExpression ; import org . eclipse . jdt . internal . compiler . ast . ConstructorDeclaration ; import org . eclipse . jdt . internal . compiler . ast . ContinueStatement ; import org . eclipse . jdt . internal . compiler . ast . DoStatement ; import org . eclipse . jdt . internal . compiler . ast . DoubleLiteral ; import org . eclipse . jdt . internal . compiler . ast . EmptyStatement ; import org . eclipse . jdt . internal . compiler . ast . EqualExpression ; import org . eclipse . jdt . internal . compiler . ast . ExplicitConstructorCall ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . FalseLiteral ; import org . eclipse . jdt . internal . compiler . ast . FieldDeclaration ; import org . eclipse . jdt . internal . compiler . ast . FieldReference ; import org . eclipse . jdt . internal . compiler . ast . FloatLiteral ; import org . eclipse . jdt . internal . compiler . ast . ForStatement ; import org . eclipse . jdt . internal . compiler . ast . ForeachStatement ; import org . eclipse . jdt . internal . compiler . ast . IfStatement ; import org . eclipse . jdt . internal . compiler . ast . ImportReference ; import org . eclipse . jdt . internal . compiler . ast . Initializer ; import org . eclipse . jdt . internal . compiler . ast . InstanceOfExpression ; import org . eclipse . jdt . internal . compiler . ast . IntLiteral ; import org . eclipse . jdt . internal . compiler . ast . LabeledStatement ; import org . eclipse . jdt . internal . compiler . ast . LocalDeclaration ; import org . eclipse . jdt . internal . compiler . ast . LongLiteral ; import org . eclipse . jdt . internal . compiler . ast . MarkerAnnotation ; import org . eclipse . jdt . internal . compiler . ast . MemberValuePair ; import org . eclipse . jdt . internal . compiler . ast . MessageSend ; import org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ; import org . eclipse . jdt . internal . compiler . ast . NormalAnnotation ; import org . eclipse . jdt . internal . compiler . ast . NullLiteral ; import org . eclipse . jdt . internal . compiler . ast . OR_OR_Expression ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . ast . ParameterizedQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ParameterizedSingleTypeReference ; import org . eclipse . jdt . internal . compiler . ast . PostfixExpression ; import org . eclipse . jdt . internal . compiler . ast . PrefixExpression ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . QualifiedNameReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedSuperReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedThisReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ReturnStatement ; import org . eclipse . jdt . internal . compiler . ast . SingleMemberAnnotation ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . SingleTypeReference ; import org . eclipse . jdt . internal . compiler . ast . Statement ; import org . eclipse . jdt . internal . compiler . ast . StringLiteral ; import org . eclipse . jdt . internal . compiler . ast . StringLiteralConcatenation ; import org . eclipse . jdt . internal . compiler . ast . SuperReference ; import org . eclipse . jdt . internal . compiler . ast . SwitchStatement ; import org . eclipse . jdt . internal . compiler . ast . SynchronizedStatement ; import org . eclipse . jdt . internal . compiler . ast . ThisReference ; import org . eclipse . jdt . internal . compiler . ast . ThrowStatement ; import org . eclipse . jdt . internal . compiler . ast . TrueLiteral ; import org . eclipse . jdt . internal . compiler . ast . TryStatement ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . ast . TypeParameter ; import org . eclipse . jdt . internal . compiler . ast . TypeReference ; import org . eclipse . jdt . internal . compiler . ast . UnaryExpression ; import org . eclipse . jdt . internal . compiler . ast . WhileStatement ; import org . eclipse . jdt . internal . compiler . ast . Wildcard ; 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 . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . CompilationUnitScope ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . core . util . CodeSnippetParsingUtil ; import org . eclipse . jdt . internal . formatter . align . Alignment ; import org . eclipse . jdt . internal . formatter . align . AlignmentException ; import org . eclipse . jface . text . IRegion ; import org . eclipse . text . edits . TextEdit ; public class CodeFormatterVisitor extends ASTVisitor { public static class MultiFieldDeclaration extends FieldDeclaration { FieldDeclaration [ ] declarations ; MultiFieldDeclaration ( FieldDeclaration [ ] declarations ) { this . declarations = declarations ; this . modifiers = declarations [ <NUM_LIT:0> ] . modifiers ; } } public final static boolean DEBUG = false ; private static final int NO_MODIFIERS = <NUM_LIT:0> ; private static final int [ ] SINGLETYPEREFERENCE_EXPECTEDTOKENS = new int [ ] { TerminalTokens . TokenNameIdentifier , TerminalTokens . TokenNameboolean , TerminalTokens . TokenNamebyte , TerminalTokens . TokenNamechar , TerminalTokens . TokenNamedouble , TerminalTokens . TokenNamefloat , TerminalTokens . TokenNameint , TerminalTokens . TokenNamelong , TerminalTokens . TokenNameshort , TerminalTokens . TokenNamevoid } ; private static final int [ ] CLOSING_GENERICS_EXPECTEDTOKENS = new int [ ] { TerminalTokens . TokenNameRIGHT_SHIFT , TerminalTokens . TokenNameUNSIGNED_RIGHT_SHIFT , TerminalTokens . TokenNameGREATER } ; public int lastLocalDeclarationSourceStart ; private Scanner localScanner ; public DefaultCodeFormatterOptions preferences ; public Scribe scribe ; public CodeFormatterVisitor ( DefaultCodeFormatterOptions preferences , Map settings , IRegion [ ] regions , CodeSnippetParsingUtil codeSnippetParsingUtil , boolean includeComments ) { long sourceLevel = settings == null ? ClassFileConstants . JDK1_3 : CompilerOptions . versionToJdkLevel ( settings . get ( JavaCore . COMPILER_SOURCE ) ) ; this . localScanner = new Scanner ( true , false , false , sourceLevel , null , null , true ) ; this . preferences = preferences ; this . scribe = new Scribe ( this , sourceLevel , regions , codeSnippetParsingUtil , includeComments ) ; } public void acceptProblem ( IProblem problem ) { super . acceptProblem ( problem ) ; } private BinaryExpressionFragmentBuilder buildFragments ( BinaryExpression binaryExpression , BlockScope scope ) { BinaryExpressionFragmentBuilder builder = new BinaryExpressionFragmentBuilder ( ) ; if ( binaryExpression instanceof CombinedBinaryExpression ) { binaryExpression . traverse ( builder , scope ) ; return builder ; } switch ( ( binaryExpression . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) { case OperatorIds . MULTIPLY : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameMULTIPLY ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . PLUS : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNamePLUS ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . DIVIDE : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameDIVIDE ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . REMAINDER : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameREMAINDER ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . XOR : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameXOR ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . MINUS : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameMINUS ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . OR : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameOR ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . AND : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameAND ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . AND_AND : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameAND_AND ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; case OperatorIds . OR_OR : binaryExpression . left . traverse ( builder , scope ) ; builder . operatorsList . add ( new Integer ( TerminalTokens . TokenNameOR_OR ) ) ; binaryExpression . right . traverse ( builder , scope ) ; break ; } return builder ; } private CascadingMethodInvocationFragmentBuilder buildFragments ( MessageSend messageSend , BlockScope scope ) { CascadingMethodInvocationFragmentBuilder builder = new CascadingMethodInvocationFragmentBuilder ( ) ; messageSend . traverse ( builder , scope ) ; return builder ; } private boolean commentStartsBlock ( int start , int end ) { this . localScanner . resetTo ( start , end ) ; try { if ( this . localScanner . getNextToken ( ) == TerminalTokens . TokenNameLBRACE ) { switch ( this . localScanner . getNextToken ( ) ) { case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : return true ; } } } catch ( InvalidInputException e ) { } return false ; } private ASTNode [ ] computeMergedMemberDeclarations ( ASTNode [ ] nodes ) { ArrayList mergedNodes = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> , max = nodes . length ; i < max ; i ++ ) { ASTNode currentNode = nodes [ i ] ; if ( currentNode instanceof FieldDeclaration ) { FieldDeclaration currentField = ( FieldDeclaration ) currentNode ; if ( mergedNodes . size ( ) == <NUM_LIT:0> ) { mergedNodes . add ( currentNode ) ; } else { ASTNode previousMergedNode = ( ASTNode ) mergedNodes . get ( mergedNodes . size ( ) - <NUM_LIT:1> ) ; if ( previousMergedNode instanceof MultiFieldDeclaration ) { MultiFieldDeclaration multiFieldDeclaration = ( MultiFieldDeclaration ) previousMergedNode ; int length = multiFieldDeclaration . declarations . length ; System . arraycopy ( multiFieldDeclaration . declarations , <NUM_LIT:0> , multiFieldDeclaration . declarations = new FieldDeclaration [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; multiFieldDeclaration . declarations [ length ] = currentField ; } else if ( previousMergedNode instanceof FieldDeclaration ) { final FieldDeclaration previousFieldDeclaration = ( FieldDeclaration ) previousMergedNode ; if ( currentField . declarationSourceStart == previousFieldDeclaration . declarationSourceStart ) { final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration ( new FieldDeclaration [ ] { previousFieldDeclaration , currentField } ) ; multiFieldDeclaration . annotations = previousFieldDeclaration . annotations ; mergedNodes . set ( mergedNodes . size ( ) - <NUM_LIT:1> , multiFieldDeclaration ) ; } else { mergedNodes . add ( currentNode ) ; } } else { mergedNodes . add ( currentNode ) ; } } } else { mergedNodes . add ( currentNode ) ; } } if ( mergedNodes . size ( ) != nodes . length ) { ASTNode [ ] result = new ASTNode [ mergedNodes . size ( ) ] ; mergedNodes . toArray ( result ) ; return result ; } else { return nodes ; } } private ASTNode [ ] computeMergedMemberDeclarations ( TypeDeclaration typeDeclaration ) { int fieldIndex = <NUM_LIT:0> , fieldCount = ( typeDeclaration . fields == null ) ? <NUM_LIT:0> : typeDeclaration . fields . length ; FieldDeclaration field = fieldCount == <NUM_LIT:0> ? null : typeDeclaration . fields [ fieldIndex ] ; int fieldStart = field == null ? Integer . MAX_VALUE : field . declarationSourceStart ; int methodIndex = <NUM_LIT:0> , methodCount = ( typeDeclaration . methods == null ) ? <NUM_LIT:0> : typeDeclaration . methods . length ; AbstractMethodDeclaration method = methodCount == <NUM_LIT:0> ? null : typeDeclaration . methods [ methodIndex ] ; int methodStart = method == null ? Integer . MAX_VALUE : method . declarationSourceStart ; int typeIndex = <NUM_LIT:0> , typeCount = ( typeDeclaration . memberTypes == null ) ? <NUM_LIT:0> : typeDeclaration . memberTypes . length ; TypeDeclaration type = typeCount == <NUM_LIT:0> ? null : typeDeclaration . memberTypes [ typeIndex ] ; int typeStart = type == null ? Integer . MAX_VALUE : type . declarationSourceStart ; final int memberLength = fieldCount + methodCount + typeCount ; ASTNode [ ] members = new ASTNode [ memberLength ] ; if ( memberLength != <NUM_LIT:0> ) { int index = <NUM_LIT:0> ; int previousFieldStart = - <NUM_LIT:1> ; do { if ( fieldStart < methodStart && fieldStart < typeStart ) { if ( field . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { previousFieldStart = fieldStart ; if ( ++ fieldIndex < fieldCount ) { fieldStart = ( field = typeDeclaration . fields [ fieldIndex ] ) . declarationSourceStart ; } else { fieldStart = Integer . MAX_VALUE ; } continue ; } if ( fieldStart == previousFieldStart ) { ASTNode previousMember = members [ index - <NUM_LIT:1> ] ; if ( previousMember instanceof MultiFieldDeclaration ) { MultiFieldDeclaration multiField = ( MultiFieldDeclaration ) previousMember ; int length = multiField . declarations . length ; System . arraycopy ( multiField . declarations , <NUM_LIT:0> , multiField . declarations = new FieldDeclaration [ length + <NUM_LIT:1> ] , <NUM_LIT:0> , length ) ; multiField . declarations [ length ] = field ; } else { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) previousMember ; final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration ( new FieldDeclaration [ ] { fieldDeclaration , field } ) ; multiFieldDeclaration . annotations = fieldDeclaration . annotations ; members [ index - <NUM_LIT:1> ] = multiFieldDeclaration ; } } else { members [ index ++ ] = field ; } previousFieldStart = fieldStart ; if ( ++ fieldIndex < fieldCount ) { fieldStart = ( field = typeDeclaration . fields [ fieldIndex ] ) . declarationSourceStart ; } else { fieldStart = Integer . MAX_VALUE ; } } else if ( methodStart < fieldStart && methodStart < typeStart ) { if ( ! method . isDefaultConstructor ( ) && ! method . isClinit ( ) ) { members [ index ++ ] = method ; } if ( ++ methodIndex < methodCount ) { methodStart = ( method = typeDeclaration . methods [ methodIndex ] ) . declarationSourceStart ; } else { methodStart = Integer . MAX_VALUE ; } } else { members [ index ++ ] = type ; if ( ++ typeIndex < typeCount ) { typeStart = ( type = typeDeclaration . memberTypes [ typeIndex ] ) . declarationSourceStart ; } else { typeStart = Integer . MAX_VALUE ; } } } while ( ( fieldIndex < fieldCount ) || ( typeIndex < typeCount ) || ( methodIndex < methodCount ) ) ; if ( members . length != index ) { System . arraycopy ( members , <NUM_LIT:0> , members = new ASTNode [ index ] , <NUM_LIT:0> , index ) ; } } return members ; } private boolean dumpBinaryExpression ( BinaryExpression binaryExpression , int operator , BlockScope scope ) { final int numberOfParens = ( binaryExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( binaryExpression , numberOfParens ) ; } BinaryExpressionFragmentBuilder builder = buildFragments ( binaryExpression , scope ) ; final int fragmentsSize = builder . size ( ) ; if ( ( builder . realFragmentsSize ( ) > <NUM_LIT:1> || fragmentsSize > <NUM_LIT:4> ) && numberOfParens == <NUM_LIT:0> ) { this . scribe . printComment ( ) ; Alignment binaryExpressionAlignment = this . scribe . createAlignment ( Alignment . BINARY_EXPRESSION , this . preferences . alignment_for_binary_expression , Alignment . R_OUTERMOST , fragmentsSize , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( binaryExpressionAlignment ) ; boolean ok = false ; ASTNode [ ] fragments = builder . fragments ( ) ; int [ ] operators = builder . operators ( ) ; do { try { for ( int i = <NUM_LIT:0> ; i < fragmentsSize - <NUM_LIT:1> ; i ++ ) { ASTNode fragment = fragments [ i ] ; fragment . traverse ( this , scope ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( this . scribe . lastNumberOfNewLines == <NUM_LIT:1> ) { this . scribe . indentationLevel = binaryExpressionAlignment . breakIndentationLevel ; } if ( this . preferences . wrap_before_binary_operator ) { this . scribe . alignFragment ( binaryExpressionAlignment , i ) ; this . scribe . printNextToken ( operators [ i ] , this . preferences . insert_space_before_binary_operator ) ; } else { this . scribe . printNextToken ( operators [ i ] , this . preferences . insert_space_before_binary_operator ) ; this . scribe . alignFragment ( binaryExpressionAlignment , i ) ; } if ( operators [ i ] == TerminalTokens . TokenNameMINUS && isNextToken ( TerminalTokens . TokenNameMINUS ) ) { this . scribe . space ( ) ; } if ( this . preferences . insert_space_after_binary_operator ) { this . scribe . space ( ) ; } } fragments [ fragmentsSize - <NUM_LIT:1> ] . traverse ( this , scope ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( binaryExpressionAlignment , true ) ; } else { binaryExpression . left . traverse ( this , scope ) ; this . scribe . printNextToken ( operator , this . preferences . insert_space_before_binary_operator ) ; if ( operator == TerminalTokens . TokenNameMINUS && isNextToken ( TerminalTokens . TokenNameMINUS ) ) { this . scribe . space ( ) ; } if ( this . preferences . insert_space_after_binary_operator ) { this . scribe . space ( ) ; } binaryExpression . right . traverse ( this , scope ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( binaryExpression , numberOfParens ) ; } return false ; } private boolean dumpEqualityExpression ( BinaryExpression binaryExpression , int operator , BlockScope scope ) { final int numberOfParens = ( binaryExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( binaryExpression , numberOfParens ) ; } binaryExpression . left . traverse ( this , scope ) ; this . scribe . printNextToken ( operator , this . preferences . insert_space_before_binary_operator ) ; if ( this . preferences . insert_space_after_binary_operator ) { this . scribe . space ( ) ; } binaryExpression . right . traverse ( this , scope ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( binaryExpression , numberOfParens ) ; } return false ; } private final TextEdit failedToFormat ( ) { if ( DEBUG ) { System . out . println ( "<STR_LIT>" + this . scribe . scanner ) ; System . out . println ( this . scribe ) ; } return null ; } private void format ( AbstractMethodDeclaration methodDeclaration , ClassScope scope , boolean isChunkStart , boolean isFirstClassBodyDeclaration ) { if ( isFirstClassBodyDeclaration ) { int newLinesBeforeFirstClassBodyDeclaration = this . preferences . blank_lines_before_first_class_body_declaration ; if ( newLinesBeforeFirstClassBodyDeclaration > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeFirstClassBodyDeclaration ) ; } } else { final int newLineBeforeChunk = isChunkStart ? this . preferences . blank_lines_before_new_chunk : <NUM_LIT:0> ; if ( newLineBeforeChunk > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLineBeforeChunk ) ; } } final int newLinesBeforeMethod = this . preferences . blank_lines_before_method ; if ( newLinesBeforeMethod > <NUM_LIT:0> && ! isFirstClassBodyDeclaration ) { this . scribe . printEmptyLines ( newLinesBeforeMethod ) ; } else if ( this . scribe . line != <NUM_LIT:0> || this . scribe . column != <NUM_LIT:1> ) { this . scribe . printNewLine ( ) ; } methodDeclaration . traverse ( this , scope ) ; } private void format ( FieldDeclaration fieldDeclaration , ASTVisitor visitor , MethodScope scope , boolean isChunkStart , boolean isFirstClassBodyDeclaration ) { if ( isFirstClassBodyDeclaration ) { int newLinesBeforeFirstClassBodyDeclaration = this . preferences . blank_lines_before_first_class_body_declaration ; if ( newLinesBeforeFirstClassBodyDeclaration > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeFirstClassBodyDeclaration ) ; } } else { int newLineBeforeChunk = isChunkStart ? this . preferences . blank_lines_before_new_chunk : <NUM_LIT:0> ; if ( newLineBeforeChunk > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLineBeforeChunk ) ; } final int newLinesBeforeField = this . preferences . blank_lines_before_field ; if ( newLinesBeforeField > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeField ) ; } } Alignment memberAlignment = this . scribe . getMemberAlignment ( ) ; this . scribe . printComment ( ) ; this . scribe . printModifiers ( fieldDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; this . scribe . space ( ) ; fieldDeclaration . type . traverse ( this , scope ) ; this . scribe . alignFragment ( memberAlignment , <NUM_LIT:0> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; int extraDimensions = getDimensions ( ) ; if ( extraDimensions != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < extraDimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } final Expression initialization = fieldDeclaration . initialization ; if ( initialization != null ) { this . scribe . alignFragment ( memberAlignment , <NUM_LIT:1> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameEQUAL , this . preferences . insert_space_before_assignment_operator ) ; if ( this . preferences . insert_space_after_assignment_operator ) { this . scribe . space ( ) ; } Alignment assignmentAlignment = this . scribe . createAlignment ( Alignment . FIELD_DECLARATION_ASSIGNMENT , this . preferences . alignment_for_assignment , Alignment . R_INNERMOST , <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( assignmentAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( assignmentAlignment , <NUM_LIT:0> ) ; initialization . traverse ( this , scope ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( assignmentAlignment , true ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; if ( memberAlignment != null ) { this . scribe . alignFragment ( memberAlignment , <NUM_LIT:2> ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } else { this . scribe . space ( ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } private void format ( ImportReference importRef , boolean isLast ) { this . scribe . printNextToken ( TerminalTokens . TokenNameimport ) ; if ( ! isLast ) this . scribe . blank_lines_between_import_groups = this . preferences . blank_lines_between_import_groups ; this . scribe . space ( ) ; if ( importRef . isStatic ( ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNamestatic ) ; this . scribe . space ( ) ; } if ( ( importRef . bits & ASTNode . OnDemand ) != <NUM_LIT:0> ) { this . scribe . printQualifiedReference ( importRef . sourceEnd , false ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameMULTIPLY ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; } else { this . scribe . printQualifiedReference ( importRef . sourceEnd , false ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; } if ( isLast ) { this . scribe . blank_lines_between_import_groups = - <NUM_LIT:1> ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . IMPORT_TRAILING_COMMENT ) ; } else { this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . NO_TRAILING_COMMENT ) ; this . scribe . blank_lines_between_import_groups = - <NUM_LIT:1> ; } this . scribe . printNewLine ( ) ; } private void format ( MultiFieldDeclaration multiFieldDeclaration , ASTVisitor visitor , MethodScope scope , boolean isChunkStart , boolean isFirstClassBodyDeclaration ) { if ( isFirstClassBodyDeclaration ) { int newLinesBeforeFirstClassBodyDeclaration = this . preferences . blank_lines_before_first_class_body_declaration ; if ( newLinesBeforeFirstClassBodyDeclaration > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeFirstClassBodyDeclaration ) ; } } else { int newLineBeforeChunk = isChunkStart ? this . preferences . blank_lines_before_new_chunk : <NUM_LIT:0> ; if ( newLineBeforeChunk > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLineBeforeChunk ) ; } final int newLinesBeforeField = this . preferences . blank_lines_before_field ; if ( newLinesBeforeField > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeField ) ; } } Alignment fieldAlignment = this . scribe . getMemberAlignment ( ) ; this . scribe . printComment ( ) ; this . scribe . printModifiers ( multiFieldDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; this . scribe . space ( ) ; multiFieldDeclaration . declarations [ <NUM_LIT:0> ] . type . traverse ( this , scope ) ; final int multipleFieldDeclarationsLength = multiFieldDeclaration . declarations . length ; Alignment multiFieldDeclarationsAlignment = this . scribe . createAlignment ( Alignment . MULTIPLE_FIELD , this . preferences . alignment_for_multiple_fields , multipleFieldDeclarationsLength - <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( multiFieldDeclarationsAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> , length = multipleFieldDeclarationsLength ; i < length ; i ++ ) { FieldDeclaration fieldDeclaration = multiFieldDeclaration . declarations [ i ] ; if ( i == <NUM_LIT:0> ) { this . scribe . alignFragment ( fieldAlignment , <NUM_LIT:0> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , false ) ; } int extraDimensions = getDimensions ( ) ; if ( extraDimensions != <NUM_LIT:0> ) { for ( int index = <NUM_LIT:0> ; index < extraDimensions ; index ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } final Expression initialization = fieldDeclaration . initialization ; if ( initialization != null ) { if ( i == <NUM_LIT:0> ) { this . scribe . alignFragment ( fieldAlignment , <NUM_LIT:1> ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameEQUAL , this . preferences . insert_space_before_assignment_operator ) ; if ( this . preferences . insert_space_after_assignment_operator ) { this . scribe . space ( ) ; } initialization . traverse ( this , scope ) ; } if ( i != length - <NUM_LIT:1> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_multiple_field_declarations ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . alignFragment ( multiFieldDeclarationsAlignment , i ) ; if ( this . preferences . insert_space_after_comma_in_multiple_field_declarations ) { this . scribe . space ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . alignFragment ( fieldAlignment , <NUM_LIT:2> ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( multiFieldDeclarationsAlignment , true ) ; } public TextEdit format ( String string , ASTNode [ ] nodes ) { this . scribe . reset ( ) ; long startTime = <NUM_LIT:0> ; if ( DEBUG ) { startTime = System . currentTimeMillis ( ) ; } final char [ ] compilationUnitSource = string . toCharArray ( ) ; this . localScanner . setSource ( compilationUnitSource ) ; this . scribe . resetScanner ( compilationUnitSource ) ; if ( nodes == null ) { return null ; } this . lastLocalDeclarationSourceStart = - <NUM_LIT:1> ; try { formatClassBodyDeclarations ( nodes ) ; } catch ( AbortFormatting e ) { return failedToFormat ( ) ; } if ( DEBUG ) { System . out . println ( "<STR_LIT>" + ( System . currentTimeMillis ( ) - startTime ) ) ; } return this . scribe . getRootEdit ( ) ; } public TextEdit format ( String string , CompilationUnitDeclaration compilationUnitDeclaration ) { this . scribe . reset ( ) ; if ( compilationUnitDeclaration == null || compilationUnitDeclaration . ignoreFurtherInvestigation ) { return failedToFormat ( ) ; } long startTime = <NUM_LIT:0> ; if ( DEBUG ) { startTime = System . currentTimeMillis ( ) ; } final char [ ] compilationUnitSource = string . toCharArray ( ) ; this . localScanner . setSource ( compilationUnitSource ) ; this . scribe . resetScanner ( compilationUnitSource ) ; this . lastLocalDeclarationSourceStart = - <NUM_LIT:1> ; try { compilationUnitDeclaration . traverse ( this , compilationUnitDeclaration . scope ) ; } catch ( AbortFormatting e ) { return failedToFormat ( ) ; } if ( DEBUG ) { System . out . println ( "<STR_LIT>" + ( System . currentTimeMillis ( ) - startTime ) ) ; } return this . scribe . getRootEdit ( ) ; } public TextEdit format ( String string , ConstructorDeclaration constructorDeclaration ) { this . scribe . reset ( ) ; long startTime = <NUM_LIT:0> ; if ( DEBUG ) { startTime = System . currentTimeMillis ( ) ; } final char [ ] compilationUnitSource = string . toCharArray ( ) ; this . localScanner . setSource ( compilationUnitSource ) ; this . scribe . resetScanner ( compilationUnitSource ) ; if ( constructorDeclaration == null ) { return null ; } this . lastLocalDeclarationSourceStart = - <NUM_LIT:1> ; try { ExplicitConstructorCall explicitConstructorCall = constructorDeclaration . constructorCall ; if ( explicitConstructorCall != null && ! explicitConstructorCall . isImplicitSuper ( ) ) { explicitConstructorCall . traverse ( this , null ) ; } Statement [ ] statements = constructorDeclaration . statements ; if ( statements != null ) { formatStatements ( null , statements , false ) ; } if ( hasComments ( ) ) { this . scribe . printNewLine ( ) ; } this . scribe . printComment ( ) ; } catch ( AbortFormatting e ) { return failedToFormat ( ) ; } if ( DEBUG ) { System . out . println ( "<STR_LIT>" + ( System . currentTimeMillis ( ) - startTime ) ) ; } return this . scribe . getRootEdit ( ) ; } public TextEdit format ( String string , Expression expression ) { this . scribe . reset ( ) ; long startTime = <NUM_LIT:0> ; if ( DEBUG ) { startTime = System . currentTimeMillis ( ) ; } final char [ ] compilationUnitSource = string . toCharArray ( ) ; this . localScanner . setSource ( compilationUnitSource ) ; this . scribe . resetScanner ( compilationUnitSource ) ; if ( expression == null ) { return null ; } this . lastLocalDeclarationSourceStart = - <NUM_LIT:1> ; try { expression . traverse ( this , ( BlockScope ) null ) ; this . scribe . printComment ( ) ; } catch ( AbortFormatting e ) { return failedToFormat ( ) ; } if ( DEBUG ) { System . out . println ( "<STR_LIT>" + ( System . currentTimeMillis ( ) - startTime ) ) ; } return this . scribe . getRootEdit ( ) ; } public void formatComment ( int kind , String source , int start , int end , int indentationLevel ) { if ( source == null ) return ; this . scribe . printComment ( kind , source , start , end , indentationLevel ) ; } private void format ( TypeDeclaration typeDeclaration ) { this . scribe . printComment ( ) ; int line = this . scribe . line ; this . scribe . printModifiers ( typeDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; if ( this . scribe . line > line ) { line = this . scribe . line ; } switch ( TypeDeclaration . kind ( typeDeclaration . modifiers ) ) { case TypeDeclaration . CLASS_DECL : this . scribe . printNextToken ( TerminalTokens . TokenNameclass , true ) ; break ; case TypeDeclaration . INTERFACE_DECL : this . scribe . printNextToken ( TerminalTokens . TokenNameinterface , true ) ; break ; case TypeDeclaration . ENUM_DECL : this . scribe . printNextToken ( TerminalTokens . TokenNameenum , true ) ; break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : this . scribe . printNextToken ( TerminalTokens . TokenNameAT , this . preferences . insert_space_before_at_in_annotation_type_declaration ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameinterface , this . preferences . insert_space_after_at_in_annotation_type_declaration ) ; break ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; TypeParameter [ ] typeParameters = typeDeclaration . typeParameters ; if ( typeParameters != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_parameters ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_parameters ) { this . scribe . space ( ) ; } int length = typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeParameters [ i ] . traverse ( this , typeDeclaration . scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_parameters ) ; if ( this . preferences . insert_space_after_comma_in_type_parameters ) { this . scribe . space ( ) ; } } typeParameters [ length - <NUM_LIT:1> ] . traverse ( this , typeDeclaration . scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_parameters ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_parameters ) { this . scribe . space ( ) ; } } final TypeReference superclass = typeDeclaration . superclass ; if ( superclass != null ) { Alignment superclassAlignment = this . scribe . createAlignment ( Alignment . SUPER_CLASS , this . preferences . alignment_for_superclass_in_type_declaration , <NUM_LIT:2> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( superclassAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( superclassAlignment , <NUM_LIT:0> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameextends , true ) ; this . scribe . alignFragment ( superclassAlignment , <NUM_LIT:1> ) ; this . scribe . space ( ) ; superclass . traverse ( this , typeDeclaration . scope ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( superclassAlignment , true ) ; } final TypeReference [ ] superInterfaces = typeDeclaration . superInterfaces ; if ( superInterfaces != null ) { int alignment_for_superinterfaces ; int kind = TypeDeclaration . kind ( typeDeclaration . modifiers ) ; switch ( kind ) { case TypeDeclaration . ENUM_DECL : alignment_for_superinterfaces = this . preferences . alignment_for_superinterfaces_in_enum_declaration ; break ; default : alignment_for_superinterfaces = this . preferences . alignment_for_superinterfaces_in_type_declaration ; break ; } int superInterfaceLength = superInterfaces . length ; Alignment interfaceAlignment = this . scribe . createAlignment ( Alignment . SUPER_INTERFACES , alignment_for_superinterfaces , superInterfaceLength + <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( interfaceAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( interfaceAlignment , <NUM_LIT:0> ) ; if ( kind == TypeDeclaration . INTERFACE_DECL ) { this . scribe . printNextToken ( TerminalTokens . TokenNameextends , true ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameimplements , true ) ; } for ( int i = <NUM_LIT:0> ; i < superInterfaceLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_superinterfaces ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . alignFragment ( interfaceAlignment , i + <NUM_LIT:1> ) ; if ( this . preferences . insert_space_after_comma_in_superinterfaces ) { this . scribe . space ( ) ; } superInterfaces [ i ] . traverse ( this , typeDeclaration . scope ) ; } else { this . scribe . alignFragment ( interfaceAlignment , i + <NUM_LIT:1> ) ; this . scribe . space ( ) ; superInterfaces [ i ] . traverse ( this , typeDeclaration . scope ) ; } } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( interfaceAlignment , true ) ; } String class_declaration_brace ; boolean space_before_opening_brace ; int kind = TypeDeclaration . kind ( typeDeclaration . modifiers ) ; switch ( kind ) { case TypeDeclaration . ENUM_DECL : class_declaration_brace = this . preferences . brace_position_for_enum_declaration ; space_before_opening_brace = this . preferences . insert_space_before_opening_brace_in_enum_declaration ; break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : class_declaration_brace = this . preferences . brace_position_for_annotation_type_declaration ; space_before_opening_brace = this . preferences . insert_space_before_opening_brace_in_annotation_type_declaration ; break ; default : class_declaration_brace = this . preferences . brace_position_for_type_declaration ; space_before_opening_brace = this . preferences . insert_space_before_opening_brace_in_type_declaration ; break ; } formatLeftCurlyBrace ( line , class_declaration_brace ) ; formatTypeOpeningBrace ( class_declaration_brace , space_before_opening_brace , typeDeclaration ) ; boolean indent_body_declarations_compare_to_header ; switch ( kind ) { case TypeDeclaration . ENUM_DECL : indent_body_declarations_compare_to_header = this . preferences . indent_body_declarations_compare_to_enum_declaration_header ; break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : indent_body_declarations_compare_to_header = this . preferences . indent_body_declarations_compare_to_annotation_declaration_header ; break ; default : indent_body_declarations_compare_to_header = this . preferences . indent_body_declarations_compare_to_type_header ; break ; } if ( indent_body_declarations_compare_to_header ) { this . scribe . indent ( ) ; } if ( kind == TypeDeclaration . ENUM_DECL ) { FieldDeclaration [ ] fieldDeclarations = typeDeclaration . fields ; boolean hasConstants = false ; int length = fieldDeclarations != null ? fieldDeclarations . length : <NUM_LIT:0> ; int enumConstantsLength = <NUM_LIT:0> ; if ( fieldDeclarations != null ) { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FieldDeclaration fieldDeclaration = fieldDeclarations [ i ] ; if ( fieldDeclaration . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { enumConstantsLength ++ ; } else { break ; } } hasConstants = enumConstantsLength != <NUM_LIT:0> ; if ( enumConstantsLength > <NUM_LIT:1> ) { Alignment enumConstantsAlignment = this . scribe . createAlignment ( Alignment . ENUM_CONSTANTS , this . preferences . alignment_for_enum_constants , enumConstantsLength , this . scribe . scanner . currentPosition , <NUM_LIT:0> , false ) ; this . scribe . enterAlignment ( enumConstantsAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> ; i < enumConstantsLength ; i ++ ) { this . scribe . alignFragment ( enumConstantsAlignment , i ) ; FieldDeclaration fieldDeclaration = fieldDeclarations [ i ] ; fieldDeclaration . traverse ( this , typeDeclaration . initializerScope ) ; if ( isNextToken ( TerminalTokens . TokenNameCOMMA ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_enum_declarations ) ; if ( this . preferences . insert_space_after_comma_in_enum_declarations ) { this . scribe . space ( ) ; } this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( fieldDeclaration . initialization instanceof QualifiedAllocationExpression ) { this . scribe . printNewLine ( ) ; } } } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( enumConstantsAlignment , true ) ; } else if ( hasConstants ) { FieldDeclaration fieldDeclaration = fieldDeclarations [ <NUM_LIT:0> ] ; fieldDeclaration . traverse ( this , typeDeclaration . initializerScope ) ; if ( isNextToken ( TerminalTokens . TokenNameCOMMA ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_enum_declarations ) ; if ( this . preferences . insert_space_after_comma_in_enum_declarations ) { this . scribe . space ( ) ; } this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( fieldDeclaration . initialization instanceof QualifiedAllocationExpression ) { this . scribe . printNewLine ( ) ; } } } } if ( isNextToken ( TerminalTokens . TokenNameSEMICOLON ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( hasConstants || ( ( enumConstantsLength - length ) != <NUM_LIT:0> ) || typeDeclaration . methods != null || typeDeclaration . memberTypes != null ) { this . scribe . printNewLine ( ) ; } } else if ( hasConstants ) { this . scribe . printNewLine ( ) ; } } formatTypeMembers ( typeDeclaration ) ; if ( indent_body_declarations_compare_to_header ) { this . scribe . unIndent ( ) ; } switch ( kind ) { case TypeDeclaration . ENUM_DECL : if ( this . preferences . insert_new_line_in_empty_enum_declaration ) { this . scribe . printNewLine ( ) ; } break ; case TypeDeclaration . ANNOTATION_TYPE_DECL : if ( this . preferences . insert_new_line_in_empty_annotation_declaration ) { this . scribe . printNewLine ( ) ; } break ; default : if ( this . preferences . insert_new_line_in_empty_type_declaration ) { this . scribe . printNewLine ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( class_declaration_brace . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } if ( hasComments ( ) ) { this . scribe . printNewLine ( ) ; } } private void format ( TypeDeclaration memberTypeDeclaration , ClassScope scope , boolean isChunkStart , boolean isFirstClassBodyDeclaration ) { if ( isFirstClassBodyDeclaration ) { int newLinesBeforeFirstClassBodyDeclaration = this . preferences . blank_lines_before_first_class_body_declaration ; if ( newLinesBeforeFirstClassBodyDeclaration > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeFirstClassBodyDeclaration ) ; } } else { int newLineBeforeChunk = isChunkStart ? this . preferences . blank_lines_before_new_chunk : <NUM_LIT:0> ; if ( newLineBeforeChunk > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLineBeforeChunk ) ; } final int newLinesBeforeMember = this . preferences . blank_lines_before_member_type ; if ( newLinesBeforeMember > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeMember ) ; } } memberTypeDeclaration . traverse ( this , scope ) ; } private void formatAnonymousTypeDeclaration ( TypeDeclaration typeDeclaration ) { String anonymous_type_declaration_brace_position = this . preferences . brace_position_for_anonymous_type_declaration ; formatTypeOpeningBrace ( anonymous_type_declaration_brace_position , this . preferences . insert_space_before_opening_brace_in_anonymous_type_declaration , typeDeclaration ) ; this . scribe . indent ( ) ; formatTypeMembers ( typeDeclaration ) ; this . scribe . unIndent ( ) ; if ( this . preferences . insert_new_line_in_empty_anonymous_type_declaration ) { this . scribe . printNewLine ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; if ( anonymous_type_declaration_brace_position . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } } private void formatBlock ( Block block , BlockScope scope , String block_brace_position , boolean insertSpaceBeforeOpeningBrace ) { formatOpeningBrace ( block_brace_position , insertSpaceBeforeOpeningBrace ) ; final Statement [ ] statements = block . statements ; if ( statements != null ) { this . scribe . printNewLine ( ) ; if ( this . preferences . indent_statements_compare_to_block ) { this . scribe . indent ( ) ; } formatStatements ( scope , statements , true ) ; this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_block ) { this . scribe . unIndent ( ) ; } } else if ( this . preferences . insert_new_line_in_empty_block ) { this . scribe . printNewLine ( ) ; if ( this . preferences . indent_statements_compare_to_block ) { this . scribe . indent ( ) ; } this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_block ) { this . scribe . unIndent ( ) ; } } else { if ( this . preferences . indent_statements_compare_to_block ) { this . scribe . indent ( ) ; } this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_block ) { this . scribe . unIndent ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED . equals ( block_brace_position ) ) { this . scribe . unIndent ( ) ; } } private void formatCascadingMessageSends ( CascadingMethodInvocationFragmentBuilder builder , BlockScope scope ) { int size = builder . size ( ) ; MessageSend [ ] fragments = builder . fragments ( ) ; Expression fragment = fragments [ <NUM_LIT:0> ] . receiver ; int startingPositionInCascade = <NUM_LIT:1> ; if ( ! fragment . isImplicitThis ( ) ) { fragment . traverse ( this , scope ) ; } else { MessageSend currentMessageSend = fragments [ <NUM_LIT:1> ] ; final int numberOfParens = ( currentMessageSend . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( currentMessageSend , numberOfParens ) ; } ASTNode [ ] arguments = currentMessageSend . arguments ; TypeReference [ ] typeArguments = currentMessageSend . typeArguments ; if ( typeArguments != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_arguments ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_arguments ) ; if ( this . preferences . insert_space_after_comma_in_type_arguments ) { this . scribe . space ( ) ; } } typeArguments [ length - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_arguments ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_method_invocation ) ; if ( arguments != null ) { if ( this . preferences . insert_space_after_opening_paren_in_method_invocation ) { this . scribe . space ( ) ; } int argumentLength = arguments . length ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . MESSAGE_ARGUMENTS , this . preferences . alignment_for_arguments_in_method_invocation , Alignment . R_OUTERMOST , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean okForArguments = false ; do { try { for ( int j = <NUM_LIT:0> ; j < argumentLength ; j ++ ) { if ( j > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_method_invocation_arguments ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , j ) ; if ( j > <NUM_LIT:0> && this . preferences . insert_space_after_comma_in_method_invocation_arguments ) { this . scribe . space ( ) ; } arguments [ j ] . traverse ( this , scope ) ; } okForArguments = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! okForArguments ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_method_invocation ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_method_invocation ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( currentMessageSend , numberOfParens ) ; } startingPositionInCascade = <NUM_LIT:2> ; } int tieBreakRule = this . preferences . wrap_outer_expressions_when_nested && size - startingPositionInCascade > <NUM_LIT:2> ? Alignment . R_OUTERMOST : Alignment . R_INNERMOST ; Alignment cascadingMessageSendAlignment = this . scribe . createAlignment ( Alignment . CASCADING_MESSAGE_SEND , this . preferences . alignment_for_selector_in_method_invocation , tieBreakRule , size , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( cascadingMessageSendAlignment ) ; boolean ok = false ; boolean setStartingColumn = true ; switch ( this . preferences . alignment_for_arguments_in_method_invocation & Alignment . SPLIT_MASK ) { case Alignment . M_COMPACT_FIRST_BREAK_SPLIT : case Alignment . M_NEXT_SHIFTED_SPLIT : case Alignment . M_ONE_PER_LINE_SPLIT : setStartingColumn = false ; break ; } do { if ( setStartingColumn ) { cascadingMessageSendAlignment . startingColumn = this . scribe . column ; } try { this . scribe . alignFragment ( cascadingMessageSendAlignment , <NUM_LIT:0> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; for ( int i = startingPositionInCascade ; i < size ; i ++ ) { MessageSend currentMessageSend = fragments [ i ] ; final int numberOfParens = ( currentMessageSend . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( currentMessageSend , numberOfParens ) ; } TypeReference [ ] typeArguments = currentMessageSend . typeArguments ; if ( typeArguments != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_arguments ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } int length = typeArguments . length ; for ( int j = <NUM_LIT:0> ; j < length - <NUM_LIT:1> ; j ++ ) { typeArguments [ j ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_arguments ) ; if ( this . preferences . insert_space_after_comma_in_type_arguments ) { this . scribe . space ( ) ; } } typeArguments [ length - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_arguments ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } } ASTNode [ ] arguments = currentMessageSend . arguments ; this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_method_invocation ) ; if ( arguments != null ) { if ( this . preferences . insert_space_after_opening_paren_in_method_invocation ) { this . scribe . space ( ) ; } int argumentLength = arguments . length ; int alignmentMode = this . preferences . alignment_for_arguments_in_method_invocation ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . MESSAGE_ARGUMENTS , alignmentMode , Alignment . R_OUTERMOST , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean okForArguments = false ; do { switch ( alignmentMode & Alignment . SPLIT_MASK ) { case Alignment . M_COMPACT_SPLIT : case Alignment . M_NEXT_PER_LINE_SPLIT : argumentsAlignment . startingColumn = this . scribe . column ; break ; } try { for ( int j = <NUM_LIT:0> ; j < argumentLength ; j ++ ) { if ( j > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_method_invocation_arguments ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , j ) ; if ( j == <NUM_LIT:0> ) { int fragmentIndentation = argumentsAlignment . fragmentIndentations [ j ] ; if ( ( argumentsAlignment . mode & Alignment . M_INDENT_ON_COLUMN ) != <NUM_LIT:0> && fragmentIndentation > <NUM_LIT:0> ) { this . scribe . indentationLevel = fragmentIndentation ; } } else if ( this . preferences . insert_space_after_comma_in_method_invocation_arguments ) { this . scribe . space ( ) ; } arguments [ j ] . traverse ( this , scope ) ; argumentsAlignment . startingColumn = - <NUM_LIT:1> ; } okForArguments = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! okForArguments ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_method_invocation ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_method_invocation ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( currentMessageSend , numberOfParens ) ; } cascadingMessageSendAlignment . startingColumn = - <NUM_LIT:1> ; if ( i < size - <NUM_LIT:1> ) { this . scribe . alignFragment ( cascadingMessageSendAlignment , i ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; } } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( cascadingMessageSendAlignment , true ) ; } private void formatClassBodyDeclarations ( ASTNode [ ] nodes ) { final int FIELD = <NUM_LIT:1> , METHOD = <NUM_LIT:2> , TYPE = <NUM_LIT:3> ; this . scribe . lastNumberOfNewLines = <NUM_LIT:1> ; ASTNode [ ] mergedNodes = computeMergedMemberDeclarations ( nodes ) ; Alignment memberAlignment = this . scribe . createMemberAlignment ( Alignment . TYPE_MEMBERS , this . preferences . align_type_members_on_columns ? Alignment . M_MULTICOLUMN : Alignment . M_NO_ALIGNMENT , <NUM_LIT:4> , this . scribe . scanner . currentPosition ) ; this . scribe . enterMemberAlignment ( memberAlignment ) ; boolean isChunkStart = false ; boolean ok = false ; int startIndex = <NUM_LIT:0> ; do { try { for ( int i = startIndex , max = mergedNodes . length ; i < max ; i ++ ) { ASTNode member = mergedNodes [ i ] ; if ( member instanceof FieldDeclaration ) { isChunkStart = memberAlignment . checkChunkStart ( FIELD , i , this . scribe . scanner . currentPosition ) ; if ( member instanceof MultiFieldDeclaration ) { MultiFieldDeclaration multiField = ( MultiFieldDeclaration ) member ; format ( multiField , this , null , isChunkStart , i == <NUM_LIT:0> ) ; } else if ( member instanceof Initializer ) { int newLineBeforeChunk = isChunkStart ? this . preferences . blank_lines_before_new_chunk : <NUM_LIT:0> ; if ( newLineBeforeChunk > <NUM_LIT:0> && i != <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLineBeforeChunk ) ; } else if ( i == <NUM_LIT:0> ) { int newLinesBeforeFirstClassBodyDeclaration = this . preferences . blank_lines_before_first_class_body_declaration ; if ( newLinesBeforeFirstClassBodyDeclaration > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeFirstClassBodyDeclaration ) ; } } Initializer initializer = ( Initializer ) member ; initializer . traverse ( this , null ) ; } else { FieldDeclaration field = ( FieldDeclaration ) member ; format ( field , this , null , isChunkStart , i == <NUM_LIT:0> ) ; } } else if ( member instanceof AbstractMethodDeclaration ) { isChunkStart = memberAlignment . checkChunkStart ( METHOD , i , this . scribe . scanner . currentPosition ) ; format ( ( AbstractMethodDeclaration ) member , null , isChunkStart , i == <NUM_LIT:0> ) ; } else { isChunkStart = memberAlignment . checkChunkStart ( TYPE , i , this . scribe . scanner . currentPosition ) ; format ( ( TypeDeclaration ) member , null , isChunkStart , i == <NUM_LIT:0> ) ; } while ( isNextToken ( TerminalTokens . TokenNameSEMICOLON ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } if ( i != max - <NUM_LIT:1> ) { this . scribe . printNewLine ( ) ; } } ok = true ; } catch ( AlignmentException e ) { startIndex = memberAlignment . chunkStartIndex ; this . scribe . redoMemberAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitMemberAlignment ( memberAlignment ) ; if ( hasComments ( ) ) { this . scribe . printNewLine ( ) ; } this . scribe . printComment ( ) ; } private void formatEmptyTypeDeclaration ( boolean isFirst ) { boolean hasSemiColon = isNextToken ( TerminalTokens . TokenNameSEMICOLON ) ; while ( isNextToken ( TerminalTokens . TokenNameSEMICOLON ) ) { this . scribe . printComment ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } if ( hasSemiColon && isFirst ) { this . scribe . printNewLine ( ) ; } } private void formatGuardClauseBlock ( Block block , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACE , this . preferences . insert_space_before_opening_brace_in_block ) ; this . scribe . space ( ) ; final Statement [ ] statements = block . statements ; statements [ <NUM_LIT:0> ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE , true ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } private void formatLeftCurlyBrace ( final int line , final String bracePosition ) { this . scribe . formatBrace = true ; try { this . scribe . printComment ( ) ; if ( DefaultCodeFormatterConstants . NEXT_LINE_ON_WRAP . equals ( bracePosition ) && ( this . scribe . line > line || this . scribe . column >= this . preferences . page_width ) ) { this . scribe . printNewLine ( ) ; } } finally { this . scribe . formatBrace = false ; } } private void formatLocalDeclaration ( LocalDeclaration localDeclaration , BlockScope scope , boolean insertSpaceBeforeComma , boolean insertSpaceAfterComma ) { if ( ! isMultipleLocalDeclaration ( localDeclaration ) ) { if ( localDeclaration . modifiers != NO_MODIFIERS || localDeclaration . annotations != null ) { this . scribe . printComment ( ) ; this . scribe . printModifiers ( localDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_LOCAL_VARIABLE ) ; this . scribe . space ( ) ; } if ( localDeclaration . type != null ) { localDeclaration . type . traverse ( this , scope ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , false ) ; } int extraDimensions = getDimensions ( ) ; if ( extraDimensions != <NUM_LIT:0> ) { for ( int index = <NUM_LIT:0> ; index < extraDimensions ; index ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } final Expression initialization = localDeclaration . initialization ; if ( initialization != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameEQUAL , this . preferences . insert_space_before_assignment_operator ) ; if ( this . preferences . insert_space_after_assignment_operator ) { this . scribe . space ( ) ; } Alignment assignmentAlignment = this . scribe . createAlignment ( Alignment . LOCAL_DECLARATION_ASSIGNMENT , this . preferences . alignment_for_assignment , Alignment . R_OUTERMOST , <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( assignmentAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( assignmentAlignment , <NUM_LIT:0> ) ; initialization . traverse ( this , scope ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( assignmentAlignment , true ) ; } if ( isPartOfMultipleLocalDeclaration ( ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , insertSpaceBeforeComma ) ; if ( insertSpaceAfterComma ) { this . scribe . space ( ) ; } this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } private void formatMessageSend ( MessageSend messageSend , BlockScope scope , Alignment messageAlignment ) { if ( messageAlignment != null ) { if ( ! this . preferences . wrap_outer_expressions_when_nested || messageAlignment . canAlign ( ) ) { this . scribe . alignFragment ( messageAlignment , <NUM_LIT:0> ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; } TypeReference [ ] typeArguments = messageSend . typeArguments ; if ( typeArguments != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_arguments ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_arguments ) ; if ( this . preferences . insert_space_after_comma_in_type_arguments ) { this . scribe . space ( ) ; } } typeArguments [ length - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_arguments ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_method_invocation ) ; final Expression [ ] arguments = messageSend . arguments ; if ( arguments != null ) { if ( this . preferences . insert_space_after_opening_paren_in_method_invocation ) { this . scribe . space ( ) ; } int argumentsLength = arguments . length ; if ( argumentsLength > <NUM_LIT:1> ) { int alignmentMode = this . preferences . alignment_for_arguments_in_method_invocation ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . MESSAGE_ARGUMENTS , alignmentMode , argumentsLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean ok = false ; do { switch ( alignmentMode & Alignment . SPLIT_MASK ) { case Alignment . M_COMPACT_SPLIT : case Alignment . M_NEXT_PER_LINE_SPLIT : argumentsAlignment . startingColumn = this . scribe . column ; break ; } try { for ( int i = <NUM_LIT:0> ; i < argumentsLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_method_invocation_arguments ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , i ) ; if ( i > <NUM_LIT:0> && this . preferences . insert_space_after_comma_in_method_invocation_arguments ) { this . scribe . space ( ) ; } int fragmentIndentation = <NUM_LIT:0> ; if ( i == <NUM_LIT:0> ) { int wrappedIndex = argumentsAlignment . wrappedIndex ( ) ; if ( wrappedIndex >= <NUM_LIT:0> ) { fragmentIndentation = argumentsAlignment . fragmentIndentations [ wrappedIndex ] ; if ( ( argumentsAlignment . mode & Alignment . M_INDENT_ON_COLUMN ) != <NUM_LIT:0> && fragmentIndentation > <NUM_LIT:0> ) { this . scribe . indentationLevel = fragmentIndentation ; } } } arguments [ i ] . traverse ( this , scope ) ; argumentsAlignment . startingColumn = - <NUM_LIT:1> ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; } else { arguments [ <NUM_LIT:0> ] . traverse ( this , scope ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_method_invocation ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_method_invocation ) ; } } private void formatMethodArguments ( AbstractMethodDeclaration methodDeclaration , boolean spaceBeforeOpenParen , boolean spaceBetweenEmptyParameters , boolean spaceBeforeClosingParen , boolean spaceBeforeFirstParameter , boolean spaceBeforeComma , boolean spaceAfterComma , int methodDeclarationParametersAlignment ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , spaceBeforeOpenParen ) ; final Argument [ ] arguments = methodDeclaration . arguments ; if ( arguments != null ) { if ( spaceBeforeFirstParameter ) { this . scribe . space ( ) ; } int argumentLength = arguments . length ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . METHOD_ARGUMENTS , methodDeclarationParametersAlignment , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean ok = false ; do { switch ( methodDeclarationParametersAlignment & Alignment . SPLIT_MASK ) { case Alignment . M_COMPACT_SPLIT : case Alignment . M_NEXT_PER_LINE_SPLIT : argumentsAlignment . startingColumn = this . scribe . column ; break ; } try { for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , spaceBeforeComma ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , i ) ; if ( i == <NUM_LIT:0> ) { int fragmentIndentation = argumentsAlignment . fragmentIndentations [ <NUM_LIT:0> ] ; if ( ( argumentsAlignment . mode & Alignment . M_INDENT_ON_COLUMN ) != <NUM_LIT:0> && fragmentIndentation > <NUM_LIT:0> ) { this . scribe . indentationLevel = fragmentIndentation ; } } else if ( spaceAfterComma ) { this . scribe . space ( ) ; } arguments [ i ] . traverse ( this , methodDeclaration . scope ) ; argumentsAlignment . startingColumn = - <NUM_LIT:1> ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , spaceBeforeClosingParen ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , spaceBetweenEmptyParameters ) ; } } private void formatEnumConstantArguments ( FieldDeclaration enumConstant , boolean spaceBeforeOpenParen , boolean spaceBetweenEmptyParameters , boolean spaceBeforeClosingParen , boolean spaceBeforeFirstParameter , boolean spaceBeforeComma , boolean spaceAfterComma , int methodDeclarationParametersAlignment ) { if ( ! isNextToken ( TerminalTokens . TokenNameLPAREN ) ) { return ; } this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , spaceBeforeOpenParen ) ; final Expression [ ] arguments = ( ( AllocationExpression ) enumConstant . initialization ) . arguments ; if ( arguments != null ) { int argumentLength = arguments . length ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . ENUM_CONSTANTS_ARGUMENTS , methodDeclarationParametersAlignment , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean ok = false ; do { try { if ( spaceBeforeFirstParameter ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , spaceBeforeComma ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , i ) ; if ( i > <NUM_LIT:0> && spaceAfterComma ) { this . scribe . space ( ) ; } arguments [ i ] . traverse ( this , ( BlockScope ) null ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , spaceBeforeClosingParen ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , spaceBetweenEmptyParameters ) ; } } private void formatNecessaryEmptyStatement ( ) { if ( this . preferences . put_empty_statement_on_new_line ) { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . unIndent ( ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } private void formatOpeningBrace ( String bracePosition , boolean insertSpaceBeforeBrace ) { if ( DefaultCodeFormatterConstants . NEXT_LINE . equals ( bracePosition ) ) { this . scribe . printNewLine ( ) ; } else if ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED . equals ( bracePosition ) ) { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACE , insertSpaceBeforeBrace ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . UNMODIFIABLE_TRAILING_COMMENT ) ; } private void formatStatements ( BlockScope scope , final Statement [ ] statements , boolean insertNewLineAfterLastStatement ) { int statementsLength = statements . length ; for ( int i = <NUM_LIT:0> ; i < statementsLength ; i ++ ) { final Statement statement = statements [ i ] ; if ( i > <NUM_LIT:0> && ( statements [ i - <NUM_LIT:1> ] instanceof EmptyStatement ) && ! ( statement instanceof EmptyStatement ) ) { this . scribe . printNewLine ( ) ; } statement . traverse ( this , scope ) ; if ( statement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( i != statementsLength - <NUM_LIT:1> ) { if ( ! ( statement instanceof EmptyStatement ) && ! ( statements [ i + <NUM_LIT:1> ] instanceof EmptyStatement ) ) { this . scribe . printNewLine ( ) ; } } else if ( i == statementsLength - <NUM_LIT:1> && insertNewLineAfterLastStatement ) { this . scribe . printNewLine ( ) ; } } else if ( statement instanceof LocalDeclaration ) { LocalDeclaration currentLocal = ( LocalDeclaration ) statement ; if ( i < ( statementsLength - <NUM_LIT:1> ) ) { if ( statements [ i + <NUM_LIT:1> ] instanceof LocalDeclaration ) { LocalDeclaration nextLocal = ( LocalDeclaration ) statements [ i + <NUM_LIT:1> ] ; if ( currentLocal . declarationSourceStart != nextLocal . declarationSourceStart ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( i != statementsLength - <NUM_LIT:1> ) { if ( ! ( statement instanceof EmptyStatement ) && ! ( statements [ i + <NUM_LIT:1> ] instanceof EmptyStatement ) ) { this . scribe . printNewLine ( ) ; } } else if ( i == statementsLength - <NUM_LIT:1> && insertNewLineAfterLastStatement ) { this . scribe . printNewLine ( ) ; } } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( i != statementsLength - <NUM_LIT:1> ) { if ( ! ( statement instanceof EmptyStatement ) && ! ( statements [ i + <NUM_LIT:1> ] instanceof EmptyStatement ) ) { this . scribe . printNewLine ( ) ; } } else if ( i == statementsLength - <NUM_LIT:1> && insertNewLineAfterLastStatement ) { this . scribe . printNewLine ( ) ; } } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( i != statementsLength - <NUM_LIT:1> ) { if ( ! ( statement instanceof EmptyStatement ) && ! ( statements [ i + <NUM_LIT:1> ] instanceof EmptyStatement ) ) { this . scribe . printNewLine ( ) ; } } else if ( i == statementsLength - <NUM_LIT:1> && insertNewLineAfterLastStatement ) { this . scribe . printNewLine ( ) ; } } } else if ( i != statementsLength - <NUM_LIT:1> ) { if ( ! ( statement instanceof EmptyStatement ) && ! ( statements [ i + <NUM_LIT:1> ] instanceof EmptyStatement ) ) { this . scribe . printNewLine ( ) ; } } else if ( i == statementsLength - <NUM_LIT:1> && insertNewLineAfterLastStatement ) { this . scribe . printNewLine ( ) ; } } } private void formatThrowsClause ( AbstractMethodDeclaration methodDeclaration , boolean spaceBeforeComma , boolean spaceAfterComma , int alignmentForThrowsClause ) { final TypeReference [ ] thrownExceptions = methodDeclaration . thrownExceptions ; if ( thrownExceptions != null ) { int thrownExceptionsLength = thrownExceptions . length ; Alignment throwsAlignment = this . scribe . createAlignment ( Alignment . THROWS , alignmentForThrowsClause , thrownExceptionsLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( throwsAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( throwsAlignment , <NUM_LIT:0> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNamethrows , true ) ; for ( int i = <NUM_LIT:0> ; i < thrownExceptionsLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , spaceBeforeComma ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . alignFragment ( throwsAlignment , i ) ; if ( spaceAfterComma ) { this . scribe . space ( ) ; } } else { this . scribe . space ( ) ; } thrownExceptions [ i ] . traverse ( this , methodDeclaration . scope ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( throwsAlignment , true ) ; } } private void formatTypeMembers ( TypeDeclaration typeDeclaration ) { Alignment memberAlignment = this . scribe . createMemberAlignment ( Alignment . TYPE_MEMBERS , this . preferences . align_type_members_on_columns ? Alignment . M_MULTICOLUMN : Alignment . M_NO_ALIGNMENT , <NUM_LIT:3> , this . scribe . scanner . currentPosition ) ; this . scribe . enterMemberAlignment ( memberAlignment ) ; ASTNode [ ] members = computeMergedMemberDeclarations ( typeDeclaration ) ; boolean isChunkStart = false ; boolean ok = false ; int membersLength = members . length ; if ( membersLength > <NUM_LIT:0> ) { int startIndex = <NUM_LIT:0> ; do { try { for ( int i = startIndex , max = members . length ; i < max ; i ++ ) { ASTNode member = members [ i ] ; if ( member instanceof FieldDeclaration ) { isChunkStart = memberAlignment . checkChunkStart ( Alignment . CHUNK_FIELD , i , this . scribe . scanner . currentPosition ) ; if ( member instanceof MultiFieldDeclaration ) { MultiFieldDeclaration multiField = ( MultiFieldDeclaration ) member ; if ( multiField . isStatic ( ) ) { format ( multiField , this , typeDeclaration . staticInitializerScope , isChunkStart , i == <NUM_LIT:0> ) ; } else { format ( multiField , this , typeDeclaration . initializerScope , isChunkStart , i == <NUM_LIT:0> ) ; } } else if ( member instanceof Initializer ) { int newLineBeforeChunk = isChunkStart ? this . preferences . blank_lines_before_new_chunk : <NUM_LIT:0> ; if ( newLineBeforeChunk > <NUM_LIT:0> && i != <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLineBeforeChunk ) ; } else if ( i == <NUM_LIT:0> ) { int newLinesBeforeFirstClassBodyDeclaration = this . preferences . blank_lines_before_first_class_body_declaration ; if ( newLinesBeforeFirstClassBodyDeclaration > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( newLinesBeforeFirstClassBodyDeclaration ) ; } } Initializer initializer = ( Initializer ) member ; if ( initializer . isStatic ( ) ) { initializer . traverse ( this , typeDeclaration . staticInitializerScope ) ; } else { initializer . traverse ( this , typeDeclaration . initializerScope ) ; } } else { FieldDeclaration field = ( FieldDeclaration ) member ; if ( field . isStatic ( ) ) { format ( field , this , typeDeclaration . staticInitializerScope , isChunkStart , i == <NUM_LIT:0> ) ; } else { format ( field , this , typeDeclaration . initializerScope , isChunkStart , i == <NUM_LIT:0> ) ; } } } else if ( member instanceof AbstractMethodDeclaration ) { isChunkStart = memberAlignment . checkChunkStart ( Alignment . CHUNK_METHOD , i , this . scribe . scanner . currentPosition ) ; format ( ( AbstractMethodDeclaration ) member , typeDeclaration . scope , isChunkStart , i == <NUM_LIT:0> ) ; } else if ( member instanceof TypeDeclaration ) { isChunkStart = memberAlignment . checkChunkStart ( Alignment . CHUNK_TYPE , i , this . scribe . scanner . currentPosition ) ; format ( ( TypeDeclaration ) member , typeDeclaration . scope , isChunkStart , i == <NUM_LIT:0> ) ; } while ( isNextToken ( TerminalTokens . TokenNameSEMICOLON ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . printNewLine ( ) ; if ( this . scribe . memberAlignment != null ) { this . scribe . indentationLevel = this . scribe . memberAlignment . originalIndentationLevel ; } } ok = true ; } catch ( AlignmentException e ) { startIndex = memberAlignment . chunkStartIndex ; this . scribe . redoMemberAlignment ( e ) ; } } while ( ! ok ) ; } else if ( isNextToken ( TerminalTokens . TokenNameSEMICOLON ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . printComment ( ) ; this . scribe . exitMemberAlignment ( memberAlignment ) ; } private void formatTypeOpeningBraceForEnumConstant ( String bracePosition , boolean insertSpaceBeforeBrace , TypeDeclaration typeDeclaration ) { int fieldCount = ( typeDeclaration . fields == null ) ? <NUM_LIT:0> : typeDeclaration . fields . length ; int methodCount = ( typeDeclaration . methods == null ) ? <NUM_LIT:0> : typeDeclaration . methods . length ; int typeCount = ( typeDeclaration . memberTypes == null ) ? <NUM_LIT:0> : typeDeclaration . memberTypes . length ; if ( methodCount <= <NUM_LIT:2> ) { for ( int i = <NUM_LIT:0> , max = methodCount ; i < max ; i ++ ) { final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration . methods [ i ] ; if ( abstractMethodDeclaration . isDefaultConstructor ( ) ) { methodCount -- ; } else if ( abstractMethodDeclaration . isClinit ( ) ) { methodCount -- ; } } } final int memberLength = fieldCount + methodCount + typeCount ; boolean insertNewLine = memberLength > <NUM_LIT:0> ; if ( ! insertNewLine ) { if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { insertNewLine = this . preferences . insert_new_line_in_empty_enum_constant ; } } formatOpeningBrace ( bracePosition , insertSpaceBeforeBrace ) ; if ( insertNewLine ) { this . scribe . printNewLine ( ) ; } } private void formatTypeOpeningBrace ( String bracePosition , boolean insertSpaceBeforeBrace , TypeDeclaration typeDeclaration ) { int fieldCount = ( typeDeclaration . fields == null ) ? <NUM_LIT:0> : typeDeclaration . fields . length ; int methodCount = ( typeDeclaration . methods == null ) ? <NUM_LIT:0> : typeDeclaration . methods . length ; int typeCount = ( typeDeclaration . memberTypes == null ) ? <NUM_LIT:0> : typeDeclaration . memberTypes . length ; if ( methodCount <= <NUM_LIT:2> ) { for ( int i = <NUM_LIT:0> , max = methodCount ; i < max ; i ++ ) { final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration . methods [ i ] ; if ( abstractMethodDeclaration . isDefaultConstructor ( ) ) { methodCount -- ; } else if ( abstractMethodDeclaration . isClinit ( ) ) { methodCount -- ; } } } final int memberLength = fieldCount + methodCount + typeCount ; boolean insertNewLine = memberLength > <NUM_LIT:0> ; if ( ! insertNewLine ) { if ( TypeDeclaration . kind ( typeDeclaration . modifiers ) == TypeDeclaration . ENUM_DECL ) { insertNewLine = this . preferences . insert_new_line_in_empty_enum_declaration ; } else if ( ( typeDeclaration . bits & ASTNode . IsAnonymousType ) != <NUM_LIT:0> ) { insertNewLine = this . preferences . insert_new_line_in_empty_anonymous_type_declaration ; } else if ( TypeDeclaration . kind ( typeDeclaration . modifiers ) == TypeDeclaration . ANNOTATION_TYPE_DECL ) { insertNewLine = this . preferences . insert_new_line_in_empty_annotation_declaration ; } else { insertNewLine = this . preferences . insert_new_line_in_empty_type_declaration ; } } formatOpeningBrace ( bracePosition , insertSpaceBeforeBrace ) ; if ( insertNewLine ) { this . scribe . printNewLine ( ) ; } } private int getDimensions ( ) { this . localScanner . resetTo ( this . scribe . scanner . currentPosition , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; int dimensions = <NUM_LIT:0> ; int balance = <NUM_LIT:0> ; try { int token ; loop : while ( ( token = this . localScanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { switch ( token ) { case TerminalTokens . TokenNameRBRACKET : dimensions ++ ; balance -- ; break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : break ; case TerminalTokens . TokenNameLBRACKET : balance ++ ; break ; default : break loop ; } } } catch ( InvalidInputException e ) { } if ( balance == <NUM_LIT:0> ) { return dimensions ; } return <NUM_LIT:0> ; } private boolean hasComments ( ) { this . localScanner . resetTo ( this . scribe . scanner . startPosition , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; try { switch ( this . localScanner . getNextToken ( ) ) { case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : return true ; } } catch ( InvalidInputException e ) { } return false ; } private boolean isNextToken ( int tokenName ) { this . localScanner . resetTo ( this . scribe . scanner . currentPosition , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; try { int token = this . localScanner . getNextToken ( ) ; loop : while ( true ) { switch ( token ) { case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : token = this . localScanner . getNextToken ( ) ; continue loop ; default : break loop ; } } return token == tokenName ; } catch ( InvalidInputException e ) { } return false ; } private boolean isClosingGenericToken ( ) { this . localScanner . resetTo ( this . scribe . scanner . currentPosition , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; try { int token = this . localScanner . getNextToken ( ) ; loop : while ( true ) { switch ( token ) { case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : token = this . localScanner . getNextToken ( ) ; continue loop ; default : break loop ; } } switch ( token ) { case TerminalTokens . TokenNameGREATER : case TerminalTokens . TokenNameRIGHT_SHIFT : case TerminalTokens . TokenNameUNSIGNED_RIGHT_SHIFT : return true ; } } catch ( InvalidInputException e ) { } return false ; } private boolean isGuardClause ( Block block ) { return ! commentStartsBlock ( block . sourceStart , block . sourceEnd ) && block . statements != null && block . statements . length == <NUM_LIT:1> && ( block . statements [ <NUM_LIT:0> ] instanceof ReturnStatement || block . statements [ <NUM_LIT:0> ] instanceof ThrowStatement ) ; } private boolean isMultipleLocalDeclaration ( LocalDeclaration localDeclaration ) { if ( localDeclaration . declarationSourceStart == this . lastLocalDeclarationSourceStart ) return true ; this . lastLocalDeclarationSourceStart = localDeclaration . declarationSourceStart ; return false ; } private boolean isPartOfMultipleLocalDeclaration ( ) { this . localScanner . resetTo ( this . scribe . scanner . currentPosition , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; try { int token ; while ( ( token = this . localScanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { switch ( token ) { case TerminalTokens . TokenNameCOMMA : return true ; case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : break ; default : return false ; } } } catch ( InvalidInputException e ) { } return false ; } private void manageClosingParenthesizedExpression ( Expression expression , int numberOfParens ) { for ( int i = <NUM_LIT:0> ; i < numberOfParens ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_parenthesized_expression ) ; } } private void manageOpeningParenthesizedExpression ( Expression expression , int numberOfParens ) { for ( int i = <NUM_LIT:0> ; i < numberOfParens ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_parenthesized_expression ) ; if ( this . preferences . insert_space_after_opening_paren_in_parenthesized_expression ) { this . scribe . space ( ) ; } } } private void printComment ( ) { this . localScanner . resetTo ( this . scribe . scanner . startPosition , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; try { int token = this . localScanner . getNextToken ( ) ; switch ( token ) { case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_LINE : this . scribe . printComment ( token , Scribe . NO_TRAILING_COMMENT ) ; break ; } } catch ( InvalidInputException e ) { } } public boolean visit ( AllocationExpression allocationExpression , BlockScope scope ) { final int numberOfParens = ( allocationExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( allocationExpression , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamenew ) ; TypeReference [ ] typeArguments = allocationExpression . typeArguments ; if ( typeArguments != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_arguments ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_arguments ) ; if ( this . preferences . insert_space_after_comma_in_type_arguments ) { this . scribe . space ( ) ; } } typeArguments [ length - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_arguments ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } } else { this . scribe . space ( ) ; } allocationExpression . type . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_method_invocation ) ; final Expression [ ] arguments = allocationExpression . arguments ; if ( arguments != null ) { if ( this . preferences . insert_space_after_opening_paren_in_method_invocation ) { this . scribe . space ( ) ; } int argumentLength = arguments . length ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . ALLOCATION , this . preferences . alignment_for_arguments_in_allocation_expression , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_allocation_expression ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , i ) ; if ( i > <NUM_LIT:0> && this . preferences . insert_space_after_comma_in_allocation_expression ) { this . scribe . space ( ) ; } arguments [ i ] . traverse ( this , scope ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_method_invocation ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_method_invocation ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( allocationExpression , numberOfParens ) ; } return false ; } public boolean visit ( AND_AND_Expression and_and_Expression , BlockScope scope ) { return dumpBinaryExpression ( and_and_Expression , TerminalTokens . TokenNameAND_AND , scope ) ; } public boolean visit ( AnnotationMethodDeclaration annotationTypeMemberDeclaration , ClassScope scope ) { this . scribe . printComment ( ) ; this . scribe . printModifiers ( annotationTypeMemberDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; this . scribe . space ( ) ; final TypeReference returnType = annotationTypeMemberDeclaration . returnType ; final MethodScope annotationTypeMemberDeclarationScope = annotationTypeMemberDeclaration . scope ; if ( returnType != null ) { returnType . traverse ( this , annotationTypeMemberDeclarationScope ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_annotation_type_member_declaration ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_annotation_type_member_declaration ) ; int extraDimensions = annotationTypeMemberDeclaration . extendedDimensions ; if ( extraDimensions != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < extraDimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } Expression defaultValue = annotationTypeMemberDeclaration . defaultValue ; if ( defaultValue != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNamedefault , true ) ; this . scribe . space ( ) ; defaultValue . traverse ( this , ( BlockScope ) null ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( Argument argument , BlockScope scope ) { if ( argument . modifiers != NO_MODIFIERS || argument . annotations != null ) { this . scribe . printComment ( ) ; this . scribe . printModifiers ( argument . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_PARAMETER ) ; this . scribe . space ( ) ; } if ( argument . type != null ) { argument . type . traverse ( this , scope ) ; } if ( argument . isVarArgs ( ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameELLIPSIS , this . preferences . insert_space_before_ellipsis ) ; if ( this . preferences . insert_space_after_ellipsis ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , false ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; } int extraDimensions = getDimensions ( ) ; if ( extraDimensions != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < extraDimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } return false ; } public boolean visit ( ArrayAllocationExpression arrayAllocationExpression , BlockScope scope ) { final int numberOfParens = ( arrayAllocationExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayAllocationExpression , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamenew ) ; this . scribe . space ( ) ; arrayAllocationExpression . type . traverse ( this , scope ) ; final Expression [ ] dimensions = arrayAllocationExpression . dimensions ; int dimensionsLength = dimensions . length ; for ( int i = <NUM_LIT:0> ; i < dimensionsLength ; i ++ ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_allocation_expression ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET , false ) ; if ( dimensions [ i ] != null ) { if ( this . preferences . insert_space_after_opening_bracket_in_array_allocation_expression ) { this . scribe . space ( ) ; } dimensions [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET , this . preferences . insert_space_before_closing_bracket_in_array_allocation_expression ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET , this . preferences . insert_space_between_empty_brackets_in_array_allocation_expression ) ; } } final ArrayInitializer initializer = arrayAllocationExpression . initializer ; if ( initializer != null ) { initializer . traverse ( this , scope ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayAllocationExpression , numberOfParens ) ; } return false ; } public boolean visit ( ArrayInitializer arrayInitializer , BlockScope scope ) { final int numberOfParens = ( arrayInitializer . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayInitializer , numberOfParens ) ; } final Expression [ ] expressions = arrayInitializer . expressions ; if ( expressions != null ) { String array_initializer_brace_position = this . preferences . brace_position_for_array_initializer ; formatOpeningBrace ( array_initializer_brace_position , this . preferences . insert_space_before_opening_brace_in_array_initializer ) ; int expressionsLength = expressions . length ; final boolean insert_new_line_after_opening_brace = this . preferences . insert_new_line_after_opening_brace_in_array_initializer ; if ( expressionsLength > <NUM_LIT:1> ) { if ( insert_new_line_after_opening_brace ) { this . scribe . printNewLine ( ) ; } Alignment arrayInitializerAlignment = this . scribe . createAlignment ( Alignment . ARRAY_INITIALIZER , this . preferences . alignment_for_expressions_in_array_initializer , Alignment . R_OUTERMOST , expressionsLength , this . scribe . scanner . currentPosition , this . preferences . continuation_indentation_for_array_initializer , true ) ; if ( insert_new_line_after_opening_brace ) { arrayInitializerAlignment . fragmentIndentations [ <NUM_LIT:0> ] = arrayInitializerAlignment . breakIndentationLevel ; } this . scribe . enterAlignment ( arrayInitializerAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( arrayInitializerAlignment , <NUM_LIT:0> ) ; if ( this . preferences . insert_space_after_opening_brace_in_array_initializer ) { this . scribe . space ( ) ; } expressions [ <NUM_LIT:0> ] . traverse ( this , scope ) ; for ( int i = <NUM_LIT:1> ; i < expressionsLength ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_array_initializer ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . alignFragment ( arrayInitializerAlignment , i ) ; if ( this . preferences . insert_space_after_comma_in_array_initializer ) { this . scribe . space ( ) ; } expressions [ i ] . traverse ( this , scope ) ; if ( i == expressionsLength - <NUM_LIT:1> ) { if ( isNextToken ( TerminalTokens . TokenNameCOMMA ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_array_initializer ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( arrayInitializerAlignment , true ) ; } else { if ( insert_new_line_after_opening_brace ) { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; } if ( this . preferences . insert_space_after_opening_brace_in_array_initializer ) { this . scribe . space ( ) ; } else { this . scribe . needSpace = false ; } expressions [ <NUM_LIT:0> ] . traverse ( this , scope ) ; if ( isNextToken ( TerminalTokens . TokenNameCOMMA ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_array_initializer ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } if ( insert_new_line_after_opening_brace ) { this . scribe . unIndent ( ) ; } } if ( this . preferences . insert_new_line_before_closing_brace_in_array_initializer ) { this . scribe . printNewLine ( ) ; } else if ( this . preferences . insert_space_before_closing_brace_in_array_initializer ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE , false ) ; if ( array_initializer_brace_position . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } } else { boolean keepEmptyArrayInitializerOnTheSameLine = this . preferences . keep_empty_array_initializer_on_one_line ; String array_initializer_brace_position = this . preferences . brace_position_for_array_initializer ; if ( keepEmptyArrayInitializerOnTheSameLine ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACE , this . preferences . insert_space_before_opening_brace_in_array_initializer ) ; if ( isNextToken ( TerminalTokens . TokenNameCOMMA ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_array_initializer ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE , this . preferences . insert_space_between_empty_braces_in_array_initializer ) ; } else { formatOpeningBrace ( array_initializer_brace_position , this . preferences . insert_space_before_opening_brace_in_array_initializer ) ; if ( isNextToken ( TerminalTokens . TokenNameCOMMA ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_array_initializer ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE , this . preferences . insert_space_between_empty_braces_in_array_initializer ) ; if ( array_initializer_brace_position . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayInitializer , numberOfParens ) ; } return false ; } public boolean visit ( ArrayQualifiedTypeReference arrayQualifiedTypeReference , BlockScope scope ) { final int numberOfParens = ( arrayQualifiedTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayQualifiedTypeReference , numberOfParens ) ; } this . scribe . printArrayQualifiedReference ( arrayQualifiedTypeReference . tokens . length , arrayQualifiedTypeReference . sourceEnd ) ; int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayQualifiedTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ArrayQualifiedTypeReference arrayQualifiedTypeReference , ClassScope scope ) { final int numberOfParens = ( arrayQualifiedTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayQualifiedTypeReference , numberOfParens ) ; } this . scribe . printArrayQualifiedReference ( arrayQualifiedTypeReference . tokens . length , arrayQualifiedTypeReference . sourceEnd ) ; int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayQualifiedTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ArrayReference arrayReference , BlockScope scope ) { final int numberOfParens = ( arrayReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayReference , numberOfParens ) ; } arrayReference . receiver . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET , this . preferences . insert_space_before_opening_bracket_in_array_reference ) ; if ( this . preferences . insert_space_after_opening_bracket_in_array_reference ) { this . scribe . space ( ) ; } arrayReference . position . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET , this . preferences . insert_space_before_closing_bracket_in_array_reference ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayReference , numberOfParens ) ; } return false ; } public boolean visit ( ArrayTypeReference arrayTypeReference , BlockScope scope ) { final int numberOfParens = ( arrayTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayTypeReference , numberOfParens ) ; } this . scribe . printNextToken ( SINGLETYPEREFERENCE_EXPECTEDTOKENS ) ; int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_type_reference ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; if ( this . preferences . insert_space_between_brackets_in_array_type_reference ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ArrayTypeReference arrayTypeReference , ClassScope scope ) { final int numberOfParens = ( arrayTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( arrayTypeReference , numberOfParens ) ; } this . scribe . printNextToken ( SINGLETYPEREFERENCE_EXPECTEDTOKENS ) ; int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_type_reference ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; if ( this . preferences . insert_space_between_brackets_in_array_type_reference ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( arrayTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( AssertStatement assertStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameassert ) ; this . scribe . space ( ) ; assertStatement . assertExpression . traverse ( this , scope ) ; if ( assertStatement . exceptionArgument != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOLON , this . preferences . insert_space_before_colon_in_assert ) ; if ( this . preferences . insert_space_after_colon_in_assert ) { this . scribe . space ( ) ; } assertStatement . exceptionArgument . traverse ( this , scope ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( Assignment assignment , BlockScope scope ) { final int numberOfParens = ( assignment . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( assignment , numberOfParens ) ; } assignment . lhs . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameEQUAL , this . preferences . insert_space_before_assignment_operator ) ; if ( this . preferences . insert_space_after_assignment_operator ) { this . scribe . space ( ) ; } Alignment assignmentAlignment = this . scribe . createAlignment ( Alignment . ASSIGNMENT , this . preferences . alignment_for_assignment , Alignment . R_OUTERMOST , <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( assignmentAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( assignmentAlignment , <NUM_LIT:0> ) ; assignment . expression . traverse ( this , scope ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( assignmentAlignment , true ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( assignment , numberOfParens ) ; } return false ; } public boolean visit ( BinaryExpression binaryExpression , BlockScope scope ) { switch ( ( binaryExpression . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) { case OperatorIds . AND : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameAND , scope ) ; case OperatorIds . DIVIDE : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameDIVIDE , scope ) ; case OperatorIds . GREATER : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameGREATER , scope ) ; case OperatorIds . GREATER_EQUAL : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameGREATER_EQUAL , scope ) ; case OperatorIds . LEFT_SHIFT : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameLEFT_SHIFT , scope ) ; case OperatorIds . LESS : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameLESS , scope ) ; case OperatorIds . LESS_EQUAL : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameLESS_EQUAL , scope ) ; case OperatorIds . MINUS : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameMINUS , scope ) ; case OperatorIds . MULTIPLY : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameMULTIPLY , scope ) ; case OperatorIds . OR : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameOR , scope ) ; case OperatorIds . PLUS : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNamePLUS , scope ) ; case OperatorIds . REMAINDER : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameREMAINDER , scope ) ; case OperatorIds . RIGHT_SHIFT : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameRIGHT_SHIFT , scope ) ; case OperatorIds . UNSIGNED_RIGHT_SHIFT : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameUNSIGNED_RIGHT_SHIFT , scope ) ; case OperatorIds . XOR : return dumpBinaryExpression ( binaryExpression , TerminalTokens . TokenNameXOR , scope ) ; default : throw new IllegalStateException ( ) ; } } public boolean visit ( Block block , BlockScope scope ) { formatBlock ( block , scope , this . preferences . brace_position_for_block , this . preferences . insert_space_before_opening_brace_in_block ) ; return false ; } public boolean visit ( BreakStatement breakStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamebreak ) ; if ( breakStatement . label != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( CaseStatement caseStatement , BlockScope scope ) { if ( caseStatement . constantExpression == null ) { this . scribe . printNextToken ( TerminalTokens . TokenNamedefault ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOLON , this . preferences . insert_space_before_colon_in_default ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNamecase ) ; this . scribe . space ( ) ; caseStatement . constantExpression . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOLON , this . preferences . insert_space_before_colon_in_case ) ; } return false ; } public boolean visit ( CastExpression castExpression , BlockScope scope ) { final int numberOfParens = ( castExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( castExpression , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN ) ; if ( this . preferences . insert_space_after_opening_paren_in_cast ) { this . scribe . space ( ) ; } castExpression . type . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_cast ) ; if ( this . preferences . insert_space_after_closing_paren_in_cast ) { this . scribe . space ( ) ; } castExpression . expression . traverse ( this , scope ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( castExpression , numberOfParens ) ; } return false ; } public boolean visit ( CharLiteral charLiteral , BlockScope scope ) { final int numberOfParens = ( charLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( charLiteral , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameCharacterLiteral ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( charLiteral , numberOfParens ) ; } return false ; } public boolean visit ( ClassLiteralAccess classLiteral , BlockScope scope ) { final int numberOfParens = ( classLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( classLiteral , numberOfParens ) ; } classLiteral . type . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameclass ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( classLiteral , numberOfParens ) ; } return false ; } public boolean visit ( Clinit clinit , ClassScope scope ) { return false ; } public boolean visit ( CompilationUnitDeclaration compilationUnitDeclaration , CompilationUnitScope scope ) { this . scribe . lastNumberOfNewLines = <NUM_LIT:1> ; final TypeDeclaration [ ] types = compilationUnitDeclaration . types ; int headerEndPosition = types == null ? compilationUnitDeclaration . sourceEnd : types [ <NUM_LIT:0> ] . declarationSourceStart ; this . scribe . setHeaderComment ( headerEndPosition ) ; ImportReference currentPackage = compilationUnitDeclaration . currentPackage ; final boolean hasPackage = currentPackage != null ; if ( hasPackage ) { printComment ( ) ; int blankLinesBeforePackage = this . preferences . blank_lines_before_package ; if ( blankLinesBeforePackage > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( blankLinesBeforePackage ) ; } this . scribe . printModifiers ( currentPackage . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; this . scribe . space ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNamepackage ) ; this . scribe . space ( ) ; this . scribe . printQualifiedReference ( compilationUnitDeclaration . currentPackage . sourceEnd , false ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; int blankLinesAfterPackage = this . preferences . blank_lines_after_package ; if ( blankLinesAfterPackage > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( blankLinesAfterPackage ) ; } else { this . scribe . printNewLine ( ) ; } } else { this . scribe . printComment ( ) ; } final ImportReference [ ] imports = compilationUnitDeclaration . imports ; if ( imports != null ) { if ( hasPackage ) { int blankLinesBeforeImports = this . preferences . blank_lines_before_imports ; if ( blankLinesBeforeImports > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( blankLinesBeforeImports ) ; } } int importLength = imports . length ; if ( importLength != <NUM_LIT:1> ) { format ( imports [ <NUM_LIT:0> ] , false ) ; for ( int i = <NUM_LIT:1> ; i < importLength - <NUM_LIT:1> ; i ++ ) { format ( imports [ i ] , false ) ; } format ( imports [ importLength - <NUM_LIT:1> ] , true ) ; } else { format ( imports [ <NUM_LIT:0> ] , true ) ; } int blankLinesAfterImports = this . preferences . blank_lines_after_imports ; if ( blankLinesAfterImports > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( blankLinesAfterImports ) ; } } formatEmptyTypeDeclaration ( true ) ; int blankLineBetweenTypeDeclarations = this . preferences . blank_lines_between_type_declarations ; if ( types != null ) { int typesLength = types . length ; for ( int i = <NUM_LIT:0> ; i < typesLength - <NUM_LIT:1> ; i ++ ) { types [ i ] . traverse ( this , scope ) ; formatEmptyTypeDeclaration ( false ) ; if ( blankLineBetweenTypeDeclarations != <NUM_LIT:0> ) { this . scribe . printEmptyLines ( blankLineBetweenTypeDeclarations ) ; } else { this . scribe . printNewLine ( ) ; } } types [ typesLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; } this . scribe . printEndOfCompilationUnit ( ) ; return false ; } public boolean visit ( CompoundAssignment compoundAssignment , BlockScope scope ) { final int numberOfParens = ( compoundAssignment . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( compoundAssignment , numberOfParens ) ; } compoundAssignment . lhs . traverse ( this , scope ) ; int operator ; switch ( compoundAssignment . operator ) { case OperatorIds . PLUS : operator = TerminalTokens . TokenNamePLUS_EQUAL ; break ; case OperatorIds . MINUS : operator = TerminalTokens . TokenNameMINUS_EQUAL ; break ; case OperatorIds . MULTIPLY : operator = TerminalTokens . TokenNameMULTIPLY_EQUAL ; break ; case OperatorIds . DIVIDE : operator = TerminalTokens . TokenNameDIVIDE_EQUAL ; break ; case OperatorIds . AND : operator = TerminalTokens . TokenNameAND_EQUAL ; break ; case OperatorIds . OR : operator = TerminalTokens . TokenNameOR_EQUAL ; break ; case OperatorIds . XOR : operator = TerminalTokens . TokenNameXOR_EQUAL ; break ; case OperatorIds . REMAINDER : operator = TerminalTokens . TokenNameREMAINDER_EQUAL ; break ; case OperatorIds . LEFT_SHIFT : operator = TerminalTokens . TokenNameLEFT_SHIFT_EQUAL ; break ; case OperatorIds . RIGHT_SHIFT : operator = TerminalTokens . TokenNameRIGHT_SHIFT_EQUAL ; break ; default : operator = TerminalTokens . TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL ; } this . scribe . printNextToken ( operator , this . preferences . insert_space_before_assignment_operator ) ; if ( this . preferences . insert_space_after_assignment_operator ) { this . scribe . space ( ) ; } Alignment assignmentAlignment = this . scribe . createAlignment ( Alignment . COMPOUND_ASSIGNMENT , this . preferences . alignment_for_assignment , Alignment . R_OUTERMOST , <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( assignmentAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( assignmentAlignment , <NUM_LIT:0> ) ; compoundAssignment . expression . traverse ( this , scope ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( assignmentAlignment , true ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( compoundAssignment , numberOfParens ) ; } return false ; } public boolean visit ( ConditionalExpression conditionalExpression , BlockScope scope ) { final int numberOfParens = ( conditionalExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( conditionalExpression , numberOfParens ) ; } conditionalExpression . condition . traverse ( this , scope ) ; Alignment conditionalExpressionAlignment = this . scribe . createAlignment ( Alignment . CONDITIONAL_EXPRESSION , this . preferences . alignment_for_conditional_expression , <NUM_LIT:2> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( conditionalExpressionAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( conditionalExpressionAlignment , <NUM_LIT:0> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameQUESTION , this . preferences . insert_space_before_question_in_conditional ) ; if ( this . preferences . insert_space_after_question_in_conditional ) { this . scribe . space ( ) ; } conditionalExpression . valueIfTrue . traverse ( this , scope ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . alignFragment ( conditionalExpressionAlignment , <NUM_LIT:1> ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOLON , this . preferences . insert_space_before_colon_in_conditional ) ; if ( this . preferences . insert_space_after_colon_in_conditional ) { this . scribe . space ( ) ; } conditionalExpression . valueIfFalse . traverse ( this , scope ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( conditionalExpressionAlignment , true ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( conditionalExpression , numberOfParens ) ; } return false ; } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { if ( constructorDeclaration . ignoreFurtherInvestigation ) { this . scribe . printComment ( ) ; if ( this . scribe . indentationLevel != <NUM_LIT:0> ) { this . scribe . printIndentationIfNecessary ( ) ; } this . scribe . scanner . resetTo ( constructorDeclaration . declarationSourceEnd + <NUM_LIT:1> , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; switch ( this . scribe . scanner . source [ this . scribe . scanner . currentPosition ] ) { case '<STR_LIT:\n>' : this . scribe . scanner . currentPosition ++ ; this . scribe . lastNumberOfNewLines = <NUM_LIT:1> ; break ; case '<STR_LIT>' : this . scribe . scanner . currentPosition ++ ; if ( this . scribe . scanner . source [ this . scribe . scanner . currentPosition ] == '<STR_LIT:\n>' ) { this . scribe . scanner . currentPosition ++ ; } this . scribe . lastNumberOfNewLines = <NUM_LIT:1> ; } return false ; } this . scribe . printComment ( ) ; int line = this . scribe . line ; this . scribe . printModifiers ( constructorDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; if ( this . scribe . line > line ) { line = this . scribe . line ; } this . scribe . space ( ) ; TypeParameter [ ] typeParameters = constructorDeclaration . typeParameters ; if ( typeParameters != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_parameters ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_parameters ) { this . scribe . space ( ) ; } int length = typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeParameters [ i ] . traverse ( this , constructorDeclaration . scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_parameters ) ; if ( this . preferences . insert_space_after_comma_in_type_parameters ) { this . scribe . space ( ) ; } } typeParameters [ length - <NUM_LIT:1> ] . traverse ( this , constructorDeclaration . scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_parameters ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_parameters ) { this . scribe . space ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; formatMethodArguments ( constructorDeclaration , this . preferences . insert_space_before_opening_paren_in_constructor_declaration , this . preferences . insert_space_between_empty_parens_in_constructor_declaration , this . preferences . insert_space_before_closing_paren_in_constructor_declaration , this . preferences . insert_space_after_opening_paren_in_constructor_declaration , this . preferences . insert_space_before_comma_in_constructor_declaration_parameters , this . preferences . insert_space_after_comma_in_constructor_declaration_parameters , this . preferences . alignment_for_parameters_in_constructor_declaration ) ; formatThrowsClause ( constructorDeclaration , this . preferences . insert_space_before_comma_in_constructor_declaration_throws , this . preferences . insert_space_after_comma_in_constructor_declaration_throws , this . preferences . alignment_for_throws_clause_in_constructor_declaration ) ; if ( ! constructorDeclaration . isNative ( ) && ! constructorDeclaration . isAbstract ( ) ) { String constructor_declaration_brace = this . preferences . brace_position_for_constructor_declaration ; formatLeftCurlyBrace ( line , constructor_declaration_brace ) ; formatOpeningBrace ( constructor_declaration_brace , this . preferences . insert_space_before_opening_brace_in_constructor_declaration ) ; final int numberOfBlankLinesAtBeginningOfMethodBody = this . preferences . blank_lines_at_beginning_of_method_body ; if ( numberOfBlankLinesAtBeginningOfMethodBody > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( numberOfBlankLinesAtBeginningOfMethodBody ) ; } if ( constructorDeclaration . constructorCall != null && ! constructorDeclaration . constructorCall . isImplicitSuper ( ) ) { this . scribe . printNewLine ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . indent ( ) ; } constructorDeclaration . constructorCall . traverse ( this , constructorDeclaration . scope ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . unIndent ( ) ; } } final Statement [ ] statements = constructorDeclaration . statements ; if ( statements != null ) { this . scribe . printNewLine ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . indent ( ) ; } formatStatements ( constructorDeclaration . scope , statements , true ) ; this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . unIndent ( ) ; } } else { if ( this . preferences . insert_new_line_in_empty_method_body ) { this . scribe . printNewLine ( ) ; } if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . indent ( ) ; } this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . unIndent ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( constructor_declaration_brace . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } return false ; } public boolean visit ( ContinueStatement continueStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamecontinue ) ; if ( continueStatement . label != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( DoStatement doStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamedo ) ; final int line = this . scribe . line ; final Statement action = doStatement . action ; if ( action != null ) { if ( action instanceof Block ) { formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; action . traverse ( this , scope ) ; } else if ( action instanceof EmptyStatement ) { formatNecessaryEmptyStatement ( ) ; } else { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; action . traverse ( this , scope ) ; if ( action instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . printNewLine ( ) ; this . scribe . unIndent ( ) ; } } else { formatNecessaryEmptyStatement ( ) ; } if ( this . preferences . insert_new_line_before_while_in_do_statement ) { this . scribe . printNewLine ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamewhile , this . preferences . insert_space_after_closing_brace_in_block ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_while ) ; if ( this . preferences . insert_space_after_opening_paren_in_while ) { this . scribe . space ( ) ; } doStatement . condition . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_while ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( DoubleLiteral doubleLiteral , BlockScope scope ) { final int numberOfParens = ( doubleLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( doubleLiteral , numberOfParens ) ; } Constant constant = doubleLiteral . constant ; if ( constant != null && constant . doubleValue ( ) < <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameMINUS ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameDoubleLiteral ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( doubleLiteral , numberOfParens ) ; } return false ; } public boolean visit ( EmptyStatement statement , BlockScope scope ) { if ( this . preferences . put_empty_statement_on_new_line ) { this . scribe . printNewLine ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( FieldDeclaration enumConstant , MethodScope scope ) { this . scribe . printComment ( ) ; final int line = this . scribe . line ; this . scribe . printModifiers ( enumConstant . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , false ) ; formatEnumConstantArguments ( enumConstant , this . preferences . insert_space_before_opening_paren_in_enum_constant , this . preferences . insert_space_between_empty_parens_in_enum_constant , this . preferences . insert_space_before_closing_paren_in_enum_constant , this . preferences . insert_space_after_opening_paren_in_enum_constant , this . preferences . insert_space_before_comma_in_enum_constant_arguments , this . preferences . insert_space_after_comma_in_enum_constant_arguments , this . preferences . alignment_for_arguments_in_enum_constant ) ; Expression initialization = enumConstant . initialization ; if ( initialization instanceof QualifiedAllocationExpression ) { TypeDeclaration typeDeclaration = ( ( QualifiedAllocationExpression ) initialization ) . anonymousType ; int fieldsCount = typeDeclaration . fields == null ? <NUM_LIT:0> : typeDeclaration . fields . length ; int methodsCount = typeDeclaration . methods == null ? <NUM_LIT:0> : typeDeclaration . methods . length ; int membersCount = typeDeclaration . memberTypes == null ? <NUM_LIT:0> : typeDeclaration . memberTypes . length ; String enum_constant_brace = this . preferences . brace_position_for_enum_constant ; formatLeftCurlyBrace ( line , enum_constant_brace ) ; formatTypeOpeningBraceForEnumConstant ( enum_constant_brace , this . preferences . insert_space_before_opening_brace_in_enum_constant , typeDeclaration ) ; if ( this . preferences . indent_body_declarations_compare_to_enum_constant_header ) { this . scribe . indent ( ) ; } if ( fieldsCount != <NUM_LIT:0> || methodsCount != <NUM_LIT:0> || membersCount != <NUM_LIT:0> ) { formatTypeMembers ( typeDeclaration ) ; } if ( this . preferences . indent_body_declarations_compare_to_enum_constant_header ) { this . scribe . unIndent ( ) ; } if ( this . preferences . insert_new_line_in_empty_enum_constant ) { this . scribe . printNewLine ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( enum_constant_brace . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } if ( hasComments ( ) ) { this . scribe . printNewLine ( ) ; } } return false ; } public boolean visit ( EqualExpression equalExpression , BlockScope scope ) { if ( ( equalExpression . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT == OperatorIds . EQUAL_EQUAL ) { return dumpEqualityExpression ( equalExpression , TerminalTokens . TokenNameEQUAL_EQUAL , scope ) ; } else { return dumpEqualityExpression ( equalExpression , TerminalTokens . TokenNameNOT_EQUAL , scope ) ; } } public boolean visit ( ExplicitConstructorCall explicitConstructor , BlockScope scope ) { if ( explicitConstructor . isImplicitSuper ( ) ) { return false ; } final Expression qualification = explicitConstructor . qualification ; if ( qualification != null ) { qualification . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; } TypeReference [ ] typeArguments = explicitConstructor . typeArguments ; if ( typeArguments != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_arguments ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_arguments ) ; if ( this . preferences . insert_space_after_comma_in_type_arguments ) { this . scribe . space ( ) ; } } typeArguments [ length - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_arguments ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } } if ( explicitConstructor . isSuperAccess ( ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNamesuper ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNamethis ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_method_invocation ) ; final Expression [ ] arguments = explicitConstructor . arguments ; if ( arguments != null ) { if ( this . preferences . insert_space_after_opening_paren_in_method_invocation ) { this . scribe . space ( ) ; } int argumentLength = arguments . length ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . EXPLICIT_CONSTRUCTOR_CALL , this . preferences . alignment_for_arguments_in_explicit_constructor_call , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_explicit_constructor_call_arguments ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , i ) ; if ( i > <NUM_LIT:0> && this . preferences . insert_space_after_comma_in_explicit_constructor_call_arguments ) { this . scribe . space ( ) ; } arguments [ i ] . traverse ( this , scope ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_method_invocation ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_method_invocation ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( FalseLiteral falseLiteral , BlockScope scope ) { final int numberOfParens = ( falseLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( falseLiteral , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamefalse ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( falseLiteral , numberOfParens ) ; } return false ; } public boolean visit ( FieldReference fieldReference , BlockScope scope ) { final int numberOfParens = ( fieldReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( fieldReference , numberOfParens ) ; } fieldReference . receiver . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( fieldReference , numberOfParens ) ; } return false ; } public boolean visit ( FloatLiteral floatLiteral , BlockScope scope ) { final int numberOfParens = ( floatLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( floatLiteral , numberOfParens ) ; } Constant constant = floatLiteral . constant ; if ( constant != null && floatLiteral . constant . floatValue ( ) < <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameMINUS ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameFloatingPointLiteral ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( floatLiteral , numberOfParens ) ; } return false ; } public boolean visit ( ForeachStatement forStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamefor ) ; final int line = this . scribe . line ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_for ) ; if ( this . preferences . insert_space_after_opening_paren_in_for ) { this . scribe . space ( ) ; } formatLocalDeclaration ( forStatement . elementVariable , scope , false , false ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOLON , this . preferences . insert_space_before_colon_in_for ) ; if ( this . preferences . insert_space_after_colon_in_for ) { this . scribe . space ( ) ; } forStatement . collection . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_for ) ; final Statement action = forStatement . action ; if ( action != null ) { if ( action instanceof Block ) { formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; action . traverse ( this , scope ) ; } else if ( action instanceof EmptyStatement ) { formatNecessaryEmptyStatement ( ) ; } else { this . scribe . indent ( ) ; this . scribe . printNewLine ( ) ; action . traverse ( this , scope ) ; this . scribe . unIndent ( ) ; } if ( action instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } else { formatNecessaryEmptyStatement ( ) ; } return false ; } public boolean visit ( ForStatement forStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamefor ) ; final int line = this . scribe . line ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_for ) ; if ( this . preferences . insert_space_after_opening_paren_in_for ) { this . scribe . space ( ) ; } final Statement [ ] initializations = forStatement . initializations ; if ( initializations != null ) { int length = initializations . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( initializations [ i ] instanceof LocalDeclaration ) { formatLocalDeclaration ( ( LocalDeclaration ) initializations [ i ] , scope , this . preferences . insert_space_before_comma_in_for_inits , this . preferences . insert_space_after_comma_in_for_inits ) ; } else { initializations [ i ] . traverse ( this , scope ) ; if ( i >= <NUM_LIT:0> && ( i < length - <NUM_LIT:1> ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_for_inits ) ; if ( this . preferences . insert_space_after_comma_in_for_inits ) { this . scribe . space ( ) ; } this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } } } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon_in_for ) ; final Expression condition = forStatement . condition ; if ( condition != null ) { if ( this . preferences . insert_space_after_semicolon_in_for ) { this . scribe . space ( ) ; } condition . traverse ( this , scope ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon_in_for ) ; final Statement [ ] increments = forStatement . increments ; if ( increments != null ) { if ( this . preferences . insert_space_after_semicolon_in_for ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> , length = increments . length ; i < length ; i ++ ) { increments [ i ] . traverse ( this , scope ) ; if ( i != length - <NUM_LIT:1> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_for_increments ) ; if ( this . preferences . insert_space_after_comma_in_for_increments ) { this . scribe . space ( ) ; } this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } } this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_for ) ; final Statement action = forStatement . action ; if ( action != null ) { if ( action instanceof Block ) { formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; action . traverse ( this , scope ) ; } else if ( action instanceof EmptyStatement ) { formatNecessaryEmptyStatement ( ) ; } else { this . scribe . indent ( ) ; this . scribe . printNewLine ( ) ; action . traverse ( this , scope ) ; this . scribe . unIndent ( ) ; } if ( action instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } else { formatNecessaryEmptyStatement ( ) ; } return false ; } public boolean visit ( IfStatement ifStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameif ) ; final int line = this . scribe . line ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_if ) ; if ( this . preferences . insert_space_after_opening_paren_in_if ) { this . scribe . space ( ) ; } ifStatement . condition . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_if ) ; final Statement thenStatement = ifStatement . thenStatement ; final Statement elseStatement = ifStatement . elseStatement ; boolean thenStatementIsBlock = false ; if ( thenStatement != null ) { if ( thenStatement instanceof Block ) { thenStatementIsBlock = true ; if ( isGuardClause ( ( Block ) thenStatement ) && elseStatement == null && this . preferences . keep_guardian_clause_on_one_line ) { formatGuardClauseBlock ( ( Block ) thenStatement , scope ) ; } else { formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; thenStatement . traverse ( this , scope ) ; if ( elseStatement != null && ( this . preferences . insert_new_line_before_else_in_if_statement ) ) { this . scribe . printNewLine ( ) ; } } } else if ( elseStatement == null && this . preferences . keep_simple_if_on_one_line ) { Alignment compactIfAlignment = this . scribe . createAlignment ( Alignment . COMPACT_IF , this . preferences . alignment_for_compact_if , Alignment . R_OUTERMOST , <NUM_LIT:1> , this . scribe . scanner . currentPosition , <NUM_LIT:1> , false ) ; this . scribe . enterAlignment ( compactIfAlignment ) ; boolean ok = false ; do { try { this . scribe . alignFragment ( compactIfAlignment , <NUM_LIT:0> ) ; this . scribe . space ( ) ; thenStatement . traverse ( this , scope ) ; if ( thenStatement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( compactIfAlignment , true ) ; } else if ( this . preferences . keep_then_statement_on_same_line ) { this . scribe . space ( ) ; thenStatement . traverse ( this , scope ) ; if ( thenStatement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } if ( elseStatement != null ) { this . scribe . printNewLine ( ) ; } } else { this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; thenStatement . traverse ( this , scope ) ; if ( thenStatement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } if ( elseStatement != null ) { this . scribe . printNewLine ( ) ; } this . scribe . unIndent ( ) ; } } if ( elseStatement != null ) { if ( thenStatementIsBlock ) { this . scribe . printNextToken ( TerminalTokens . TokenNameelse , this . preferences . insert_space_after_closing_brace_in_block ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameelse , true ) ; } if ( elseStatement instanceof Block ) { elseStatement . traverse ( this , scope ) ; } else if ( elseStatement instanceof IfStatement ) { if ( ! this . preferences . compact_else_if ) { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; } this . scribe . space ( ) ; elseStatement . traverse ( this , scope ) ; if ( ! this . preferences . compact_else_if ) { this . scribe . unIndent ( ) ; } } else if ( this . preferences . keep_else_statement_on_same_line ) { this . scribe . space ( ) ; elseStatement . traverse ( this , scope ) ; if ( elseStatement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } } else { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; elseStatement . traverse ( this , scope ) ; if ( elseStatement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . unIndent ( ) ; } } return false ; } public boolean visit ( Initializer initializer , MethodScope scope ) { if ( initializer . isStatic ( ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNamestatic ) ; } initializer . block . traverse ( this , scope ) ; return false ; } public boolean visit ( InstanceOfExpression instanceOfExpression , BlockScope scope ) { final int numberOfParens = ( instanceOfExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( instanceOfExpression , numberOfParens ) ; } instanceOfExpression . expression . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameinstanceof , true ) ; this . scribe . space ( ) ; instanceOfExpression . type . traverse ( this , scope ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( instanceOfExpression , numberOfParens ) ; } return false ; } public boolean visit ( IntLiteral intLiteral , BlockScope scope ) { final int numberOfParens = ( intLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( intLiteral , numberOfParens ) ; } Constant constant = intLiteral . constant ; if ( constant != null && constant . intValue ( ) < <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameMINUS ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIntegerLiteral ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( intLiteral , numberOfParens ) ; } return false ; } public boolean visit ( LabeledStatement labeledStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOLON , this . preferences . insert_space_before_colon_in_labeled_statement ) ; if ( this . preferences . insert_space_after_colon_in_labeled_statement ) { this . scribe . space ( ) ; } if ( this . preferences . insert_new_line_after_label ) { this . scribe . printNewLine ( ) ; } final Statement statement = labeledStatement . statement ; statement . traverse ( this , scope ) ; if ( statement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } return false ; } public boolean visit ( LocalDeclaration localDeclaration , BlockScope scope ) { formatLocalDeclaration ( localDeclaration , scope , this . preferences . insert_space_before_comma_in_multiple_local_declarations , this . preferences . insert_space_after_comma_in_multiple_local_declarations ) ; return false ; } public boolean visit ( LongLiteral longLiteral , BlockScope scope ) { final int numberOfParens = ( longLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( longLiteral , numberOfParens ) ; } Constant constant = longLiteral . constant ; if ( constant != null && constant . longValue ( ) < <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameMINUS ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameLongLiteral ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( longLiteral , numberOfParens ) ; } return false ; } public boolean visit ( MarkerAnnotation annotation , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameAT ) ; if ( this . preferences . insert_space_after_at_in_annotation ) { this . scribe . space ( ) ; } this . scribe . printQualifiedReference ( annotation . sourceEnd , false ) ; return false ; } public boolean visit ( MarkerAnnotation annotation , ClassScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameAT ) ; if ( this . preferences . insert_space_after_at_in_annotation ) { this . scribe . space ( ) ; } this . scribe . printQualifiedReference ( annotation . sourceEnd , false ) ; return false ; } public boolean visit ( MemberValuePair pair , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameEQUAL , this . preferences . insert_space_before_assignment_operator ) ; if ( this . preferences . insert_space_after_assignment_operator ) { this . scribe . space ( ) ; } pair . value . traverse ( this , scope ) ; return false ; } public boolean visit ( MessageSend messageSend , BlockScope scope ) { final int numberOfParens = ( messageSend . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( messageSend , numberOfParens ) ; } CascadingMethodInvocationFragmentBuilder builder = buildFragments ( messageSend , scope ) ; if ( builder . size ( ) >= <NUM_LIT:3> && numberOfParens == <NUM_LIT:0> ) { formatCascadingMessageSends ( builder , scope ) ; } else { Alignment messageAlignment = null ; if ( ! messageSend . receiver . isImplicitThis ( ) ) { messageSend . receiver . traverse ( this , scope ) ; int alignmentMode = this . preferences . alignment_for_selector_in_method_invocation ; messageAlignment = this . scribe . createAlignment ( Alignment . MESSAGE_SEND , alignmentMode , <NUM_LIT:1> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( messageAlignment ) ; boolean ok = false ; do { switch ( alignmentMode & Alignment . SPLIT_MASK ) { case Alignment . M_COMPACT_SPLIT : case Alignment . M_NEXT_PER_LINE_SPLIT : messageAlignment . startingColumn = this . scribe . column ; break ; } try { formatMessageSend ( messageSend , scope , messageAlignment ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( messageAlignment , true ) ; } else { formatMessageSend ( messageSend , scope , null ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( messageSend , numberOfParens ) ; } return false ; } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { if ( methodDeclaration . ignoreFurtherInvestigation ) { this . scribe . printComment ( ) ; if ( this . scribe . indentationLevel != <NUM_LIT:0> ) { this . scribe . printIndentationIfNecessary ( ) ; } this . scribe . scanner . resetTo ( methodDeclaration . declarationSourceEnd + <NUM_LIT:1> , this . scribe . scannerEndPosition - <NUM_LIT:1> ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( ! this . scribe . scanner . atEnd ( ) ) { switch ( this . scribe . scanner . source [ this . scribe . scanner . currentPosition ] ) { case '<STR_LIT:\n>' : this . scribe . scanner . currentPosition ++ ; this . scribe . lastNumberOfNewLines = <NUM_LIT:1> ; break ; case '<STR_LIT>' : this . scribe . scanner . currentPosition ++ ; if ( this . scribe . scanner . source [ this . scribe . scanner . currentPosition ] == '<STR_LIT:\n>' ) { this . scribe . scanner . currentPosition ++ ; } this . scribe . lastNumberOfNewLines = <NUM_LIT:1> ; } } return false ; } this . scribe . printComment ( ) ; int line = this . scribe . line ; Alignment methodDeclAlignment = this . scribe . createAlignment ( Alignment . METHOD_DECLARATION , this . preferences . alignment_for_method_declaration , Alignment . R_INNERMOST , <NUM_LIT:3> , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( methodDeclAlignment ) ; boolean ok = false ; final MethodScope methodDeclarationScope = methodDeclaration . scope ; do { try { this . scribe . printModifiers ( methodDeclaration . annotations , this , ICodeFormatterConstants . ANNOTATION_ON_MEMBER ) ; int fragmentIndex = <NUM_LIT:0> ; this . scribe . alignFragment ( methodDeclAlignment , fragmentIndex ) ; if ( this . scribe . line > line ) { line = this . scribe . line ; } this . scribe . space ( ) ; TypeParameter [ ] typeParameters = methodDeclaration . typeParameters ; if ( typeParameters != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_parameters ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_parameters ) { this . scribe . space ( ) ; } int length = typeParameters . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeParameters [ i ] . traverse ( this , methodDeclaration . scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_parameters ) ; if ( this . preferences . insert_space_after_comma_in_type_parameters ) { this . scribe . space ( ) ; } } typeParameters [ length - <NUM_LIT:1> ] . traverse ( this , methodDeclaration . scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_parameters ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_parameters ) { this . scribe . space ( ) ; } this . scribe . alignFragment ( methodDeclAlignment , ++ fragmentIndex ) ; } final TypeReference returnType = methodDeclaration . returnType ; if ( returnType != null ) { returnType . traverse ( this , methodDeclarationScope ) ; } this . scribe . alignFragment ( methodDeclAlignment , ++ fragmentIndex ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier , true ) ; formatMethodArguments ( methodDeclaration , this . preferences . insert_space_before_opening_paren_in_method_declaration , this . preferences . insert_space_between_empty_parens_in_method_declaration , this . preferences . insert_space_before_closing_paren_in_method_declaration , this . preferences . insert_space_after_opening_paren_in_method_declaration , this . preferences . insert_space_before_comma_in_method_declaration_parameters , this . preferences . insert_space_after_comma_in_method_declaration_parameters , this . preferences . alignment_for_parameters_in_method_declaration ) ; int extraDimensions = getDimensions ( ) ; if ( extraDimensions != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> ; i < extraDimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } formatThrowsClause ( methodDeclaration , this . preferences . insert_space_before_comma_in_method_declaration_throws , this . preferences . insert_space_after_comma_in_method_declaration_throws , this . preferences . alignment_for_throws_clause_in_method_declaration ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( methodDeclAlignment , true ) ; if ( ! methodDeclaration . isNative ( ) && ! methodDeclaration . isAbstract ( ) && ( ( methodDeclaration . modifiers & ExtraCompilerModifiers . AccSemicolonBody ) == <NUM_LIT:0> ) ) { String method_declaration_brace = this . preferences . brace_position_for_method_declaration ; formatLeftCurlyBrace ( line , method_declaration_brace ) ; formatOpeningBrace ( method_declaration_brace , this . preferences . insert_space_before_opening_brace_in_method_declaration ) ; final int numberOfBlankLinesAtBeginningOfMethodBody = this . preferences . blank_lines_at_beginning_of_method_body ; if ( numberOfBlankLinesAtBeginningOfMethodBody > <NUM_LIT:0> ) { this . scribe . printEmptyLines ( numberOfBlankLinesAtBeginningOfMethodBody ) ; } final Statement [ ] statements = methodDeclaration . statements ; if ( statements != null ) { this . scribe . printNewLine ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . indent ( ) ; } formatStatements ( methodDeclarationScope , statements , true ) ; this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . unIndent ( ) ; } } else { if ( this . preferences . insert_new_line_in_empty_method_body ) { this . scribe . printNewLine ( ) ; } if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . indent ( ) ; } this . scribe . printComment ( ) ; if ( this . preferences . indent_statements_compare_to_body ) { this . scribe . unIndent ( ) ; } } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( method_declaration_brace . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . COMPLEX_TRAILING_COMMENT ) ; } return false ; } public boolean visit ( NormalAnnotation annotation , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameAT ) ; if ( this . preferences . insert_space_after_at_in_annotation ) { this . scribe . space ( ) ; } this . scribe . printQualifiedReference ( annotation . sourceEnd , false ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_annotation ) ; if ( this . preferences . insert_space_after_opening_paren_in_annotation ) { this . scribe . space ( ) ; } MemberValuePair [ ] memberValuePairs = annotation . memberValuePairs ; if ( memberValuePairs != null ) { int length = memberValuePairs . length ; Alignment annotationAlignment = this . scribe . createAlignment ( Alignment . ANNOTATION_MEMBERS_VALUE_PAIRS , this . preferences . alignment_for_arguments_in_annotation , length , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( annotationAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_annotation ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( annotationAlignment , i ) ; if ( i > <NUM_LIT:0> && this . preferences . insert_space_after_comma_in_annotation ) { this . scribe . space ( ) ; } memberValuePairs [ i ] . traverse ( this , scope ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( annotationAlignment , true ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_annotation ) ; return false ; } public boolean visit ( NullLiteral nullLiteral , BlockScope scope ) { final int numberOfParens = ( nullLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( nullLiteral , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamenull ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( nullLiteral , numberOfParens ) ; } return false ; } public boolean visit ( OR_OR_Expression or_or_Expression , BlockScope scope ) { return dumpBinaryExpression ( or_or_Expression , TerminalTokens . TokenNameOR_OR , scope ) ; } public boolean visit ( ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference , BlockScope scope ) { final int numberOfParens = ( parameterizedQualifiedTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( parameterizedQualifiedTypeReference , numberOfParens ) ; } TypeReference [ ] [ ] typeArguments = parameterizedQualifiedTypeReference . typeArguments ; int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; TypeReference [ ] typeArgument = typeArguments [ i ] ; if ( typeArgument != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_parameterized_type_reference ) { this . scribe . space ( ) ; } int typeArgumentLength = typeArgument . length ; for ( int j = <NUM_LIT:0> ; j < typeArgumentLength - <NUM_LIT:1> ; j ++ ) { typeArgument [ j ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_comma_in_parameterized_type_reference ) { this . scribe . space ( ) ; } } typeArgument [ typeArgumentLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_parameterized_type_reference ) ; } } if ( i < length - <NUM_LIT:1> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; } } int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> && dimensions <= parameterizedQualifiedTypeReference . dimensions ( ) ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_type_reference ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; if ( this . preferences . insert_space_between_brackets_in_array_type_reference ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( parameterizedQualifiedTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference , ClassScope scope ) { final int numberOfParens = ( parameterizedQualifiedTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( parameterizedQualifiedTypeReference , numberOfParens ) ; } TypeReference [ ] [ ] typeArguments = parameterizedQualifiedTypeReference . typeArguments ; int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; TypeReference [ ] typeArgument = typeArguments [ i ] ; if ( typeArgument != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_parameterized_type_reference ) { this . scribe . space ( ) ; } int typeArgumentLength = typeArgument . length ; for ( int j = <NUM_LIT:0> ; j < typeArgumentLength - <NUM_LIT:1> ; j ++ ) { typeArgument [ j ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_comma_in_parameterized_type_reference ) { this . scribe . space ( ) ; } } typeArgument [ typeArgumentLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_parameterized_type_reference ) ; } } if ( i < length - <NUM_LIT:1> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; } } int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> && dimensions <= parameterizedQualifiedTypeReference . dimensions ( ) ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_type_reference ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; if ( this . preferences . insert_space_between_brackets_in_array_type_reference ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( parameterizedQualifiedTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ParameterizedSingleTypeReference parameterizedSingleTypeReference , BlockScope scope ) { final int numberOfParens = ( parameterizedSingleTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( parameterizedSingleTypeReference , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_parameterized_type_reference ) { this . scribe . space ( ) ; } TypeReference [ ] typeArguments = parameterizedSingleTypeReference . typeArguments ; int typeArgumentsLength = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < typeArgumentsLength - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_comma_in_parameterized_type_reference ) { this . scribe . space ( ) ; } } typeArguments [ typeArgumentsLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_parameterized_type_reference ) ; } int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> && dimensions <= parameterizedSingleTypeReference . dimensions ( ) ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_type_reference ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; if ( this . preferences . insert_space_between_brackets_in_array_type_reference ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( parameterizedSingleTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ParameterizedSingleTypeReference parameterizedSingleTypeReference , ClassScope scope ) { final int numberOfParens = ( parameterizedSingleTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( parameterizedSingleTypeReference , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_parameterized_type_reference ) { this . scribe . space ( ) ; } TypeReference [ ] typeArguments = parameterizedSingleTypeReference . typeArguments ; int typeArgumentsLength = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < typeArgumentsLength - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_parameterized_type_reference ) ; if ( this . preferences . insert_space_after_comma_in_parameterized_type_reference ) { this . scribe . space ( ) ; } } typeArguments [ typeArgumentsLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_parameterized_type_reference ) ; } int dimensions = getDimensions ( ) ; if ( dimensions != <NUM_LIT:0> && dimensions <= parameterizedSingleTypeReference . dimensions ( ) ) { if ( this . preferences . insert_space_before_opening_bracket_in_array_type_reference ) { this . scribe . space ( ) ; } for ( int i = <NUM_LIT:0> ; i < dimensions ; i ++ ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLBRACKET ) ; if ( this . preferences . insert_space_between_brackets_in_array_type_reference ) { this . scribe . space ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACKET ) ; } } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( parameterizedSingleTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( PostfixExpression postfixExpression , BlockScope scope ) { final int numberOfParens = ( postfixExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( postfixExpression , numberOfParens ) ; } postfixExpression . lhs . traverse ( this , scope ) ; int operator = postfixExpression . operator == OperatorIds . PLUS ? TerminalTokens . TokenNamePLUS_PLUS : TerminalTokens . TokenNameMINUS_MINUS ; this . scribe . printNextToken ( operator , this . preferences . insert_space_before_postfix_operator ) ; if ( this . preferences . insert_space_after_postfix_operator ) { this . scribe . space ( ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( postfixExpression , numberOfParens ) ; } return false ; } public boolean visit ( PrefixExpression prefixExpression , BlockScope scope ) { final int numberOfParens = ( prefixExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( prefixExpression , numberOfParens ) ; } int operator = prefixExpression . operator == OperatorIds . PLUS ? TerminalTokens . TokenNamePLUS_PLUS : TerminalTokens . TokenNameMINUS_MINUS ; this . scribe . printNextToken ( operator , this . preferences . insert_space_before_prefix_operator ) ; if ( this . preferences . insert_space_after_prefix_operator ) { this . scribe . space ( ) ; } prefixExpression . lhs . traverse ( this , scope ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( prefixExpression , numberOfParens ) ; } return false ; } public boolean visit ( QualifiedAllocationExpression qualifiedAllocationExpression , BlockScope scope ) { final int numberOfParens = ( qualifiedAllocationExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( qualifiedAllocationExpression , numberOfParens ) ; } final Expression enclosingInstance = qualifiedAllocationExpression . enclosingInstance ; if ( enclosingInstance != null ) { enclosingInstance . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamenew ) ; TypeReference [ ] typeArguments = qualifiedAllocationExpression . typeArguments ; if ( typeArguments != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameLESS , this . preferences . insert_space_before_opening_angle_bracket_in_type_arguments ) ; if ( this . preferences . insert_space_after_opening_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } int length = typeArguments . length ; for ( int i = <NUM_LIT:0> ; i < length - <NUM_LIT:1> ; i ++ ) { typeArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_type_arguments ) ; if ( this . preferences . insert_space_after_comma_in_type_arguments ) { this . scribe . space ( ) ; } } typeArguments [ length - <NUM_LIT:1> ] . traverse ( this , scope ) ; if ( isClosingGenericToken ( ) ) { this . scribe . printNextToken ( CLOSING_GENERICS_EXPECTEDTOKENS , this . preferences . insert_space_before_closing_angle_bracket_in_type_arguments ) ; } if ( this . preferences . insert_space_after_closing_angle_bracket_in_type_arguments ) { this . scribe . space ( ) ; } } else { this . scribe . space ( ) ; } final int line = this . scribe . line ; qualifiedAllocationExpression . type . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_method_invocation ) ; final Expression [ ] arguments = qualifiedAllocationExpression . arguments ; if ( arguments != null ) { if ( this . preferences . insert_space_after_opening_paren_in_method_invocation ) { this . scribe . space ( ) ; } int argumentLength = arguments . length ; Alignment argumentsAlignment = this . scribe . createAlignment ( Alignment . ALLOCATION , this . preferences . alignment_for_arguments_in_qualified_allocation_expression , argumentLength , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( argumentsAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> ; i < argumentLength ; i ++ ) { if ( i > <NUM_LIT:0> ) { this . scribe . printNextToken ( TerminalTokens . TokenNameCOMMA , this . preferences . insert_space_before_comma_in_allocation_expression ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . alignFragment ( argumentsAlignment , i ) ; if ( i > <NUM_LIT:0> && this . preferences . insert_space_after_comma_in_allocation_expression ) { this . scribe . space ( ) ; } arguments [ i ] . traverse ( this , scope ) ; } ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( argumentsAlignment , true ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_method_invocation ) ; } else { this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_between_empty_parens_in_method_invocation ) ; } final TypeDeclaration anonymousType = qualifiedAllocationExpression . anonymousType ; if ( anonymousType != null ) { formatLeftCurlyBrace ( line , this . preferences . brace_position_for_anonymous_type_declaration ) ; formatAnonymousTypeDeclaration ( anonymousType ) ; } if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( qualifiedAllocationExpression , numberOfParens ) ; } return false ; } public boolean visit ( QualifiedNameReference qualifiedNameReference , BlockScope scope ) { final int numberOfParens = ( qualifiedNameReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( qualifiedNameReference , numberOfParens ) ; } this . scribe . printQualifiedReference ( qualifiedNameReference . sourceEnd , numberOfParens >= <NUM_LIT:0> ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( qualifiedNameReference , numberOfParens ) ; } return false ; } public boolean visit ( QualifiedSuperReference qualifiedSuperReference , BlockScope scope ) { final int numberOfParens = ( qualifiedSuperReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( qualifiedSuperReference , numberOfParens ) ; } qualifiedSuperReference . qualification . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; this . scribe . printNextToken ( TerminalTokens . TokenNamesuper ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( qualifiedSuperReference , numberOfParens ) ; } return false ; } public boolean visit ( QualifiedThisReference qualifiedThisReference , BlockScope scope ) { final int numberOfParens = ( qualifiedThisReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( qualifiedThisReference , numberOfParens ) ; } qualifiedThisReference . qualification . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameDOT ) ; this . scribe . printNextToken ( TerminalTokens . TokenNamethis ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( qualifiedThisReference , numberOfParens ) ; } return false ; } public boolean visit ( QualifiedTypeReference qualifiedTypeReference , BlockScope scope ) { final int numberOfParens = ( qualifiedTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( qualifiedTypeReference , numberOfParens ) ; } this . scribe . printQualifiedReference ( qualifiedTypeReference . sourceEnd , numberOfParens >= <NUM_LIT:0> ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( qualifiedTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( QualifiedTypeReference qualifiedTypeReference , ClassScope scope ) { final int numberOfParens = ( qualifiedTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( qualifiedTypeReference , numberOfParens ) ; } this . scribe . printQualifiedReference ( qualifiedTypeReference . sourceEnd , numberOfParens >= <NUM_LIT:0> ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( qualifiedTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( ReturnStatement returnStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamereturn ) ; final Expression expression = returnStatement . expression ; if ( expression != null ) { final int numberOfParens = ( expression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( ( numberOfParens != <NUM_LIT:0> && this . preferences . insert_space_before_parenthesized_expression_in_return ) || numberOfParens == <NUM_LIT:0> ) { this . scribe . space ( ) ; } expression . traverse ( this , scope ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( SingleMemberAnnotation annotation , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameAT ) ; if ( this . preferences . insert_space_after_at_in_annotation ) { this . scribe . space ( ) ; } this . scribe . printQualifiedReference ( annotation . sourceEnd , false ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_annotation ) ; if ( this . preferences . insert_space_after_opening_paren_in_annotation ) { this . scribe . space ( ) ; } annotation . memberValue . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_annotation ) ; return false ; } public boolean visit ( SingleNameReference singleNameReference , BlockScope scope ) { final int numberOfParens = ( singleNameReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( singleNameReference , numberOfParens ) ; } this . scribe . printNextToken ( SINGLETYPEREFERENCE_EXPECTEDTOKENS ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( singleNameReference , numberOfParens ) ; } return false ; } public boolean visit ( SingleTypeReference singleTypeReference , BlockScope scope ) { final int numberOfParens = ( singleTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( singleTypeReference , numberOfParens ) ; } this . scribe . printNextToken ( SINGLETYPEREFERENCE_EXPECTEDTOKENS ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( singleTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( SingleTypeReference singleTypeReference , ClassScope scope ) { final int numberOfParens = ( singleTypeReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( singleTypeReference , numberOfParens ) ; } this . scribe . printNextToken ( SINGLETYPEREFERENCE_EXPECTEDTOKENS ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( singleTypeReference , numberOfParens ) ; } return false ; } public boolean visit ( StringLiteral stringLiteral , BlockScope scope ) { final int numberOfParens = ( stringLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( stringLiteral , numberOfParens ) ; } this . scribe . checkNLSTag ( stringLiteral . sourceStart ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameStringLiteral ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( stringLiteral , numberOfParens ) ; } return false ; } public boolean visit ( StringLiteralConcatenation stringLiteral , BlockScope scope ) { final int numberOfParens = ( stringLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( stringLiteral , numberOfParens ) ; } this . scribe . printComment ( ) ; ASTNode [ ] fragments = stringLiteral . literals ; int fragmentsSize = stringLiteral . counter ; Alignment binaryExpressionAlignment = this . scribe . createAlignment ( Alignment . STRING_CONCATENATION , this . preferences . alignment_for_binary_expression , Alignment . R_OUTERMOST , fragmentsSize , this . scribe . scanner . currentPosition ) ; this . scribe . enterAlignment ( binaryExpressionAlignment ) ; boolean ok = false ; do { try { for ( int i = <NUM_LIT:0> ; i < fragmentsSize - <NUM_LIT:1> ; i ++ ) { ASTNode fragment = fragments [ i ] ; fragment . traverse ( this , scope ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( this . scribe . lastNumberOfNewLines == <NUM_LIT:1> ) { this . scribe . indentationLevel = binaryExpressionAlignment . breakIndentationLevel ; } this . scribe . alignFragment ( binaryExpressionAlignment , i ) ; this . scribe . printNextToken ( TerminalTokens . TokenNamePLUS , this . preferences . insert_space_before_binary_operator ) ; if ( this . preferences . insert_space_after_binary_operator ) { this . scribe . space ( ) ; } } fragments [ fragmentsSize - <NUM_LIT:1> ] . traverse ( this , scope ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; ok = true ; } catch ( AlignmentException e ) { this . scribe . redoAlignment ( e ) ; } } while ( ! ok ) ; this . scribe . exitAlignment ( binaryExpressionAlignment , true ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( stringLiteral , numberOfParens ) ; } return false ; } public boolean visit ( SuperReference superReference , BlockScope scope ) { final int numberOfParens = ( superReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( superReference , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamesuper ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( superReference , numberOfParens ) ; } return false ; } public boolean visit ( SwitchStatement switchStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameswitch ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_switch ) ; if ( this . preferences . insert_space_after_opening_paren_in_switch ) { this . scribe . space ( ) ; } switchStatement . expression . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_switch ) ; String switch_brace = this . preferences . brace_position_for_switch ; formatOpeningBrace ( switch_brace , this . preferences . insert_space_before_opening_brace_in_switch ) ; this . scribe . printNewLine ( ) ; if ( this . preferences . indent_switchstatements_compare_to_switch ) { this . scribe . indent ( ) ; } final Statement [ ] statements = switchStatement . statements ; boolean wasACase = false ; boolean wasAStatement = false ; if ( statements != null ) { int statementsLength = statements . length ; for ( int i = <NUM_LIT:0> ; i < statementsLength ; i ++ ) { final Statement statement = statements [ i ] ; if ( statement instanceof CaseStatement ) { if ( wasACase ) { this . scribe . printNewLine ( ) ; } if ( ( wasACase && this . preferences . indent_switchstatements_compare_to_cases ) || ( wasAStatement && this . preferences . indent_switchstatements_compare_to_cases ) ) { this . scribe . unIndent ( ) ; } statement . traverse ( this , scope ) ; wasACase = true ; wasAStatement = false ; if ( this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . indent ( ) ; } this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . COMPLEX_TRAILING_COMMENT ) ; } else if ( statement instanceof BreakStatement ) { if ( this . preferences . indent_breaks_compare_to_cases ) { if ( wasAStatement && ! this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . indent ( ) ; } } else { if ( wasAStatement ) { if ( this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . unIndent ( ) ; } } if ( wasACase && this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . unIndent ( ) ; } } if ( wasACase ) { this . scribe . printNewLine ( ) ; } statement . traverse ( this , scope ) ; if ( this . preferences . indent_breaks_compare_to_cases ) { this . scribe . unIndent ( ) ; } wasACase = false ; wasAStatement = false ; } else if ( statement instanceof Block ) { String bracePosition ; if ( wasACase ) { if ( this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . unIndent ( ) ; } bracePosition = this . preferences . brace_position_for_block_in_case ; formatBlock ( ( Block ) statement , scope , bracePosition , this . preferences . insert_space_after_colon_in_case ) ; if ( this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . indent ( ) ; } } else { bracePosition = this . preferences . brace_position_for_block ; formatBlock ( ( Block ) statement , scope , bracePosition , this . preferences . insert_space_before_opening_brace_in_block ) ; } wasAStatement = true ; wasACase = false ; } else { this . scribe . printNewLine ( ) ; statement . traverse ( this , scope ) ; wasAStatement = true ; wasACase = false ; } if ( statement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . printNewLine ( ) ; } else if ( statement instanceof LocalDeclaration ) { LocalDeclaration currentLocal = ( LocalDeclaration ) statement ; if ( i < ( statementsLength - <NUM_LIT:1> ) ) { if ( statements [ i + <NUM_LIT:1> ] instanceof LocalDeclaration ) { LocalDeclaration nextLocal = ( LocalDeclaration ) statements [ i + <NUM_LIT:1> ] ; if ( currentLocal . declarationSourceStart != nextLocal . declarationSourceStart ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . printNewLine ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . printNewLine ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; this . scribe . printNewLine ( ) ; } } else if ( ! wasACase ) { this . scribe . printNewLine ( ) ; } this . scribe . printComment ( ) ; } } if ( ( wasACase || wasAStatement ) && this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . unIndent ( ) ; } if ( this . preferences . indent_switchstatements_compare_to_switch ) { this . scribe . unIndent ( ) ; } this . scribe . printNewLine ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; if ( switch_brace . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } return false ; } public boolean visit ( SynchronizedStatement synchronizedStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamesynchronized ) ; final int line = this . scribe . line ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_synchronized ) ; if ( this . preferences . insert_space_after_opening_paren_in_synchronized ) { this . scribe . space ( ) ; } synchronizedStatement . expression . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_synchronized ) ; formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; synchronizedStatement . block . traverse ( this , scope ) ; return false ; } public boolean visit ( ThisReference thisReference , BlockScope scope ) { if ( ! thisReference . isImplicitThis ( ) ) { final int numberOfParens = ( thisReference . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( thisReference , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamethis ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( thisReference , numberOfParens ) ; } } return false ; } public boolean visit ( ThrowStatement throwStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamethrow ) ; Expression expression = throwStatement . exception ; final int numberOfParens = ( expression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( ( numberOfParens > <NUM_LIT:0> && this . preferences . insert_space_before_parenthesized_expression_in_throw ) || numberOfParens == <NUM_LIT:0> ) { this . scribe . space ( ) ; } expression . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; return false ; } public boolean visit ( TrueLiteral trueLiteral , BlockScope scope ) { final int numberOfParens = ( trueLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( trueLiteral , numberOfParens ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNametrue ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( trueLiteral , numberOfParens ) ; } return false ; } public boolean visit ( TryStatement tryStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNametry ) ; tryStatement . tryBlock . traverse ( this , scope ) ; if ( tryStatement . catchArguments != null ) { for ( int i = <NUM_LIT:0> , max = tryStatement . catchBlocks . length ; i < max ; i ++ ) { if ( this . preferences . insert_new_line_before_catch_in_try_statement ) { this . scribe . printNewLine ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamecatch , this . preferences . insert_space_after_closing_brace_in_block ) ; final int line = this . scribe . line ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_catch ) ; if ( this . preferences . insert_space_after_opening_paren_in_catch ) { this . scribe . space ( ) ; } tryStatement . catchArguments [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_catch ) ; formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; tryStatement . catchBlocks [ i ] . traverse ( this , scope ) ; } } if ( tryStatement . finallyBlock != null ) { if ( this . preferences . insert_new_line_before_finally_in_try_statement ) { this . scribe . printNewLine ( ) ; } this . scribe . printNextToken ( TerminalTokens . TokenNamefinally , this . preferences . insert_space_after_closing_brace_in_block ) ; tryStatement . finallyBlock . traverse ( this , scope ) ; } return false ; } public boolean visit ( TypeDeclaration localTypeDeclaration , BlockScope scope ) { format ( localTypeDeclaration ) ; return false ; } public boolean visit ( TypeDeclaration memberTypeDeclaration , ClassScope scope ) { format ( memberTypeDeclaration ) ; return false ; } public boolean visit ( TypeDeclaration typeDeclaration , CompilationUnitScope scope ) { format ( typeDeclaration ) ; return false ; } public boolean visit ( TypeParameter typeParameter , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; if ( typeParameter . type != null ) { this . scribe . space ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameextends , true ) ; this . scribe . space ( ) ; typeParameter . type . traverse ( this , scope ) ; } final TypeReference [ ] bounds = typeParameter . bounds ; if ( bounds != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameAND , this . preferences . insert_space_before_and_in_type_parameter ) ; if ( this . preferences . insert_space_after_and_in_type_parameter ) { this . scribe . space ( ) ; } int boundsLength = bounds . length ; for ( int i = <NUM_LIT:0> ; i < boundsLength - <NUM_LIT:1> ; i ++ ) { bounds [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameAND , this . preferences . insert_space_before_and_in_type_parameter ) ; if ( this . preferences . insert_space_after_and_in_type_parameter ) { this . scribe . space ( ) ; } } bounds [ boundsLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; } return false ; } public boolean visit ( TypeParameter typeParameter , ClassScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameIdentifier ) ; if ( typeParameter . type != null ) { this . scribe . space ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameextends , true ) ; this . scribe . space ( ) ; typeParameter . type . traverse ( this , scope ) ; } final TypeReference [ ] bounds = typeParameter . bounds ; if ( bounds != null ) { this . scribe . printNextToken ( TerminalTokens . TokenNameAND , this . preferences . insert_space_before_and_in_type_parameter ) ; if ( this . preferences . insert_space_after_and_in_type_parameter ) { this . scribe . space ( ) ; } int boundsLength = bounds . length ; for ( int i = <NUM_LIT:0> ; i < boundsLength - <NUM_LIT:1> ; i ++ ) { bounds [ i ] . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameAND , this . preferences . insert_space_before_and_in_type_parameter ) ; if ( this . preferences . insert_space_after_and_in_type_parameter ) { this . scribe . space ( ) ; } } bounds [ boundsLength - <NUM_LIT:1> ] . traverse ( this , scope ) ; } return false ; } public boolean visit ( UnaryExpression unaryExpression , BlockScope scope ) { final int numberOfParens = ( unaryExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { manageOpeningParenthesizedExpression ( unaryExpression , numberOfParens ) ; } int operator ; int operatorValue = ( unaryExpression . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ; switch ( operatorValue ) { case OperatorIds . PLUS : operator = TerminalTokens . TokenNamePLUS ; break ; case OperatorIds . MINUS : operator = TerminalTokens . TokenNameMINUS ; break ; case OperatorIds . TWIDDLE : operator = TerminalTokens . TokenNameTWIDDLE ; break ; default : operator = TerminalTokens . TokenNameNOT ; } this . scribe . printNextToken ( operator , this . preferences . insert_space_before_unary_operator ) ; if ( this . preferences . insert_space_after_unary_operator ) { this . scribe . space ( ) ; } Expression expression = unaryExpression . expression ; if ( expression instanceof PrefixExpression ) { PrefixExpression prefixExpression = ( PrefixExpression ) expression ; final int numberOfParensForExpression = ( prefixExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParensForExpression == <NUM_LIT:0> ) { switch ( operatorValue ) { case OperatorIds . PLUS : if ( prefixExpression . operator == OperatorIds . PLUS ) { this . scribe . space ( ) ; } break ; case OperatorIds . MINUS : if ( prefixExpression . operator == OperatorIds . MINUS ) { this . scribe . space ( ) ; } break ; } } } else if ( expression instanceof UnaryExpression ) { UnaryExpression unaryExpression2 = ( UnaryExpression ) expression ; final int numberOfParensForExpression = ( unaryExpression2 . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParensForExpression == <NUM_LIT:0> ) { int operatorValue2 = ( unaryExpression2 . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ; switch ( operatorValue ) { case OperatorIds . PLUS : if ( operatorValue2 == OperatorIds . PLUS ) { this . scribe . space ( ) ; } break ; case OperatorIds . MINUS : if ( operatorValue2 == OperatorIds . MINUS ) { this . scribe . space ( ) ; } break ; } } } expression . traverse ( this , scope ) ; if ( numberOfParens > <NUM_LIT:0> ) { manageClosingParenthesizedExpression ( unaryExpression , numberOfParens ) ; } return false ; } public boolean visit ( WhileStatement whileStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNamewhile ) ; final int line = this . scribe . line ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_opening_paren_in_while ) ; if ( this . preferences . insert_space_after_opening_paren_in_while ) { this . scribe . space ( ) ; } whileStatement . condition . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_before_closing_paren_in_while ) ; final Statement action = whileStatement . action ; if ( action != null ) { if ( action instanceof Block ) { formatLeftCurlyBrace ( line , this . preferences . brace_position_for_block ) ; action . traverse ( this , scope ) ; } else if ( action instanceof EmptyStatement ) { formatNecessaryEmptyStatement ( ) ; } else { this . scribe . printNewLine ( ) ; this . scribe . indent ( ) ; action . traverse ( this , scope ) ; if ( action instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printComment ( CodeFormatter . K_UNKNOWN , Scribe . BASIC_TRAILING_COMMENT ) ; } this . scribe . unIndent ( ) ; } } else { formatNecessaryEmptyStatement ( ) ; } return false ; } public boolean visit ( Wildcard wildcard , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameQUESTION , this . preferences . insert_space_before_question_in_wilcard ) ; switch ( wildcard . kind ) { case Wildcard . SUPER : this . scribe . printNextToken ( TerminalTokens . TokenNamesuper , true ) ; this . scribe . space ( ) ; wildcard . bound . traverse ( this , scope ) ; break ; case Wildcard . EXTENDS : this . scribe . printNextToken ( TerminalTokens . TokenNameextends , true ) ; this . scribe . space ( ) ; wildcard . bound . traverse ( this , scope ) ; break ; case Wildcard . UNBOUND : if ( this . preferences . insert_space_after_question_in_wilcard ) { this . scribe . space ( ) ; } } return false ; } public boolean visit ( Wildcard wildcard , ClassScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameQUESTION , this . preferences . insert_space_before_question_in_wilcard ) ; switch ( wildcard . kind ) { case Wildcard . SUPER : this . scribe . printNextToken ( TerminalTokens . TokenNamesuper , true ) ; this . scribe . space ( ) ; wildcard . bound . traverse ( this , scope ) ; break ; case Wildcard . EXTENDS : this . scribe . printNextToken ( TerminalTokens . TokenNameextends , true ) ; this . scribe . space ( ) ; wildcard . bound . traverse ( this , scope ) ; break ; case Wildcard . UNBOUND : if ( this . preferences . insert_space_after_question_in_wilcard ) { this . scribe . space ( ) ; } } return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . comment ; import java . io . IOException ; import java . io . Reader ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . internal . compiler . parser . * ; public class Java2HTMLEntityReader extends SubstitutionTextReader { private static final int BEGIN_LINE = <NUM_LIT> ; private static final Map fgEntityLookup ; private int bits = BEGIN_LINE ; static { fgEntityLookup = new HashMap ( <NUM_LIT:7> ) ; fgEntityLookup . put ( "<STR_LIT:<>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT:>>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT:&>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT:\">" , "<STR_LIT>" ) ; } public Java2HTMLEntityReader ( Reader reader ) { super ( reader ) ; setSkipWhitespace ( false ) ; } protected String computeSubstitution ( int c ) throws IOException { StringBuffer buf = new StringBuffer ( ) ; while ( c == '<CHAR_LIT>' ) { this . bits &= ~ BEGIN_LINE ; c = nextChar ( ) ; buf . append ( '<CHAR_LIT>' ) ; } if ( c == - <NUM_LIT:1> ) return buf . toString ( ) ; if ( c == '<CHAR_LIT:/>' && buf . length ( ) > <NUM_LIT:0> ) { buf . setLength ( buf . length ( ) - <NUM_LIT:1> ) ; buf . append ( "<STR_LIT>" ) ; } else if ( c == '<CHAR_LIT>' && ( this . bits & BEGIN_LINE ) != <NUM_LIT:0> ) { buf . append ( "<STR_LIT>" ) ; } else { String entity = ( String ) fgEntityLookup . get ( String . valueOf ( ( char ) c ) ) ; if ( entity != null ) buf . append ( entity ) ; else buf . append ( ( char ) c ) ; } if ( c == '<STR_LIT:\n>' || c == '<STR_LIT>' ) { this . bits |= BEGIN_LINE ; } else if ( ! ScannerHelper . isWhitespace ( ( char ) c ) ) { this . bits &= ~ BEGIN_LINE ; } return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . comment ; import java . util . Map ; import org . eclipse . text . edits . TextEdit ; import org . eclipse . core . runtime . Assert ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . BadPositionCategoryException ; import org . eclipse . jface . text . DefaultPositionUpdater ; import org . eclipse . jface . text . Document ; import org . eclipse . jface . text . Position ; import org . eclipse . jdt . core . ToolFactory ; import org . eclipse . jdt . internal . core . util . Util ; public class CommentFormatterUtil { public static String evaluateFormatterEdit ( String string , TextEdit edit , Position [ ] positions ) { try { Document doc = createDocument ( string , positions ) ; edit . apply ( doc , <NUM_LIT:0> ) ; if ( positions != null ) { for ( int i = <NUM_LIT:0> ; i < positions . length ; i ++ ) { Assert . isTrue ( ! positions [ i ] . isDeleted , "<STR_LIT>" ) ; } } return doc . get ( ) ; } catch ( BadLocationException e ) { log ( e ) ; Assert . isTrue ( false , "<STR_LIT>" + e . getMessage ( ) ) ; } return null ; } public static TextEdit format2 ( int kind , String string , int indentationLevel , String lineSeparator , Map options ) { int length = string . length ( ) ; if ( <NUM_LIT:0> < <NUM_LIT:0> || length < <NUM_LIT:0> || <NUM_LIT:0> + length > string . length ( ) ) { throw new IllegalArgumentException ( "<STR_LIT>" + <NUM_LIT:0> + "<STR_LIT>" + length + "<STR_LIT>" + string . length ( ) ) ; } return ToolFactory . createCodeFormatter ( options ) . format ( kind , string , <NUM_LIT:0> , length , indentationLevel , lineSeparator ) ; } private static Document createDocument ( String content , Position [ ] positions ) throws IllegalArgumentException { Document doc = new Document ( content ) ; try { if ( positions != null ) { final String POS_CATEGORY = "<STR_LIT>" ; doc . addPositionCategory ( POS_CATEGORY ) ; doc . addPositionUpdater ( new DefaultPositionUpdater ( POS_CATEGORY ) { protected boolean notDeleted ( ) { if ( this . fOffset < this . fPosition . offset && ( this . fPosition . offset + this . fPosition . length < this . fOffset + this . fLength ) ) { this . fPosition . offset = this . fOffset + this . fLength ; return false ; } return true ; } } ) ; for ( int i = <NUM_LIT:0> ; i < positions . length ; i ++ ) { try { doc . addPosition ( POS_CATEGORY , positions [ i ] ) ; } catch ( BadLocationException e ) { throw new IllegalArgumentException ( "<STR_LIT>" + positions [ i ] . offset + "<STR_LIT>" + positions [ i ] . length + "<STR_LIT>" + content . length ( ) ) ; } } } } catch ( BadPositionCategoryException cannotHappen ) { } return doc ; } public static void log ( Throwable t ) { Util . log ( t , "<STR_LIT>" ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . comment ; import java . io . IOException ; import java . io . Reader ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public class HTMLEntity2JavaReader extends SubstitutionTextReader { private static final Map fgEntityLookup ; static { fgEntityLookup = new HashMap ( <NUM_LIT:7> ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT:<>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT:>>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT:U+0020>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT:&>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT>" ) ; fgEntityLookup . put ( "<STR_LIT>" , "<STR_LIT:\">" ) ; } public HTMLEntity2JavaReader ( Reader reader ) { super ( reader ) ; setSkipWhitespace ( false ) ; } protected String computeSubstitution ( int c ) throws IOException { if ( c == '<CHAR_LIT>' ) return processEntity ( ) ; return null ; } protected String entity2Text ( String symbol ) { if ( symbol . length ( ) > <NUM_LIT:1> && symbol . charAt ( <NUM_LIT:0> ) == '<CHAR_LIT>' ) { int ch ; try { if ( symbol . charAt ( <NUM_LIT:1> ) == '<CHAR_LIT>' ) { ch = Integer . parseInt ( symbol . substring ( <NUM_LIT:2> ) , <NUM_LIT:16> ) ; } else { ch = Integer . parseInt ( symbol . substring ( <NUM_LIT:1> ) , <NUM_LIT:10> ) ; } return String . valueOf ( ( char ) ch ) ; } catch ( NumberFormatException e ) { } } else { String str = ( String ) fgEntityLookup . get ( symbol ) ; if ( str != null ) { return str ; } } return "<STR_LIT:&>" + symbol ; } private String processEntity ( ) throws IOException { StringBuffer buf = new StringBuffer ( ) ; int ch = nextChar ( ) ; while ( ScannerHelper . isLetterOrDigit ( ( char ) ch ) || ch == '<CHAR_LIT>' ) { buf . append ( ( char ) ch ) ; ch = nextChar ( ) ; } if ( ch == '<CHAR_LIT:;>' ) return entity2Text ( buf . toString ( ) ) ; buf . insert ( <NUM_LIT:0> , '<CHAR_LIT>' ) ; if ( ch != - <NUM_LIT:1> ) buf . append ( ( char ) ch ) ; return buf . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . comment ; public interface IJavaDocTagConstants { public static final char [ ] [ ] JAVADOC_SINGLE_BREAK_TAG = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVADOC_CODE_TAGS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVADOC_BREAK_TAGS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT:q>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVADOC_IMMUTABLE_TAGS = new char [ ] [ ] { "<STR_LIT:code>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT:q>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVADOC_NEWLINE_TAGS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT:q>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVADOC_PARAM_TAGS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } ; public static final char [ ] [ ] JAVADOC_SEPARATOR_TAGS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT:p>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , } ; public static final char JAVADOC_TAG_PREFIX = '<CHAR_LIT>' ; public static final char LINK_TAG_POSTFIX = '<CHAR_LIT:}>' ; public static final String LINK_TAG_PREFIX_STRING = "<STR_LIT>" ; public static final char [ ] LINK_TAG_PREFIX = LINK_TAG_PREFIX_STRING . toCharArray ( ) ; public static final char [ ] [ ] COMMENT_ROOT_TAGS = new char [ ] [ ] { "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) , "<STR_LIT>" . toCharArray ( ) } ; public static final char COMMENT_TAG_PREFIX = '<CHAR_LIT>' ; public static final String BLOCK_HEADER = "<STR_LIT>" ; public static final int BLOCK_HEADER_LENGTH = BLOCK_HEADER . length ( ) ; public static final String JAVADOC_HEADER = "<STR_LIT>" ; public static final int JAVADOC_HEADER_LENGTH = JAVADOC_HEADER . length ( ) ; public static final String BLOCK_LINE_PREFIX = "<STR_LIT>" ; public static final int BLOCK_LINE_PREFIX_LENGTH = BLOCK_LINE_PREFIX . length ( ) ; public static final String BLOCK_FOOTER = "<STR_LIT>" ; public static final int BLOCK_FOOTER_LENGTH = BLOCK_FOOTER . length ( ) ; public static final String LINE_COMMENT_PREFIX = "<STR_LIT>" ; public static final int LINE_COMMENT_PREFIX_LENGTH = LINE_COMMENT_PREFIX . length ( ) ; public static final String JAVADOC_STAR = "<STR_LIT:*>" ; static final int JAVADOC_TAGS_INDEX_MASK = <NUM_LIT> ; static final int JAVADOC_TAGS_ID_MASK = <NUM_LIT> ; static final int JAVADOC_SINGLE_BREAK_TAG_ID = <NUM_LIT> ; static final int JAVADOC_CODE_TAGS_ID = <NUM_LIT> ; static final int JAVADOC_BREAK_TAGS_ID = <NUM_LIT> ; static final int JAVADOC_IMMUTABLE_TAGS_ID = <NUM_LIT> ; static final int JAVADOC_SEPARATOR_TAGS_ID = <NUM_LIT> ; static final int JAVADOC_SINGLE_TAGS_ID = JAVADOC_SINGLE_BREAK_TAG_ID ; static final int JAVADOC_CLOSED_TAG = <NUM_LIT> ; } </s>
|
<s> package org . eclipse . jdt . internal . formatter . comment ; import java . io . IOException ; import java . io . Reader ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public abstract class SubstitutionTextReader extends Reader { private Reader fReader ; private boolean fWasWhiteSpace ; private int fCharAfterWhiteSpace ; private boolean fSkipWhiteSpace = true ; private boolean fReadFromBuffer ; private StringBuffer fBuffer ; private int fIndex ; protected SubstitutionTextReader ( Reader reader ) { this . fReader = reader ; this . fBuffer = new StringBuffer ( ) ; this . fIndex = <NUM_LIT:0> ; this . fReadFromBuffer = false ; this . fCharAfterWhiteSpace = - <NUM_LIT:1> ; this . fWasWhiteSpace = true ; } public String getString ( ) throws IOException { StringBuffer buf = new StringBuffer ( ) ; int ch ; while ( ( ch = read ( ) ) != - <NUM_LIT:1> ) { buf . append ( ( char ) ch ) ; } return buf . toString ( ) ; } protected abstract String computeSubstitution ( int c ) throws IOException ; protected Reader getReader ( ) { return this . fReader ; } protected int nextChar ( ) throws IOException { this . fReadFromBuffer = ( this . fBuffer . length ( ) > <NUM_LIT:0> ) ; if ( this . fReadFromBuffer ) { char ch = this . fBuffer . charAt ( this . fIndex ++ ) ; if ( this . fIndex >= this . fBuffer . length ( ) ) { this . fBuffer . setLength ( <NUM_LIT:0> ) ; this . fIndex = <NUM_LIT:0> ; } return ch ; } else { int ch = this . fCharAfterWhiteSpace ; if ( ch == - <NUM_LIT:1> ) { ch = this . fReader . read ( ) ; } if ( this . fSkipWhiteSpace && ScannerHelper . isWhitespace ( ( char ) ch ) ) { do { ch = this . fReader . read ( ) ; } while ( ScannerHelper . isWhitespace ( ( char ) ch ) ) ; if ( ch != - <NUM_LIT:1> ) { this . fCharAfterWhiteSpace = ch ; return '<CHAR_LIT:U+0020>' ; } } else { this . fCharAfterWhiteSpace = - <NUM_LIT:1> ; } return ch ; } } public int read ( ) throws IOException { int c ; do { c = nextChar ( ) ; while ( ! this . fReadFromBuffer && c != - <NUM_LIT:1> ) { String s = computeSubstitution ( c ) ; if ( s == null ) break ; if ( s . length ( ) > <NUM_LIT:0> ) this . fBuffer . insert ( <NUM_LIT:0> , s ) ; c = nextChar ( ) ; } } while ( this . fSkipWhiteSpace && this . fWasWhiteSpace && ( c == '<CHAR_LIT:U+0020>' ) ) ; this . fWasWhiteSpace = ( c == '<CHAR_LIT:U+0020>' || c == '<STR_LIT>' || c == '<STR_LIT:\n>' ) ; return c ; } public int read ( char cbuf [ ] , int off , int len ) throws IOException { int end = off + len ; for ( int i = off ; i < end ; i ++ ) { int ch = read ( ) ; if ( ch == - <NUM_LIT:1> ) { if ( i == off ) { return - <NUM_LIT:1> ; } else { return i - off ; } } cbuf [ i ] = ( char ) ch ; } return len ; } public boolean ready ( ) throws IOException { return this . fReader . ready ( ) ; } public void close ( ) throws IOException { this . fReader . close ( ) ; } public void reset ( ) throws IOException { this . fReader . reset ( ) ; this . fWasWhiteSpace = true ; this . fCharAfterWhiteSpace = - <NUM_LIT:1> ; this . fBuffer . setLength ( <NUM_LIT:0> ) ; this . fIndex = <NUM_LIT:0> ; } protected final void setSkipWhitespace ( boolean state ) { this . fSkipWhiteSpace = state ; } protected final boolean isSkippingWhitespace ( ) { return this . fSkipWhiteSpace ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; public class AbortFormatting extends RuntimeException { Throwable nestedException ; private static final long serialVersionUID = - <NUM_LIT> ; public AbortFormatting ( String message ) { super ( message ) ; } public AbortFormatting ( Throwable nestedException ) { super ( nestedException . getMessage ( ) ) ; this . nestedException = nestedException ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; public class Location { public int inputOffset ; public int inputColumn ; public int outputLine ; public int outputColumn ; public int outputIndentationLevel ; public boolean needSpace ; public boolean pendingSpace ; public int nlsTagCounter ; public int lastLocalDeclarationSourceStart ; public int numberOfIndentations ; public int lastNumberOfNewLines ; int editsIndex ; OptimizedReplaceEdit textEdit ; public Location ( Scribe scribe , int sourceRestart ) { update ( scribe , sourceRestart ) ; } public void update ( Scribe scribe , int sourceRestart ) { this . outputColumn = scribe . column ; this . outputLine = scribe . line ; this . inputOffset = sourceRestart ; this . inputColumn = scribe . getCurrentIndentation ( sourceRestart ) + <NUM_LIT:1> ; this . outputIndentationLevel = scribe . indentationLevel ; this . lastNumberOfNewLines = scribe . lastNumberOfNewLines ; this . needSpace = scribe . needSpace ; this . pendingSpace = scribe . pendingSpace ; this . editsIndex = scribe . editsIndex ; this . nlsTagCounter = scribe . nlsTagCounter ; this . numberOfIndentations = scribe . numberOfIndentations ; this . textEdit = scribe . getLastEdit ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" + this . outputColumn ) ; buffer . append ( "<STR_LIT>" + this . outputLine ) ; buffer . append ( "<STR_LIT>" + this . outputIndentationLevel ) ; buffer . append ( "<STR_LIT>" + this . inputOffset ) ; buffer . append ( "<STR_LIT>" + this . inputColumn ) ; buffer . append ( '<CHAR_LIT:)>' ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; public class OptimizedReplaceEdit { int offset ; int length ; String replacement ; public OptimizedReplaceEdit ( int offset , int length , String replacement ) { this . offset = offset ; this . length = length ; this . replacement = replacement ; } public String toString ( ) { return "<STR_LIT:(>" + this . offset + "<STR_LIT>" + this . length + "<STR_LIT>" + this . replacement + "<STR_LIT:<>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . util . ArrayList ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ast . AND_AND_Expression ; import org . eclipse . jdt . internal . compiler . ast . AllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . ArrayAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . ArrayInitializer ; import org . eclipse . jdt . internal . compiler . ast . ArrayQualifiedTypeReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayReference ; import org . eclipse . jdt . internal . compiler . ast . ArrayTypeReference ; import org . eclipse . jdt . internal . compiler . ast . Assignment ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . BinaryExpression ; import org . eclipse . jdt . internal . compiler . ast . CastExpression ; import org . eclipse . jdt . internal . compiler . ast . CharLiteral ; import org . eclipse . jdt . internal . compiler . ast . ClassLiteralAccess ; import org . eclipse . jdt . internal . compiler . ast . CombinedBinaryExpression ; import org . eclipse . jdt . internal . compiler . ast . CompoundAssignment ; import org . eclipse . jdt . internal . compiler . ast . ConditionalExpression ; import org . eclipse . jdt . internal . compiler . ast . DoubleLiteral ; import org . eclipse . jdt . internal . compiler . ast . EqualExpression ; import org . eclipse . jdt . internal . compiler . ast . Expression ; import org . eclipse . jdt . internal . compiler . ast . ExtendedStringLiteral ; import org . eclipse . jdt . internal . compiler . ast . FalseLiteral ; import org . eclipse . jdt . internal . compiler . ast . FieldReference ; import org . eclipse . jdt . internal . compiler . ast . FloatLiteral ; import org . eclipse . jdt . internal . compiler . ast . InstanceOfExpression ; import org . eclipse . jdt . internal . compiler . ast . IntLiteral ; import org . eclipse . jdt . internal . compiler . ast . LongLiteral ; import org . eclipse . jdt . internal . compiler . ast . MessageSend ; import org . eclipse . jdt . internal . compiler . ast . StringLiteralConcatenation ; import org . eclipse . jdt . internal . compiler . ast . NullLiteral ; import org . eclipse . jdt . internal . compiler . ast . OR_OR_Expression ; import org . eclipse . jdt . internal . compiler . ast . OperatorIds ; import org . eclipse . jdt . internal . compiler . ast . PostfixExpression ; import org . eclipse . jdt . internal . compiler . ast . PrefixExpression ; import org . eclipse . jdt . internal . compiler . ast . QualifiedAllocationExpression ; import org . eclipse . jdt . internal . compiler . ast . QualifiedNameReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedSuperReference ; import org . eclipse . jdt . internal . compiler . ast . QualifiedThisReference ; import org . eclipse . jdt . internal . compiler . ast . SingleNameReference ; import org . eclipse . jdt . internal . compiler . ast . StringLiteral ; import org . eclipse . jdt . internal . compiler . ast . SuperReference ; import org . eclipse . jdt . internal . compiler . ast . ThisReference ; import org . eclipse . jdt . internal . compiler . ast . TrueLiteral ; import org . eclipse . jdt . internal . compiler . ast . UnaryExpression ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; class BinaryExpressionFragmentBuilder extends ASTVisitor { ArrayList fragmentsList ; ArrayList operatorsList ; private int realFragmentsSize ; BinaryExpressionFragmentBuilder ( ) { this . fragmentsList = new ArrayList ( ) ; this . operatorsList = new ArrayList ( ) ; this . realFragmentsSize = <NUM_LIT:0> ; } private final void addRealFragment ( ASTNode node ) { this . fragmentsList . add ( node ) ; this . realFragmentsSize ++ ; } private final void addSmallFragment ( ASTNode node ) { this . fragmentsList . add ( node ) ; } private boolean buildFragments ( Expression expression ) { if ( ( ( expression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { addRealFragment ( expression ) ; return false ; } return true ; } public ASTNode [ ] fragments ( ) { ASTNode [ ] fragments = new ASTNode [ this . fragmentsList . size ( ) ] ; this . fragmentsList . toArray ( fragments ) ; return fragments ; } public int [ ] operators ( ) { int length = this . operatorsList . size ( ) ; int [ ] tab = new int [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { tab [ i ] = ( ( Integer ) this . operatorsList . get ( i ) ) . intValue ( ) ; } return tab ; } public int realFragmentsSize ( ) { return this . realFragmentsSize ; } public boolean visit ( AllocationExpression allocationExpression , BlockScope scope ) { addRealFragment ( allocationExpression ) ; return false ; } public boolean visit ( AND_AND_Expression and_and_Expression , BlockScope scope ) { if ( ( ( and_and_Expression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { addRealFragment ( and_and_Expression ) ; } else { and_and_Expression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameAND_AND ) ) ; and_and_Expression . right . traverse ( this , scope ) ; } return false ; } public boolean visit ( ArrayAllocationExpression arrayAllocationExpression , BlockScope scope ) { addRealFragment ( arrayAllocationExpression ) ; return false ; } public boolean visit ( ArrayInitializer arrayInitializer , BlockScope scope ) { addRealFragment ( arrayInitializer ) ; return false ; } public boolean visit ( ArrayQualifiedTypeReference arrayQualifiedTypeReference , BlockScope scope ) { addRealFragment ( arrayQualifiedTypeReference ) ; return false ; } public boolean visit ( ArrayQualifiedTypeReference arrayQualifiedTypeReference , ClassScope scope ) { addRealFragment ( arrayQualifiedTypeReference ) ; return false ; } public boolean visit ( ArrayReference arrayReference , BlockScope scope ) { addRealFragment ( arrayReference ) ; return false ; } public boolean visit ( ArrayTypeReference arrayTypeReference , BlockScope scope ) { addRealFragment ( arrayTypeReference ) ; return false ; } public boolean visit ( ArrayTypeReference arrayTypeReference , ClassScope scope ) { addRealFragment ( arrayTypeReference ) ; return false ; } public boolean visit ( Assignment assignment , BlockScope scope ) { addRealFragment ( assignment ) ; return false ; } public boolean visit ( BinaryExpression binaryExpression , BlockScope scope ) { if ( binaryExpression instanceof CombinedBinaryExpression ) { CombinedBinaryExpression expression = ( CombinedBinaryExpression ) binaryExpression ; if ( expression . referencesTable != null ) { return this . visit ( expression , scope ) ; } } final int numberOfParens = ( binaryExpression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ; if ( numberOfParens > <NUM_LIT:0> ) { addRealFragment ( binaryExpression ) ; } else { switch ( ( binaryExpression . bits & ASTNode . OperatorMASK ) > > ASTNode . OperatorSHIFT ) { case OperatorIds . PLUS : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNamePLUS ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . MINUS : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameMINUS ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . MULTIPLY : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameMULTIPLY ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . REMAINDER : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameREMAINDER ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . XOR : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameXOR ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . DIVIDE : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameDIVIDE ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . OR : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameOR ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; case OperatorIds . AND : if ( buildFragments ( binaryExpression ) ) { binaryExpression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameAND ) ) ; binaryExpression . right . traverse ( this , scope ) ; } return false ; default : addRealFragment ( binaryExpression ) ; } } return false ; } public boolean visit ( CombinedBinaryExpression combinedBinaryExpression , BlockScope scope ) { if ( combinedBinaryExpression . referencesTable == null ) { addRealFragment ( combinedBinaryExpression . left ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNamePLUS ) ) ; addRealFragment ( combinedBinaryExpression . right ) ; return false ; } BinaryExpression cursor = combinedBinaryExpression . referencesTable [ <NUM_LIT:0> ] ; if ( cursor . left instanceof CombinedBinaryExpression ) { this . visit ( ( CombinedBinaryExpression ) cursor . left , scope ) ; } else { addRealFragment ( cursor . left ) ; } for ( int i = <NUM_LIT:0> , end = combinedBinaryExpression . arity ; i < end ; i ++ ) { this . operatorsList . add ( new Integer ( TerminalTokens . TokenNamePLUS ) ) ; addRealFragment ( combinedBinaryExpression . referencesTable [ i ] . right ) ; } this . operatorsList . add ( new Integer ( TerminalTokens . TokenNamePLUS ) ) ; addRealFragment ( combinedBinaryExpression . right ) ; return false ; } public boolean visit ( CastExpression castExpression , BlockScope scope ) { addRealFragment ( castExpression ) ; return false ; } public boolean visit ( CharLiteral charLiteral , BlockScope scope ) { addSmallFragment ( charLiteral ) ; return false ; } public boolean visit ( ClassLiteralAccess classLiteralAccess , BlockScope scope ) { addRealFragment ( classLiteralAccess ) ; return false ; } public boolean visit ( CompoundAssignment compoundAssignment , BlockScope scope ) { addRealFragment ( compoundAssignment ) ; return false ; } public boolean visit ( ConditionalExpression conditionalExpression , BlockScope scope ) { addRealFragment ( conditionalExpression ) ; return false ; } public boolean visit ( DoubleLiteral doubleLiteral , BlockScope scope ) { addSmallFragment ( doubleLiteral ) ; return false ; } public boolean visit ( EqualExpression equalExpression , BlockScope scope ) { addRealFragment ( equalExpression ) ; return false ; } public boolean visit ( ExtendedStringLiteral extendedStringLiteral , BlockScope scope ) { addRealFragment ( extendedStringLiteral ) ; return false ; } public boolean visit ( FalseLiteral falseLiteral , BlockScope scope ) { addSmallFragment ( falseLiteral ) ; return false ; } public boolean visit ( FieldReference fieldReference , BlockScope scope ) { addRealFragment ( fieldReference ) ; return false ; } public boolean visit ( FloatLiteral floatLiteral , BlockScope scope ) { addSmallFragment ( floatLiteral ) ; return false ; } public boolean visit ( InstanceOfExpression instanceOfExpression , BlockScope scope ) { addRealFragment ( instanceOfExpression ) ; return false ; } public boolean visit ( IntLiteral intLiteral , BlockScope scope ) { addSmallFragment ( intLiteral ) ; return false ; } public boolean visit ( LongLiteral longLiteral , BlockScope scope ) { addSmallFragment ( longLiteral ) ; return false ; } public boolean visit ( MessageSend messageSend , BlockScope scope ) { addRealFragment ( messageSend ) ; return false ; } public boolean visit ( StringLiteralConcatenation stringLiteral , BlockScope scope ) { if ( ( ( stringLiteral . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { addRealFragment ( stringLiteral ) ; } else { for ( int i = <NUM_LIT:0> , max = stringLiteral . counter ; i < max ; i ++ ) { addRealFragment ( stringLiteral . literals [ i ] ) ; if ( i < max - <NUM_LIT:1> ) { this . operatorsList . add ( new Integer ( TerminalTokens . TokenNamePLUS ) ) ; } } } return false ; } public boolean visit ( NullLiteral nullLiteral , BlockScope scope ) { addRealFragment ( nullLiteral ) ; return false ; } public boolean visit ( OR_OR_Expression or_or_Expression , BlockScope scope ) { if ( ( ( or_or_Expression . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT ) != <NUM_LIT:0> ) { addRealFragment ( or_or_Expression ) ; } else { or_or_Expression . left . traverse ( this , scope ) ; this . operatorsList . add ( new Integer ( TerminalTokens . TokenNameOR_OR ) ) ; or_or_Expression . right . traverse ( this , scope ) ; } return false ; } public boolean visit ( PostfixExpression postfixExpression , BlockScope scope ) { addRealFragment ( postfixExpression ) ; return false ; } public boolean visit ( PrefixExpression prefixExpression , BlockScope scope ) { addRealFragment ( prefixExpression ) ; return false ; } public boolean visit ( QualifiedAllocationExpression qualifiedAllocationExpression , BlockScope scope ) { addRealFragment ( qualifiedAllocationExpression ) ; return false ; } public boolean visit ( QualifiedNameReference qualifiedNameReference , BlockScope scope ) { addRealFragment ( qualifiedNameReference ) ; return false ; } public boolean visit ( QualifiedSuperReference qualifiedSuperReference , BlockScope scope ) { addRealFragment ( qualifiedSuperReference ) ; return false ; } public boolean visit ( QualifiedThisReference qualifiedThisReference , BlockScope scope ) { addRealFragment ( qualifiedThisReference ) ; return false ; } public boolean visit ( SingleNameReference singleNameReference , BlockScope scope ) { addRealFragment ( singleNameReference ) ; return false ; } public boolean visit ( StringLiteral stringLiteral , BlockScope scope ) { addRealFragment ( stringLiteral ) ; return false ; } public boolean visit ( SuperReference superReference , BlockScope scope ) { addRealFragment ( superReference ) ; return false ; } public boolean visit ( ThisReference thisReference , BlockScope scope ) { addRealFragment ( thisReference ) ; return false ; } public boolean visit ( TrueLiteral trueLiteral , BlockScope scope ) { addSmallFragment ( trueLiteral ) ; return false ; } public boolean visit ( UnaryExpression unaryExpression , BlockScope scope ) { addRealFragment ( unaryExpression ) ; return false ; } public int size ( ) { return this . fragmentsList . size ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; public class FormatJavadocReference extends FormatJavadocNode { public FormatJavadocReference ( int start , int end , int line ) { super ( start , end , line ) ; } public FormatJavadocReference ( long position , int line ) { super ( ( int ) ( position > > > <NUM_LIT:32> ) , ( int ) position , line ) ; } void clean ( ) { } protected void toString ( StringBuffer buffer ) { buffer . append ( "<STR_LIT>" ) ; super . toString ( buffer ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . util . List ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . parser . JavadocParser ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . formatter . comment . IJavaDocTagConstants ; public class FormatterCommentParser extends JavadocParser implements IJavaDocTagConstants { char [ ] [ ] htmlTags ; int htmlTagsPtr = - <NUM_LIT:1> ; int inlineHtmlTagsPtr = - <NUM_LIT:1> ; private boolean invalidTagName ; public boolean parseHtmlTags ; public FormatterCommentParser ( long sourceLevel ) { super ( null ) ; this . kind = FORMATTER_COMMENT_PARSER | TEXT_PARSE ; this . reportProblems = false ; this . checkDocComment = true ; this . sourceLevel = sourceLevel ; } public boolean parse ( int start , int end ) { this . javadocStart = start ; this . javadocEnd = end ; this . firstTagPosition = this . javadocStart ; this . htmlTagsPtr = - <NUM_LIT:1> ; boolean valid = commentParse ( ) ; return valid && this . docComment != null ; } protected Object createArgumentReference ( char [ ] name , int dim , boolean isVarargs , Object ref , long [ ] dimPositions , long argNamePos ) throws InvalidInputException { FormatJavadocReference typeRef = ( FormatJavadocReference ) ref ; if ( dim > <NUM_LIT:0> ) { typeRef . sourceEnd = ( int ) dimPositions [ dim - <NUM_LIT:1> ] ; } if ( argNamePos >= <NUM_LIT:0> ) typeRef . sourceEnd = ( int ) argNamePos ; return ref ; } protected boolean createFakeReference ( int start ) { this . scanner . currentPosition = this . index ; int lineStart = this . scanner . getLineNumber ( start ) ; FormatJavadocReference reference = new FormatJavadocReference ( start , this . index - <NUM_LIT:1> , lineStart ) ; return pushSeeRef ( reference ) ; } protected Object createFieldReference ( Object receiver ) throws InvalidInputException { int start = receiver == null ? this . memberStart : ( ( FormatJavadocReference ) receiver ) . sourceStart ; int lineStart = this . scanner . getLineNumber ( start ) ; return new FormatJavadocReference ( start , ( int ) this . identifierPositionStack [ <NUM_LIT:0> ] , lineStart ) ; } protected Object createMethodReference ( Object receiver , List arguments ) throws InvalidInputException { int start = receiver == null ? this . memberStart : ( ( FormatJavadocReference ) receiver ) . sourceStart ; int lineStart = this . scanner . getLineNumber ( start ) ; return new FormatJavadocReference ( start , this . scanner . getCurrentTokenEndPosition ( ) , lineStart ) ; } protected void createTag ( ) { int lineStart = this . scanner . getLineNumber ( this . tagSourceStart ) ; if ( this . inlineTagStarted ) { FormatJavadocBlock block = new FormatJavadocBlock ( this . inlineTagStart , this . tagSourceEnd , lineStart , this . tagValue ) ; FormatJavadocBlock previousBlock = null ; if ( this . astPtr == - <NUM_LIT:1> ) { previousBlock = new FormatJavadocBlock ( this . inlineTagStart , this . tagSourceEnd , lineStart , NO_TAG_VALUE ) ; pushOnAstStack ( previousBlock , true ) ; } else { previousBlock = ( FormatJavadocBlock ) this . astStack [ this . astPtr ] ; } previousBlock . addBlock ( block , this . htmlTagsPtr == - <NUM_LIT:1> ? <NUM_LIT:0> : this . htmlTagsPtr ) ; } else { FormatJavadocBlock block = new FormatJavadocBlock ( this . tagSourceStart , this . tagSourceEnd , lineStart , this . tagValue ) ; pushOnAstStack ( block , true ) ; } } protected Object createTypeReference ( int primitiveToken ) { int size = this . identifierLengthStack [ this . identifierLengthPtr ] ; if ( size == <NUM_LIT:0> ) return null ; int start = ( int ) ( this . identifierPositionStack [ this . identifierPtr ] > > > <NUM_LIT:32> ) ; int lineStart = this . scanner . getLineNumber ( start ) ; if ( size == <NUM_LIT:1> ) { return new FormatJavadocReference ( this . identifierPositionStack [ this . identifierPtr ] , lineStart ) ; } long [ ] positions = new long [ size ] ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr - size + <NUM_LIT:1> , positions , <NUM_LIT:0> , size ) ; return new FormatJavadocReference ( ( int ) ( positions [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) , ( int ) positions [ positions . length - <NUM_LIT:1> ] , lineStart ) ; } private int getHtmlTagIndex ( char [ ] htmlTag ) { int length = htmlTag == null ? <NUM_LIT:0> : htmlTag . length ; int tagId = <NUM_LIT:0> ; if ( length > <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , max = JAVADOC_SINGLE_BREAK_TAG . length ; i < max ; i ++ ) { char [ ] tag = JAVADOC_SINGLE_BREAK_TAG [ i ] ; if ( length == tag . length && CharOperation . equals ( htmlTag , tag , false ) ) { return ( tagId | JAVADOC_SINGLE_BREAK_TAG_ID ) + i ; } } for ( int i = <NUM_LIT:0> , max = JAVADOC_CODE_TAGS . length ; i < max ; i ++ ) { char [ ] tag = JAVADOC_CODE_TAGS [ i ] ; if ( length == tag . length && CharOperation . equals ( htmlTag , tag , false ) ) { return ( tagId | JAVADOC_CODE_TAGS_ID ) + i ; } } for ( int i = <NUM_LIT:0> , max = JAVADOC_BREAK_TAGS . length ; i < max ; i ++ ) { char [ ] tag = JAVADOC_BREAK_TAGS [ i ] ; if ( length == tag . length && CharOperation . equals ( htmlTag , tag , false ) ) { return ( tagId | JAVADOC_BREAK_TAGS_ID ) + i ; } } for ( int i = <NUM_LIT:0> , max = JAVADOC_IMMUTABLE_TAGS . length ; i < max ; i ++ ) { char [ ] tag = JAVADOC_IMMUTABLE_TAGS [ i ] ; if ( length == tag . length && CharOperation . equals ( htmlTag , tag , false ) ) { return ( tagId | JAVADOC_IMMUTABLE_TAGS_ID ) + i ; } } for ( int i = <NUM_LIT:0> , max = JAVADOC_SEPARATOR_TAGS . length ; i < max ; i ++ ) { char [ ] tag = JAVADOC_SEPARATOR_TAGS [ i ] ; if ( length == tag . length && CharOperation . equals ( htmlTag , tag , false ) ) { return ( tagId | JAVADOC_SEPARATOR_TAGS_ID ) + i ; } } } return JAVADOC_TAGS_ID_MASK ; } protected boolean parseHtmlTag ( int previousPosition , int endTextPosition ) throws InvalidInputException { if ( ! this . parseHtmlTags ) return false ; boolean closing = false ; boolean valid = false ; boolean incremented = false ; int start = this . scanner . currentPosition ; int currentPosition = start ; int htmlPtr = this . htmlTagsPtr ; char firstChar = peekChar ( ) ; boolean hasWhitespaces = firstChar == '<CHAR_LIT:U+0020>' || ScannerHelper . isWhitespace ( firstChar ) ; try { int token = readTokenAndConsume ( ) ; char [ ] htmlTag ; int htmlIndex ; switch ( token ) { case TerminalTokens . TokenNameIdentifier : htmlTag = this . scanner . getCurrentIdentifierSource ( ) ; htmlIndex = getHtmlTagIndex ( htmlTag ) ; if ( htmlIndex == JAVADOC_TAGS_ID_MASK ) return false ; if ( htmlPtr >= <NUM_LIT:0> ) { int lastHtmlTagIndex = getHtmlTagIndex ( this . htmlTags [ htmlPtr ] ) ; if ( ( lastHtmlTagIndex & JAVADOC_TAGS_ID_MASK ) == JAVADOC_IMMUTABLE_TAGS_ID ) { if ( ( htmlIndex & JAVADOC_TAGS_ID_MASK ) == JAVADOC_CODE_TAGS_ID ) { FormatJavadocBlock previousBlock = ( FormatJavadocBlock ) this . astStack [ this . astPtr ] ; FormatJavadocNode parentNode = previousBlock ; FormatJavadocNode lastNode = parentNode ; while ( lastNode . getLastNode ( ) != null ) { parentNode = lastNode ; lastNode = lastNode . getLastNode ( ) ; } if ( lastNode . isText ( ) ) { FormatJavadocText text = ( FormatJavadocText ) lastNode ; if ( text . separatorsPtr == - <NUM_LIT:1> ) { break ; } } } return false ; } } if ( ( htmlIndex & JAVADOC_TAGS_ID_MASK ) > JAVADOC_SINGLE_TAGS_ID ) { if ( this . htmlTagsPtr == - <NUM_LIT:1> || ! CharOperation . equals ( this . htmlTags [ this . htmlTagsPtr ] , htmlTag , false ) ) { if ( ++ this . htmlTagsPtr == <NUM_LIT:0> ) { this . htmlTags = new char [ AST_STACK_INCREMENT ] [ ] ; } else { if ( this . htmlTagsPtr == this . htmlTags . length ) { System . arraycopy ( this . htmlTags , <NUM_LIT:0> , ( this . htmlTags = new char [ this . htmlTags . length + AST_STACK_INCREMENT ] [ ] ) , <NUM_LIT:0> , this . htmlTagsPtr ) ; } } this . htmlTags [ this . htmlTagsPtr ] = htmlTag ; incremented = true ; } } currentPosition = this . scanner . currentPosition ; if ( readToken ( ) == TerminalTokens . TokenNameDIVIDE ) { consumeToken ( ) ; } break ; case TerminalTokens . TokenNameDIVIDE : if ( this . htmlTagsPtr == - <NUM_LIT:1> ) return false ; htmlTag = this . htmlTags [ this . htmlTagsPtr ] ; if ( ( token = readTokenAndConsume ( ) ) != TerminalTokens . TokenNameIdentifier ) { return false ; } char [ ] identifier = this . scanner . getCurrentIdentifierSource ( ) ; htmlIndex = getHtmlTagIndex ( identifier ) ; if ( htmlIndex == JAVADOC_TAGS_ID_MASK ) return false ; int ptr = this . htmlTagsPtr ; while ( ! CharOperation . equals ( htmlTag , identifier , false ) ) { if ( this . htmlTagsPtr <= <NUM_LIT:0> ) { this . htmlTagsPtr = ptr ; return false ; } this . htmlTagsPtr -- ; htmlTag = this . htmlTags [ this . htmlTagsPtr ] ; } htmlIndex |= JAVADOC_CLOSED_TAG ; closing = true ; currentPosition = this . scanner . currentPosition ; break ; default : return false ; } switch ( readTokenAndConsume ( ) ) { case TerminalTokens . TokenNameLESS : case TerminalTokens . TokenNameLESS_EQUAL : return false ; case TerminalTokens . TokenNameGREATER : break ; case TerminalTokens . TokenNameGREATER_EQUAL : case TerminalTokens . TokenNameRIGHT_SHIFT : case TerminalTokens . TokenNameRIGHT_SHIFT_EQUAL : break ; default : this . index = currentPosition ; loop : while ( true ) { switch ( readChar ( ) ) { case '<CHAR_LIT>' : if ( hasWhitespaces ) { return false ; } this . index = currentPosition ; this . scanner . startPosition = currentPosition ; this . scanner . currentPosition = currentPosition ; this . scanner . currentCharacter = '<CHAR_LIT>' ; break loop ; case '<CHAR_LIT:>>' : this . scanner . startPosition = this . index ; this . scanner . currentPosition = this . index ; this . scanner . currentCharacter = peekChar ( ) ; break loop ; default : break ; } if ( this . index >= this . javadocTextEnd ) { this . index = currentPosition ; this . scanner . startPosition = currentPosition ; this . scanner . currentPosition = currentPosition ; break ; } } } if ( this . lineStarted && this . textStart != - <NUM_LIT:1> && this . textStart < endTextPosition ) { pushText ( this . textStart , endTextPosition , - <NUM_LIT:1> , htmlPtr ) ; } pushText ( previousPosition , this . index , htmlIndex , this . htmlTagsPtr ) ; this . textStart = - <NUM_LIT:1> ; valid = true ; } finally { if ( valid ) { if ( closing ) { this . htmlTagsPtr -- ; } } else if ( ! this . abort ) { if ( incremented ) { this . htmlTagsPtr -- ; if ( this . htmlTagsPtr == - <NUM_LIT:1> ) this . htmlTags = null ; } this . scanner . resetTo ( start , this . scanner . eofPosition - <NUM_LIT:1> ) ; this . index = start ; } } return valid ; } protected boolean parseIdentifierTag ( boolean report ) { if ( super . parseIdentifierTag ( report ) ) { createTag ( ) ; this . index = this . tagSourceEnd + <NUM_LIT:1> ; this . scanner . resetTo ( this . index , this . javadocEnd ) ; return true ; } this . tagValue = TAG_OTHERS_VALUE ; return false ; } protected boolean parseParam ( ) throws InvalidInputException { boolean valid = super . parseParam ( ) ; if ( ! valid ) { this . scanner . resetTo ( this . tagSourceEnd + <NUM_LIT:1> , this . javadocEnd ) ; this . index = this . tagSourceEnd + <NUM_LIT:1> ; char ch = peekChar ( ) ; if ( ch == '<CHAR_LIT:U+0020>' || ScannerHelper . isWhitespace ( ch ) ) { int token = this . scanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameIdentifier ) { ch = peekChar ( ) ; if ( ch == '<CHAR_LIT:U+0020>' || ScannerHelper . isWhitespace ( ch ) ) { pushIdentifier ( true , false ) ; pushParamName ( false ) ; this . index = this . scanner . currentPosition ; valid = true ; } } this . scanner . resetTo ( this . tagSourceEnd + <NUM_LIT:1> , this . javadocEnd ) ; } this . tagValue = TAG_OTHERS_VALUE ; } return valid ; } protected boolean parseReference ( ) throws InvalidInputException { boolean valid = super . parseReference ( ) ; if ( ! valid ) { this . scanner . resetTo ( this . tagSourceEnd + <NUM_LIT:1> , this . javadocEnd ) ; this . index = this . tagSourceEnd + <NUM_LIT:1> ; this . tagValue = TAG_OTHERS_VALUE ; } return valid ; } protected boolean parseReturn ( ) { createTag ( ) ; return true ; } protected boolean parseTag ( int previousPosition ) throws InvalidInputException { if ( this . htmlTagsPtr >= <NUM_LIT:0> ) { int ptr = this . htmlTagsPtr ; while ( ptr >= <NUM_LIT:0> ) { if ( getHtmlTagIndex ( this . htmlTags [ ptr -- ] ) == JAVADOC_CODE_TAGS_ID ) { if ( this . textStart == - <NUM_LIT:1> ) this . textStart = this . inlineTagStarted ? this . inlineTagStart : previousPosition ; this . inlineTagStarted = false ; return true ; } } } int ptr = this . astPtr ; this . tagSourceStart = previousPosition ; this . scanner . startPosition = this . index ; this . scanner . currentCharacter = readChar ( ) ; switch ( this . scanner . currentCharacter ) { case '<CHAR_LIT:U+0020>' : case '<CHAR_LIT>' : case '<CHAR_LIT:}>' : this . tagSourceEnd = previousPosition ; if ( this . textStart == - <NUM_LIT:1> ) this . textStart = previousPosition ; return true ; default : if ( ScannerHelper . isWhitespace ( this . scanner . currentCharacter ) ) { this . tagSourceEnd = previousPosition ; if ( this . textStart == - <NUM_LIT:1> ) this . textStart = previousPosition ; return true ; } break ; } int currentPosition = this . index ; char currentChar = this . scanner . currentCharacter ; while ( currentChar != '<CHAR_LIT:U+0020>' && currentChar != '<CHAR_LIT>' && currentChar != '<CHAR_LIT:}>' && ! ScannerHelper . isWhitespace ( currentChar ) ) { currentPosition = this . index ; currentChar = readChar ( ) ; } this . tagSourceEnd = currentPosition - <NUM_LIT:1> ; this . scanner . currentCharacter = currentChar ; this . scanner . currentPosition = currentPosition ; char [ ] tagName = this . scanner . getCurrentIdentifierSource ( ) ; int length = tagName . length ; this . index = this . tagSourceEnd + <NUM_LIT:1> ; this . tagValue = TAG_OTHERS_VALUE ; boolean valid = false ; switch ( tagName [ <NUM_LIT:0> ] ) { case '<CHAR_LIT:a>' : if ( length == TAG_AUTHOR_LENGTH && CharOperation . equals ( TAG_AUTHOR , tagName ) ) { this . tagValue = TAG_AUTHOR_VALUE ; } break ; case '<CHAR_LIT:c>' : if ( length == TAG_CATEGORY_LENGTH && CharOperation . equals ( TAG_CATEGORY , tagName ) ) { this . tagValue = TAG_CATEGORY_VALUE ; valid = parseIdentifierTag ( false ) ; } else if ( length == TAG_CODE_LENGTH && this . inlineTagStarted && CharOperation . equals ( TAG_CODE , tagName ) ) { this . tagValue = TAG_CODE_VALUE ; } break ; case '<CHAR_LIT>' : if ( length == TAG_DEPRECATED_LENGTH && CharOperation . equals ( TAG_DEPRECATED , tagName ) ) { this . deprecated = true ; valid = true ; this . tagValue = TAG_DEPRECATED_VALUE ; } else if ( length == TAG_DOC_ROOT_LENGTH && CharOperation . equals ( TAG_DOC_ROOT , tagName ) ) { valid = true ; this . tagValue = TAG_DOC_ROOT_VALUE ; } break ; case '<CHAR_LIT:e>' : if ( length == TAG_EXCEPTION_LENGTH && CharOperation . equals ( TAG_EXCEPTION , tagName ) ) { this . tagValue = TAG_EXCEPTION_VALUE ; valid = parseThrows ( ) ; } break ; case '<CHAR_LIT>' : if ( length == TAG_INHERITDOC_LENGTH && CharOperation . equals ( TAG_INHERITDOC , tagName ) ) { if ( this . reportProblems ) { recordInheritedPosition ( ( ( ( long ) this . tagSourceStart ) << <NUM_LIT:32> ) + this . tagSourceEnd ) ; } valid = true ; this . tagValue = TAG_INHERITDOC_VALUE ; } break ; case '<CHAR_LIT>' : if ( length == TAG_LINK_LENGTH && CharOperation . equals ( TAG_LINK , tagName ) ) { this . tagValue = TAG_LINK_VALUE ; if ( this . inlineTagStarted || ( this . kind & COMPLETION_PARSER ) != <NUM_LIT:0> ) { valid = parseReference ( ) ; } else { valid = false ; if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } } else if ( length == TAG_LINKPLAIN_LENGTH && CharOperation . equals ( TAG_LINKPLAIN , tagName ) ) { this . tagValue = TAG_LINKPLAIN_VALUE ; if ( this . inlineTagStarted ) { valid = parseReference ( ) ; } else { valid = false ; if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } } else if ( length == TAG_LITERAL_LENGTH && this . inlineTagStarted && CharOperation . equals ( TAG_LITERAL , tagName ) ) { this . tagValue = TAG_LITERAL_VALUE ; } break ; case '<CHAR_LIT>' : if ( length == TAG_PARAM_LENGTH && CharOperation . equals ( TAG_PARAM , tagName ) ) { this . tagValue = TAG_PARAM_VALUE ; valid = parseParam ( ) ; } break ; case '<CHAR_LIT>' : if ( length == TAG_SEE_LENGTH && CharOperation . equals ( TAG_SEE , tagName ) ) { if ( this . inlineTagStarted ) { valid = false ; if ( this . reportProblems ) { this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } else { this . tagValue = TAG_SEE_VALUE ; valid = parseReference ( ) ; } } else if ( length == TAG_SERIAL_LENGTH && CharOperation . equals ( TAG_SERIAL , tagName ) ) { this . tagValue = TAG_SERIAL_VALUE ; } else if ( length == TAG_SERIAL_DATA_LENGTH && CharOperation . equals ( TAG_SERIAL_DATA , tagName ) ) { this . tagValue = TAG_SERIAL_DATA_VALUE ; } else if ( length == TAG_SERIAL_FIELD_LENGTH && CharOperation . equals ( TAG_SERIAL_FIELD , tagName ) ) { this . tagValue = TAG_SERIAL_FIELD_VALUE ; } else if ( length == TAG_SINCE_LENGTH && CharOperation . equals ( TAG_SINCE , tagName ) ) { this . tagValue = TAG_SINCE_VALUE ; } break ; case '<CHAR_LIT>' : if ( length == TAG_VALUE_LENGTH && CharOperation . equals ( TAG_VALUE , tagName ) ) { this . tagValue = TAG_VALUE_VALUE ; if ( this . sourceLevel >= ClassFileConstants . JDK1_5 ) { if ( this . inlineTagStarted ) { valid = parseReference ( ) ; } else { valid = false ; if ( this . reportProblems ) this . sourceParser . problemReporter ( ) . javadocUnexpectedTag ( this . tagSourceStart , this . tagSourceEnd ) ; } } } else if ( length == TAG_VERSION_LENGTH && CharOperation . equals ( TAG_VERSION , tagName ) ) { this . tagValue = TAG_VERSION_VALUE ; } else { createTag ( ) ; } break ; case '<CHAR_LIT>' : if ( length == TAG_RETURN_LENGTH && CharOperation . equals ( TAG_RETURN , tagName ) ) { this . tagValue = TAG_RETURN_VALUE ; valid = parseReturn ( ) ; } break ; case '<CHAR_LIT>' : if ( length == TAG_THROWS_LENGTH && CharOperation . equals ( TAG_THROWS , tagName ) ) { this . tagValue = TAG_THROWS_VALUE ; valid = parseThrows ( ) ; } break ; default : createTag ( ) ; break ; } consumeToken ( ) ; this . textStart = - <NUM_LIT:1> ; if ( valid ) { switch ( this . tagValue ) { case TAG_INHERITDOC_VALUE : case TAG_DEPRECATED_VALUE : createTag ( ) ; break ; } } else if ( this . invalidTagName ) { this . textStart = previousPosition ; } else if ( this . astPtr == ptr ) { createTag ( ) ; } return true ; } protected boolean parseThrows ( ) { boolean valid = super . parseThrows ( ) ; if ( ! valid ) { this . scanner . resetTo ( this . tagSourceEnd + <NUM_LIT:1> , this . javadocEnd ) ; this . index = this . tagSourceEnd + <NUM_LIT:1> ; this . tagValue = TAG_OTHERS_VALUE ; } return valid ; } protected boolean pushParamName ( boolean isTypeParam ) { int lineTagStart = this . scanner . getLineNumber ( this . tagSourceStart ) ; FormatJavadocBlock block = new FormatJavadocBlock ( this . tagSourceStart , this . tagSourceEnd , lineTagStart , TAG_PARAM_VALUE ) ; int start = ( int ) ( this . identifierPositionStack [ <NUM_LIT:0> ] > > > <NUM_LIT:32> ) ; int lineStart = this . scanner . getLineNumber ( start ) ; FormatJavadocReference reference ; reference = new FormatJavadocReference ( start , ( int ) this . identifierPositionStack [ isTypeParam ? <NUM_LIT:2> : <NUM_LIT:0> ] , lineStart ) ; block . reference = reference ; block . sourceEnd = reference . sourceEnd ; pushOnAstStack ( block , true ) ; return true ; } protected boolean pushSeeRef ( Object statement ) { FormatJavadocReference reference = ( FormatJavadocReference ) statement ; int lineTagStart = this . scanner . getLineNumber ( this . tagSourceStart ) ; FormatJavadocBlock block = new FormatJavadocBlock ( this . tagSourceStart , this . tagSourceEnd , lineTagStart , this . tagValue ) ; block . reference = reference ; block . sourceEnd = reference . sourceEnd ; if ( this . inlineTagStarted ) { block . sourceStart = this . inlineTagStart ; FormatJavadocBlock previousBlock = null ; if ( this . astPtr == - <NUM_LIT:1> ) { int lineStart = this . scanner . getLineNumber ( this . inlineTagStart ) ; previousBlock = new FormatJavadocBlock ( this . inlineTagStart , this . tagSourceEnd , lineStart , NO_TAG_VALUE ) ; previousBlock . sourceEnd = reference . sourceEnd ; pushOnAstStack ( previousBlock , true ) ; } else { previousBlock = ( FormatJavadocBlock ) this . astStack [ this . astPtr ] ; } previousBlock . addBlock ( block , this . htmlTagsPtr == - <NUM_LIT:1> ? <NUM_LIT:0> : this . htmlTagsPtr ) ; block . flags |= FormatJavadocBlock . INLINED ; } else { pushOnAstStack ( block , true ) ; } return true ; } protected void pushText ( int start , int end ) { pushText ( start , end , - <NUM_LIT:1> , this . htmlTagsPtr == - <NUM_LIT:1> ? <NUM_LIT:0> : this . htmlTagsPtr ) ; } private void pushText ( int start , int end , int htmlIndex , int htmlDepth ) { FormatJavadocBlock previousBlock = null ; int previousStart = start ; int lineStart = this . scanner . getLineNumber ( start ) ; if ( this . astPtr == - <NUM_LIT:1> ) { previousBlock = new FormatJavadocBlock ( start , start , lineStart , NO_TAG_VALUE ) ; pushOnAstStack ( previousBlock , true ) ; } else { previousBlock = ( FormatJavadocBlock ) this . astStack [ this . astPtr ] ; previousStart = previousBlock . sourceStart ; } if ( this . inlineTagStarted ) { if ( previousBlock . nodes == null ) { } else { FormatJavadocNode lastNode = previousBlock . nodes [ previousBlock . nodesPtr ] ; while ( lastNode != null && lastNode . isText ( ) ) { lastNode = lastNode . getLastNode ( ) ; } if ( lastNode != null ) { previousBlock = ( FormatJavadocBlock ) lastNode ; previousStart = previousBlock . sourceStart ; } } } FormatJavadocText text = new FormatJavadocText ( start , end - <NUM_LIT:1> , lineStart , htmlIndex , htmlDepth == - <NUM_LIT:1> ? <NUM_LIT:0> : htmlDepth ) ; previousBlock . addText ( text ) ; previousBlock . sourceStart = previousStart ; if ( lineStart == previousBlock . lineStart ) { previousBlock . flags |= FormatJavadocBlock . TEXT_ON_TAG_LINE ; } this . textStart = - <NUM_LIT:1> ; } protected boolean pushThrowName ( Object typeRef ) { int lineStart = this . scanner . getLineNumber ( this . tagSourceStart ) ; FormatJavadocBlock block = new FormatJavadocBlock ( this . tagSourceStart , this . tagSourceEnd , lineStart , this . tagValue ) ; block . reference = ( FormatJavadocReference ) typeRef ; block . sourceEnd = block . reference . sourceEnd ; pushOnAstStack ( block , true ) ; return true ; } protected void refreshInlineTagPosition ( int previousPosition ) { if ( this . astPtr != - <NUM_LIT:1> ) { FormatJavadocNode previousBlock = ( FormatJavadocNode ) this . astStack [ this . astPtr ] ; if ( this . inlineTagStarted ) { FormatJavadocNode lastNode = previousBlock ; while ( lastNode != null ) { lastNode . sourceEnd = previousPosition ; lastNode = lastNode . getLastNode ( ) ; } } } } protected void setInlineTagStarted ( boolean started ) { super . setInlineTagStarted ( started ) ; if ( started ) { this . inlineHtmlTagsPtr = this . htmlTagsPtr ; } else { if ( this . htmlTagsPtr > this . inlineHtmlTagsPtr ) { this . htmlTagsPtr = this . inlineHtmlTagsPtr ; } } } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( super . toString ( ) ) ; return buffer . toString ( ) ; } public String toDebugString ( ) { if ( this . docComment == null ) { return "<STR_LIT>" ; } return ( ( FormatJavadoc ) this . docComment ) . toDebugString ( this . source ) ; } protected void updateDocComment ( ) { int length = this . astPtr + <NUM_LIT:1> ; FormatJavadoc formatJavadoc = new FormatJavadoc ( this . javadocStart , this . javadocEnd , length ) ; if ( length > <NUM_LIT:0> ) { formatJavadoc . blocks = new FormatJavadocBlock [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { FormatJavadocBlock block = ( FormatJavadocBlock ) this . astStack [ i ] ; block . clean ( ) ; block . update ( this . scanner ) ; formatJavadoc . blocks [ i ] = block ; if ( i == <NUM_LIT:0> ) { block . flags |= FormatJavadocBlock . FIRST ; } } } formatJavadoc . textStart = this . javadocTextStart ; formatJavadoc . textEnd = this . javadocTextEnd ; formatJavadoc . lineStart = this . scanner . getLineNumber ( this . javadocTextStart ) ; formatJavadoc . lineEnd = this . scanner . getLineNumber ( this . javadocTextEnd ) ; FormatJavadocBlock firstBlock = formatJavadoc . getFirstBlock ( ) ; if ( firstBlock != null ) { firstBlock . setHeaderLine ( formatJavadoc . lineStart ) ; } this . docComment = formatJavadoc ; if ( DefaultCodeFormatter . DEBUG ) { System . out . println ( toDebugString ( ) ) ; } } protected boolean verifyEndLine ( int textPosition ) { return true ; } protected boolean verifySpaceOrEndComment ( ) { return true ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . util . ArrayList ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ast . ASTNode ; import org . eclipse . jdt . internal . compiler . ast . MessageSend ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; class CascadingMethodInvocationFragmentBuilder extends ASTVisitor { ArrayList fragmentsList ; CascadingMethodInvocationFragmentBuilder ( ) { this . fragmentsList = new ArrayList ( ) ; } public MessageSend [ ] fragments ( ) { MessageSend [ ] fragments = new MessageSend [ this . fragmentsList . size ( ) ] ; this . fragmentsList . toArray ( fragments ) ; return fragments ; } public int size ( ) { return this . fragmentsList . size ( ) ; } public boolean visit ( MessageSend messageSend , BlockScope scope ) { if ( ( messageSend . receiver . bits & ASTNode . ParenthesizedMASK ) > > ASTNode . ParenthesizedSHIFT == <NUM_LIT:0> ) { if ( messageSend . receiver instanceof MessageSend ) { this . fragmentsList . add ( <NUM_LIT:0> , messageSend ) ; messageSend . receiver . traverse ( this , scope ) ; return false ; } this . fragmentsList . add ( <NUM_LIT:0> , messageSend ) ; this . fragmentsList . add ( <NUM_LIT:1> , messageSend ) ; } else { this . fragmentsList . add ( <NUM_LIT:0> , messageSend ) ; this . fragmentsList . add ( <NUM_LIT:1> , messageSend ) ; } return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . old ; import java . util . Map ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . formatter . DefaultCodeFormatterConstants ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . formatter . DefaultCodeFormatter ; import org . eclipse . text . edits . ReplaceEdit ; import org . eclipse . text . edits . TextEdit ; public class CodeFormatter implements TerminalTokens , org . eclipse . jdt . core . ICodeFormatter { private Map options ; public CodeFormatter ( Map options ) { if ( options == null ) { this . options = JavaCore . getOptions ( ) ; } else { this . options = options ; } } public String format ( String string , int indentLevel , int [ ] positions , String lineSeparator ) { Map newOptions = DefaultCodeFormatterConstants . getEclipse21Settings ( ) ; Object formatterNewLineOpeningBrace = this . options . get ( JavaCore . FORMATTER_NEWLINE_OPENING_BRACE ) ; if ( formatterNewLineOpeningBrace != null ) { if ( JavaCore . INSERT . equals ( formatterNewLineOpeningBrace ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION , DefaultCodeFormatterConstants . NEXT_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_BLOCK , DefaultCodeFormatterConstants . NEXT_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION , DefaultCodeFormatterConstants . NEXT_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION , DefaultCodeFormatterConstants . NEXT_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_SWITCH , DefaultCodeFormatterConstants . NEXT_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION , DefaultCodeFormatterConstants . NEXT_LINE ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION , DefaultCodeFormatterConstants . END_OF_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_BLOCK , DefaultCodeFormatterConstants . END_OF_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION , DefaultCodeFormatterConstants . END_OF_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION , DefaultCodeFormatterConstants . END_OF_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_SWITCH , DefaultCodeFormatterConstants . END_OF_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION , DefaultCodeFormatterConstants . END_OF_LINE ) ; } } Object formatterNewLineControl = this . options . get ( JavaCore . FORMATTER_NEWLINE_CONTROL ) ; if ( formatterNewLineControl != null ) { if ( JavaCore . INSERT . equals ( formatterNewLineControl ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT , JavaCore . INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT , JavaCore . INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT , JavaCore . INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT , JavaCore . INSERT ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT , JavaCore . DO_NOT_INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT , JavaCore . DO_NOT_INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT , JavaCore . DO_NOT_INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT , JavaCore . DO_NOT_INSERT ) ; } } Object formatterClearBlankLines = this . options . get ( JavaCore . FORMATTER_CLEAR_BLANK_LINES ) ; if ( formatterClearBlankLines != null ) { if ( JavaCore . PRESERVE_ONE . equals ( formatterClearBlankLines ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE , "<STR_LIT:1>" ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE , "<STR_LIT:0>" ) ; } } Object formatterNewLineElseIf = this . options . get ( JavaCore . FORMATTER_NEWLINE_ELSE_IF ) ; if ( formatterNewLineElseIf != null ) { if ( JavaCore . INSERT . equals ( formatterNewLineElseIf ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_COMPACT_ELSE_IF , DefaultCodeFormatterConstants . FALSE ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_COMPACT_ELSE_IF , DefaultCodeFormatterConstants . TRUE ) ; } } Object formatterNewLineEmptyBlock = this . options . get ( JavaCore . FORMATTER_NEWLINE_EMPTY_BLOCK ) ; if ( formatterNewLineEmptyBlock != null ) { if ( JavaCore . INSERT . equals ( formatterNewLineEmptyBlock ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK , JavaCore . INSERT ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK , JavaCore . DO_NOT_INSERT ) ; } } Object formatterCompactAssignment = this . options . get ( JavaCore . FORMATTER_COMPACT_ASSIGNMENT ) ; if ( formatterCompactAssignment != null ) { if ( JavaCore . COMPACT . equals ( formatterCompactAssignment ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR , JavaCore . DO_NOT_INSERT ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR , JavaCore . INSERT ) ; } } if ( this . options . get ( JavaCore . FORMATTER_SPACE_CASTEXPRESSION ) != null ) { if ( JavaCore . INSERT . equals ( this . options . get ( JavaCore . FORMATTER_SPACE_CASTEXPRESSION ) ) ) { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST , JavaCore . INSERT ) ; } else { newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST , JavaCore . DO_NOT_INSERT ) ; } } newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_TAB_CHAR , this . options . get ( JavaCore . FORMATTER_TAB_CHAR ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_TAB_SIZE , this . options . get ( JavaCore . FORMATTER_TAB_SIZE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_LINE_SPLIT , this . options . get ( JavaCore . FORMATTER_LINE_SPLIT ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER , DefaultCodeFormatterConstants . END_OF_LINE ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_CONTINUATION_INDENTATION , "<STR_LIT:1>" ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION , DefaultCodeFormatterConstants . createAlignmentValue ( false , DefaultCodeFormatterConstants . WRAP_ONE_PER_LINE , DefaultCodeFormatterConstants . INDENT_BY_ONE ) ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER , JavaCore . INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER , JavaCore . INSERT ) ; newOptions . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER , JavaCore . INSERT ) ; DefaultCodeFormatter defaultCodeFormatter = new DefaultCodeFormatter ( newOptions ) ; TextEdit textEdit = defaultCodeFormatter . format ( org . eclipse . jdt . core . formatter . CodeFormatter . K_UNKNOWN , string , <NUM_LIT:0> , string . length ( ) , indentLevel , lineSeparator ) ; if ( positions != null && textEdit != null ) { TextEdit [ ] edits = textEdit . getChildren ( ) ; int textEditSize = edits . length ; int editsIndex = <NUM_LIT:0> ; int delta = <NUM_LIT:0> ; int originalSourceLength = string . length ( ) - <NUM_LIT:1> ; if ( textEditSize != <NUM_LIT:0> ) { for ( int i = <NUM_LIT:0> , max = positions . length ; i < max ; i ++ ) { int currentPosition = positions [ i ] ; if ( currentPosition > originalSourceLength ) { currentPosition = originalSourceLength ; } ReplaceEdit currentEdit = ( ReplaceEdit ) edits [ editsIndex ] ; while ( currentEdit . getOffset ( ) <= currentPosition ) { delta += currentEdit . getText ( ) . length ( ) - currentEdit . getLength ( ) ; editsIndex ++ ; if ( editsIndex < textEditSize ) { currentEdit = ( ReplaceEdit ) edits [ editsIndex ] ; } else { break ; } } positions [ i ] = currentPosition + delta ; } } } return org . eclipse . jdt . internal . core . util . Util . editedString ( string , textEdit ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import org . eclipse . jdt . internal . compiler . parser . JavadocTagConstants ; public abstract class FormatJavadocNode implements JavadocTagConstants { final static int DEFAULT_ARRAY_SIZE = <NUM_LIT:10> ; final static int INCREMENT_ARRAY_SIZE = <NUM_LIT:10> ; protected int sourceStart , sourceEnd ; protected int lineStart ; protected int linesBefore = <NUM_LIT:0> ; public FormatJavadocNode ( int start , int end , int line ) { this . sourceStart = start ; this . sourceEnd = end ; this . lineStart = line ; } abstract void clean ( ) ; FormatJavadocNode getLastNode ( ) { return null ; } public int getLength ( ) { return this . sourceEnd - this . sourceStart + <NUM_LIT:1> ; } public boolean isText ( ) { return false ; } public boolean isImmutable ( ) { return false ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; toString ( buffer ) ; return buffer . toString ( ) ; } protected void toString ( StringBuffer buffer ) { buffer . append ( "<STR_LIT::U+0020>" ) ; buffer . append ( this . sourceStart ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( this . sourceEnd ) ; } public String toStringDebug ( char [ ] source ) { StringBuffer buffer = new StringBuffer ( ) ; toStringDebug ( buffer , source ) ; return buffer . toString ( ) ; } public void toStringDebug ( StringBuffer buffer , char [ ] source ) { buffer . append ( source , this . sourceStart , this . sourceEnd - this . sourceStart + <NUM_LIT:1> ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; } void setHeaderLine ( int javadocLineStart ) { } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . io . IOException ; import java . io . StringReader ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Map ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . core . formatter . CodeFormatter ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . ast . Annotation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . parser . Parser ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; import org . eclipse . jdt . internal . compiler . util . Util ; import org . eclipse . jdt . internal . core . util . CodeSnippetParsingUtil ; import org . eclipse . jdt . internal . core . util . RecordedParsingInformation ; import org . eclipse . jdt . internal . formatter . align . Alignment ; import org . eclipse . jdt . internal . formatter . align . AlignmentException ; import org . eclipse . jdt . internal . formatter . comment . CommentFormatterUtil ; import org . eclipse . jdt . internal . formatter . comment . HTMLEntity2JavaReader ; import org . eclipse . jdt . internal . formatter . comment . IJavaDocTagConstants ; import org . eclipse . jdt . internal . formatter . comment . Java2HTMLEntityReader ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . DefaultLineTracker ; import org . eclipse . jface . text . ILineTracker ; import org . eclipse . jface . text . IRegion ; import org . eclipse . jface . text . Region ; import org . eclipse . text . edits . MalformedTreeException ; import org . eclipse . text . edits . MultiTextEdit ; import org . eclipse . text . edits . ReplaceEdit ; import org . eclipse . text . edits . TextEdit ; public class Scribe implements IJavaDocTagConstants { private static final int INITIAL_SIZE = <NUM_LIT:100> ; private boolean checkLineWrapping ; public int column ; private int [ ] [ ] commentPositions ; public Alignment currentAlignment ; public int currentToken ; private OptimizedReplaceEdit [ ] edits ; public int editsIndex ; public CodeFormatterVisitor formatter ; public int indentationLevel ; public int lastNumberOfNewLines ; private boolean preserveLineBreakIndentation = false ; boolean formatBrace ; public int line ; private int [ ] lineEnds ; private int maxLines ; public Alignment memberAlignment ; public boolean needSpace = false ; final private String lineSeparator ; final private String lineSeparatorAndSpace ; final private char firstLS ; final private int lsLength ; public int nlsTagCounter ; public int pageWidth ; public boolean pendingSpace = false ; public Scanner scanner ; public int scannerEndPosition ; public int tabLength ; public int indentationSize ; private final IRegion [ ] regions ; private IRegion [ ] adaptedRegions ; public int tabChar ; public int numberOfIndentations ; private boolean useTabsOnlyForLeadingIndents ; private final boolean indentEmptyLines ; int blank_lines_between_import_groups = - <NUM_LIT:1> ; boolean editsEnabled ; boolean useTags ; private static final int INCLUDE_BLOCK_COMMENTS = CodeFormatter . F_INCLUDE_COMMENTS | CodeFormatter . K_MULTI_LINE_COMMENT ; private static final int INCLUDE_JAVA_DOC = CodeFormatter . F_INCLUDE_COMMENTS | CodeFormatter . K_JAVA_DOC ; private static final int INCLUDE_LINE_COMMENTS = CodeFormatter . F_INCLUDE_COMMENTS | CodeFormatter . K_SINGLE_LINE_COMMENT ; private static final int SKIP_FIRST_WHITESPACE_TOKEN = - <NUM_LIT:2> ; private static final int INVALID_TOKEN = <NUM_LIT> ; static final int NO_TRAILING_COMMENT = <NUM_LIT> ; static final int BASIC_TRAILING_COMMENT = <NUM_LIT> ; static final int COMPLEX_TRAILING_COMMENT = <NUM_LIT> ; static final int IMPORT_TRAILING_COMMENT = COMPLEX_TRAILING_COMMENT | <NUM_LIT> ; static final int UNMODIFIABLE_TRAILING_COMMENT = <NUM_LIT> ; private int formatComments = <NUM_LIT:0> ; private int headerEndPosition = - <NUM_LIT:1> ; String commentIndentation ; static class LineComment { boolean contiguous = false ; int currentIndentation , indentation ; int lines ; char [ ] leadingSpaces ; } final LineComment lastLineComment = new LineComment ( ) ; private FormatterCommentParser formatterCommentParser ; OptimizedReplaceEdit previousDisabledEdit ; private char [ ] disablingTag , enablingTag ; private String [ ] newEmptyLines = new String [ <NUM_LIT:10> ] ; private static String [ ] COMMENT_INDENTATIONS = new String [ <NUM_LIT:20> ] ; private final StringBuffer tempBuffer = new StringBuffer ( ) ; private final StringBuffer blockCommentBuffer = new StringBuffer ( ) ; private final StringBuffer blockCommentTokensBuffer = new StringBuffer ( ) ; private final StringBuffer codeSnippetBuffer = new StringBuffer ( ) ; private final StringBuffer javadocBlockRefBuffer = new StringBuffer ( ) ; private final StringBuffer javadocGapLinesBuffer = new StringBuffer ( ) ; private StringBuffer [ ] javadocHtmlTagBuffers = new StringBuffer [ <NUM_LIT:5> ] ; private final StringBuffer javadocTextBuffer = new StringBuffer ( ) ; private final StringBuffer javadocTokensBuffer = new StringBuffer ( ) ; Scribe ( CodeFormatterVisitor formatter , long sourceLevel , IRegion [ ] regions , CodeSnippetParsingUtil codeSnippetParsingUtil , boolean includeComments ) { initializeScanner ( sourceLevel , formatter . preferences ) ; this . formatter = formatter ; this . pageWidth = formatter . preferences . page_width ; this . tabLength = formatter . preferences . tab_size ; this . indentationLevel = <NUM_LIT:0> ; this . numberOfIndentations = <NUM_LIT:0> ; this . useTabsOnlyForLeadingIndents = formatter . preferences . use_tabs_only_for_leading_indentations ; this . indentEmptyLines = formatter . preferences . indent_empty_lines ; this . tabChar = formatter . preferences . tab_char ; if ( this . tabChar == DefaultCodeFormatterOptions . MIXED ) { this . indentationSize = formatter . preferences . indentation_size ; } else { this . indentationSize = this . tabLength ; } this . lineSeparator = formatter . preferences . line_separator ; this . lineSeparatorAndSpace = this . lineSeparator + '<CHAR_LIT:U+0020>' ; this . firstLS = this . lineSeparator . charAt ( <NUM_LIT:0> ) ; this . lsLength = this . lineSeparator . length ( ) ; this . indentationLevel = formatter . preferences . initial_indentation_level * this . indentationSize ; this . regions = regions ; if ( codeSnippetParsingUtil != null ) { final RecordedParsingInformation information = codeSnippetParsingUtil . recordedParsingInformation ; if ( information != null ) { this . lineEnds = information . lineEnds ; this . commentPositions = information . commentPositions ; } } if ( formatter . preferences . comment_format_line_comment ) this . formatComments |= CodeFormatter . K_SINGLE_LINE_COMMENT ; if ( formatter . preferences . comment_format_block_comment ) this . formatComments |= CodeFormatter . K_MULTI_LINE_COMMENT ; if ( formatter . preferences . comment_format_javadoc_comment ) this . formatComments |= CodeFormatter . K_JAVA_DOC ; if ( includeComments ) this . formatComments |= CodeFormatter . F_INCLUDE_COMMENTS ; reset ( ) ; } private void adaptRegions ( ) { int max = this . regions . length ; if ( max == <NUM_LIT:1> ) { if ( this . regions [ <NUM_LIT:0> ] . getOffset ( ) == <NUM_LIT:0> && this . regions [ <NUM_LIT:0> ] . getLength ( ) == this . scannerEndPosition ) { this . adaptedRegions = this . regions ; return ; } } this . adaptedRegions = new IRegion [ max ] ; int commentIndex = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { IRegion aRegion = this . regions [ i ] ; int offset = aRegion . getOffset ( ) ; int length = aRegion . getLength ( ) ; int index = getCommentIndex ( commentIndex , offset ) ; int adaptedOffset = offset ; int adaptedLength = length ; if ( index >= <NUM_LIT:0> ) { adaptedOffset = this . commentPositions [ index ] [ <NUM_LIT:0> ] ; if ( adaptedOffset >= <NUM_LIT:0> ) { adaptedLength = length + offset - adaptedOffset ; commentIndex = index ; for ( int j = <NUM_LIT:0> ; j < this . editsIndex ; j ++ ) { int editOffset = this . edits [ j ] . offset ; int editEnd = editOffset + this . edits [ j ] . length ; if ( editEnd == adaptedOffset ) { if ( j > <NUM_LIT:0> && this . edits [ j ] . replacement . trim ( ) . length ( ) == <NUM_LIT:0> ) { adaptedLength += adaptedOffset - this . edits [ j ] . offset ; adaptedOffset = editOffset ; break ; } } else if ( editEnd > adaptedOffset ) { break ; } } } } index = getCommentIndex ( commentIndex , offset + length - <NUM_LIT:1> ) ; if ( index >= <NUM_LIT:0> && this . commentPositions [ index ] [ <NUM_LIT:0> ] >= <NUM_LIT:0> ) { int commentEnd = this . commentPositions [ index ] [ <NUM_LIT:1> ] ; if ( commentEnd < <NUM_LIT:0> ) commentEnd = - commentEnd ; adaptedLength = commentEnd - adaptedOffset ; commentIndex = index ; } if ( adaptedLength != length ) { this . adaptedRegions [ i ] = new Region ( adaptedOffset , adaptedLength ) ; } else { this . adaptedRegions [ i ] = aRegion ; } } } private void adaptEdits ( ) { int max = this . regions . length ; if ( max == <NUM_LIT:1> ) { if ( this . regions [ <NUM_LIT:0> ] . getOffset ( ) == <NUM_LIT:0> && this . regions [ <NUM_LIT:0> ] . getLength ( ) == this . scannerEndPosition ) { return ; } } OptimizedReplaceEdit [ ] sortedEdits = new OptimizedReplaceEdit [ this . editsIndex ] ; System . arraycopy ( this . edits , <NUM_LIT:0> , sortedEdits , <NUM_LIT:0> , this . editsIndex ) ; Arrays . sort ( sortedEdits , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { OptimizedReplaceEdit edit1 = ( OptimizedReplaceEdit ) o1 ; OptimizedReplaceEdit edit2 = ( OptimizedReplaceEdit ) o2 ; return edit1 . offset - edit2 . offset ; } } ) ; int currentEdit = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < max ; i ++ ) { IRegion region = this . adaptedRegions [ i ] ; int offset = region . getOffset ( ) ; int length = region . getLength ( ) ; int index = adaptEdit ( sortedEdits , currentEdit , offset , offset + length ) ; if ( index != - <NUM_LIT:1> ) { currentEdit = index ; } } } private int adaptEdit ( OptimizedReplaceEdit [ ] sortedEdits , int start , int regionStart , int regionEnd ) { int bottom = start == - <NUM_LIT:1> ? <NUM_LIT:0> : start , top = sortedEdits . length - <NUM_LIT:1> ; int topEnd = top ; int i = <NUM_LIT:0> ; OptimizedReplaceEdit edit = null ; int overlapIndex = - <NUM_LIT:1> ; int linesOutside = - <NUM_LIT:1> ; while ( bottom <= top ) { i = bottom + ( top - bottom ) / <NUM_LIT:2> ; edit = sortedEdits [ i ] ; int editStart = edit . offset ; int editEnd = editStart + edit . length ; if ( regionStart < editStart ) { top = i - <NUM_LIT:1> ; if ( regionEnd < editStart ) { topEnd = top ; } } else { if ( regionStart >= editEnd ) { bottom = i + <NUM_LIT:1> ; } else { linesOutside = <NUM_LIT:0> ; this . scanner . resetTo ( editStart , editEnd - <NUM_LIT:1> ) ; while ( ! this . scanner . atEnd ( ) ) { boolean before = this . scanner . currentPosition < regionStart ; char ch = ( char ) this . scanner . getNextChar ( ) ; if ( ch == '<STR_LIT:\n>' ) { if ( before ) linesOutside ++ ; } } edit . offset = regionStart ; edit . length -= edit . offset - editStart ; int length = edit . replacement . length ( ) ; if ( length > <NUM_LIT:0> ) { int linesReplaced = <NUM_LIT:0> ; for ( int idx = <NUM_LIT:0> ; idx < length ; idx ++ ) { if ( edit . replacement . charAt ( idx ) == '<STR_LIT:\n>' ) linesReplaced ++ ; } if ( linesReplaced > <NUM_LIT:0> ) { int linesCount = linesOutside >= linesReplaced ? linesReplaced : linesOutside ; if ( linesCount > <NUM_LIT:0> ) { int idx = <NUM_LIT:0> ; loop : while ( idx < length ) { char ch = edit . replacement . charAt ( idx ) ; switch ( ch ) { case '<STR_LIT:\n>' : linesCount -- ; if ( linesCount == <NUM_LIT:0> ) { idx ++ ; break loop ; } break ; case '<STR_LIT>' : case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : break ; default : break loop ; } idx ++ ; } if ( idx >= length ) { edit . replacement = "<STR_LIT>" ; } else { edit . replacement = edit . replacement . substring ( idx ) ; } } } } overlapIndex = i ; break ; } } } if ( overlapIndex != - <NUM_LIT:1> ) bottom = overlapIndex ; while ( bottom <= topEnd ) { i = bottom + ( topEnd - bottom ) / <NUM_LIT:2> ; edit = sortedEdits [ i ] ; int editStart = edit . offset ; int editEnd = editStart + edit . length ; if ( regionEnd < editStart ) { topEnd = i - <NUM_LIT:1> ; } else { if ( regionEnd >= editEnd ) { bottom = i + <NUM_LIT:1> ; } else { linesOutside = <NUM_LIT:0> ; this . scanner . resetTo ( editStart , editEnd - <NUM_LIT:1> ) ; while ( ! this . scanner . atEnd ( ) ) { boolean after = this . scanner . currentPosition >= regionEnd ; char ch = ( char ) this . scanner . getNextChar ( ) ; if ( ch == '<STR_LIT:\n>' ) { if ( after ) linesOutside ++ ; } } int length = edit . replacement . length ( ) ; if ( length > <NUM_LIT:0> ) { int linesReplaced = <NUM_LIT:0> ; for ( int idx = <NUM_LIT:0> ; idx < length ; idx ++ ) { if ( edit . replacement . charAt ( idx ) == '<STR_LIT:\n>' ) linesReplaced ++ ; } if ( linesReplaced == <NUM_LIT:0> ) { edit . replacement = "<STR_LIT>" ; } else { int linesCount = linesReplaced > linesOutside ? linesReplaced - linesOutside : <NUM_LIT:0> ; if ( linesCount == <NUM_LIT:0> ) { edit . replacement = "<STR_LIT>" ; } else { edit . replacement = getNewLineString ( linesCount ) ; } } } edit . length -= editEnd - regionEnd ; return i ; } } } return overlapIndex ; } private final void addDeleteEdit ( int start , int end ) { if ( this . edits . length == this . editsIndex ) { resize ( ) ; } addOptimizedReplaceEdit ( start , end - start + <NUM_LIT:1> , Util . EMPTY_STRING ) ; } public final void addInsertEdit ( int insertPosition , String insertedString ) { if ( this . edits . length == this . editsIndex ) { resize ( ) ; } addOptimizedReplaceEdit ( insertPosition , <NUM_LIT:0> , insertedString ) ; } private final void addOptimizedReplaceEdit ( int offset , int length , String replacement ) { if ( ! this . editsEnabled ) { if ( this . previousDisabledEdit != null && this . previousDisabledEdit . offset == offset ) { replacement = this . previousDisabledEdit . replacement ; } this . previousDisabledEdit = null ; if ( replacement . indexOf ( this . lineSeparator ) >= <NUM_LIT:0> ) { if ( length == <NUM_LIT:0> || printNewLinesCharacters ( offset , length ) ) { this . previousDisabledEdit = new OptimizedReplaceEdit ( offset , length , replacement ) ; } } return ; } if ( this . editsIndex > <NUM_LIT:0> ) { final OptimizedReplaceEdit previous = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; final int previousOffset = previous . offset ; final int previousLength = previous . length ; final int endOffsetOfPreviousEdit = previousOffset + previousLength ; final int replacementLength = replacement . length ( ) ; final String previousReplacement = previous . replacement ; final int previousReplacementLength = previousReplacement . length ( ) ; if ( previousOffset == offset && previousLength == length && ( replacementLength == <NUM_LIT:0> || previousReplacementLength == <NUM_LIT:0> ) ) { if ( this . currentAlignment != null ) { final Location location = this . currentAlignment . location ; if ( location . editsIndex == this . editsIndex ) { location . editsIndex -- ; location . textEdit = previous ; } } this . editsIndex -- ; return ; } if ( endOffsetOfPreviousEdit == offset ) { if ( length != <NUM_LIT:0> ) { if ( replacementLength != <NUM_LIT:0> ) { this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( previousOffset , previousLength + length , previousReplacement + replacement ) ; } else if ( previousLength + length == previousReplacementLength ) { boolean canBeRemoved = true ; loop : for ( int i = previousOffset ; i < previousOffset + previousReplacementLength ; i ++ ) { if ( this . scanner . source [ i ] != previousReplacement . charAt ( i - previousOffset ) ) { this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( previousOffset , previousReplacementLength , previousReplacement ) ; canBeRemoved = false ; break loop ; } } if ( canBeRemoved ) { if ( this . currentAlignment != null ) { final Location location = this . currentAlignment . location ; if ( location . editsIndex == this . editsIndex ) { location . editsIndex -- ; location . textEdit = previous ; } } this . editsIndex -- ; } } else { this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( previousOffset , previousLength + length , previousReplacement ) ; } } else { if ( replacementLength != <NUM_LIT:0> ) { this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( previousOffset , previousLength , previousReplacement + replacement ) ; } } } else if ( ( offset + length == previousOffset ) && ( previousLength + length == replacementLength + previousReplacementLength ) ) { boolean canBeRemoved = true ; String totalReplacement = replacement + previousReplacement ; loop : for ( int i = <NUM_LIT:0> ; i < previousLength + length ; i ++ ) { if ( this . scanner . source [ i + offset ] != totalReplacement . charAt ( i ) ) { this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( offset , previousLength + length , totalReplacement ) ; canBeRemoved = false ; break loop ; } } if ( canBeRemoved ) { if ( this . currentAlignment != null ) { final Location location = this . currentAlignment . location ; if ( location . editsIndex == this . editsIndex ) { location . editsIndex -- ; location . textEdit = previous ; } } this . editsIndex -- ; } } else { this . edits [ this . editsIndex ++ ] = new OptimizedReplaceEdit ( offset , length , replacement ) ; } } else { this . edits [ this . editsIndex ++ ] = new OptimizedReplaceEdit ( offset , length , replacement ) ; } } public final void addReplaceEdit ( int start , int end , String replacement ) { if ( this . edits . length == this . editsIndex ) { resize ( ) ; } addOptimizedReplaceEdit ( start , end - start + <NUM_LIT:1> , replacement ) ; } public void alignFragment ( Alignment alignment , int fragmentIndex ) { alignment . fragmentIndex = fragmentIndex ; alignment . checkColumn ( ) ; alignment . performFragmentEffect ( ) ; } public void checkNLSTag ( int sourceStart ) { if ( hasNLSTag ( sourceStart ) ) { this . nlsTagCounter ++ ; } } private int consumeInvalidToken ( int end ) { this . scanner . resetTo ( this . scanner . startPosition , end ) ; if ( this . scanner . currentCharacter == '<STR_LIT:\\>' ) { this . scanner . currentPosition = this . scanner . startPosition + <NUM_LIT:1> ; } int previousPosition = this . scanner . currentPosition ; char ch = ( char ) this . scanner . getNextChar ( ) ; if ( this . scanner . atEnd ( ) ) { return INVALID_TOKEN ; } while ( ! this . scanner . atEnd ( ) && ch != '<CHAR_LIT>' && ! ScannerHelper . isWhitespace ( ch ) ) { previousPosition = this . scanner . currentPosition ; ch = ( char ) this . scanner . getNextChar ( ) ; } this . scanner . currentPosition = previousPosition ; return INVALID_TOKEN ; } public Alignment createAlignment ( int kind , int mode , int count , int sourceRestart ) { return createAlignment ( kind , mode , Alignment . R_INNERMOST , count , sourceRestart ) ; } public Alignment createAlignment ( int kind , int mode , int count , int sourceRestart , boolean adjust ) { return createAlignment ( kind , mode , Alignment . R_INNERMOST , count , sourceRestart , adjust ) ; } public Alignment createAlignment ( int kind , int mode , int tieBreakRule , int count , int sourceRestart ) { return createAlignment ( kind , mode , tieBreakRule , count , sourceRestart , this . formatter . preferences . continuation_indentation , false ) ; } public Alignment createAlignment ( int kind , int mode , int count , int sourceRestart , int continuationIndent , boolean adjust ) { return createAlignment ( kind , mode , Alignment . R_INNERMOST , count , sourceRestart , continuationIndent , adjust ) ; } public Alignment createAlignment ( int kind , int mode , int tieBreakRule , int count , int sourceRestart , int continuationIndent , boolean adjust ) { Alignment alignment = new Alignment ( kind , mode , tieBreakRule , this , count , sourceRestart , continuationIndent ) ; if ( adjust && this . memberAlignment != null ) { Alignment current = this . memberAlignment ; while ( current . enclosing != null ) { current = current . enclosing ; } if ( ( current . mode & Alignment . M_MULTICOLUMN ) != <NUM_LIT:0> ) { final int indentSize = this . indentationSize ; switch ( current . chunkKind ) { case Alignment . CHUNK_METHOD : case Alignment . CHUNK_TYPE : if ( ( mode & Alignment . M_INDENT_BY_ONE ) != <NUM_LIT:0> ) { alignment . breakIndentationLevel = this . indentationLevel + indentSize ; } else { alignment . breakIndentationLevel = this . indentationLevel + continuationIndent * indentSize ; } alignment . update ( ) ; break ; case Alignment . CHUNK_FIELD : if ( ( mode & Alignment . M_INDENT_BY_ONE ) != <NUM_LIT:0> ) { alignment . breakIndentationLevel = current . originalIndentationLevel + indentSize ; } else { alignment . breakIndentationLevel = current . originalIndentationLevel + continuationIndent * indentSize ; } alignment . update ( ) ; break ; } } else { switch ( current . mode & Alignment . SPLIT_MASK ) { case Alignment . M_COMPACT_SPLIT : case Alignment . M_COMPACT_FIRST_BREAK_SPLIT : case Alignment . M_NEXT_PER_LINE_SPLIT : case Alignment . M_NEXT_SHIFTED_SPLIT : case Alignment . M_ONE_PER_LINE_SPLIT : final int indentSize = this . indentationSize ; switch ( current . chunkKind ) { case Alignment . CHUNK_METHOD : case Alignment . CHUNK_TYPE : if ( ( mode & Alignment . M_INDENT_BY_ONE ) != <NUM_LIT:0> ) { alignment . breakIndentationLevel = this . indentationLevel + indentSize ; } else { alignment . breakIndentationLevel = this . indentationLevel + continuationIndent * indentSize ; } alignment . update ( ) ; break ; case Alignment . CHUNK_FIELD : if ( ( mode & Alignment . M_INDENT_BY_ONE ) != <NUM_LIT:0> ) { alignment . breakIndentationLevel = current . originalIndentationLevel + indentSize ; } else { alignment . breakIndentationLevel = current . originalIndentationLevel + continuationIndent * indentSize ; } alignment . update ( ) ; break ; } break ; } } } return alignment ; } public Alignment createMemberAlignment ( int kind , int mode , int count , int sourceRestart ) { Alignment mAlignment = createAlignment ( kind , mode , Alignment . R_INNERMOST , count , sourceRestart ) ; mAlignment . breakIndentationLevel = this . indentationLevel ; return mAlignment ; } public void enterAlignment ( Alignment alignment ) { alignment . enclosing = this . currentAlignment ; alignment . location . lastLocalDeclarationSourceStart = this . formatter . lastLocalDeclarationSourceStart ; this . currentAlignment = alignment ; } public void enterMemberAlignment ( Alignment alignment ) { alignment . enclosing = this . memberAlignment ; alignment . location . lastLocalDeclarationSourceStart = this . formatter . lastLocalDeclarationSourceStart ; this . memberAlignment = alignment ; } public void exitAlignment ( Alignment alignment , boolean discardAlignment ) { Alignment current = this . currentAlignment ; while ( current != null ) { if ( current == alignment ) break ; current = current . enclosing ; } if ( current == null ) { throw new AbortFormatting ( "<STR_LIT>" + alignment ) ; } this . indentationLevel = alignment . location . outputIndentationLevel ; this . numberOfIndentations = alignment . location . numberOfIndentations ; this . formatter . lastLocalDeclarationSourceStart = alignment . location . lastLocalDeclarationSourceStart ; if ( discardAlignment ) { this . currentAlignment = alignment . enclosing ; } } public void exitMemberAlignment ( Alignment alignment ) { Alignment current = this . memberAlignment ; while ( current != null ) { if ( current == alignment ) break ; current = current . enclosing ; } if ( current == null ) { throw new AbortFormatting ( "<STR_LIT>" + alignment ) ; } this . indentationLevel = current . location . outputIndentationLevel ; this . numberOfIndentations = current . location . numberOfIndentations ; this . formatter . lastLocalDeclarationSourceStart = alignment . location . lastLocalDeclarationSourceStart ; this . memberAlignment = current . enclosing ; } public int getColumnIndentationLevel ( ) { return this . column - <NUM_LIT:1> ; } public final int getCommentIndex ( int position ) { if ( this . commentPositions == null ) return - <NUM_LIT:1> ; int length = this . commentPositions . length ; if ( length == <NUM_LIT:0> ) { return - <NUM_LIT:1> ; } int g = <NUM_LIT:0> , d = length - <NUM_LIT:1> ; int m = <NUM_LIT:0> ; while ( g <= d ) { m = g + ( d - g ) / <NUM_LIT:2> ; int bound = this . commentPositions [ m ] [ <NUM_LIT:1> ] ; if ( bound < <NUM_LIT:0> ) { bound = - bound ; } if ( bound < position ) { g = m + <NUM_LIT:1> ; } else if ( bound > position ) { d = m - <NUM_LIT:1> ; } else { return m ; } } return - ( g + <NUM_LIT:1> ) ; } private int getCommentIndex ( int start , int position ) { int commentsLength = this . commentPositions == null ? <NUM_LIT:0> : this . commentPositions . length ; if ( commentsLength == <NUM_LIT:0> ) return - <NUM_LIT:1> ; if ( position == <NUM_LIT:0> ) { if ( commentsLength > <NUM_LIT:0> && this . commentPositions [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] == <NUM_LIT:0> ) { return <NUM_LIT:0> ; } return - <NUM_LIT:1> ; } int bottom = start , top = commentsLength - <NUM_LIT:1> ; int i = <NUM_LIT:0> ; int [ ] comment = null ; while ( bottom <= top ) { i = bottom + ( top - bottom ) / <NUM_LIT:2> ; comment = this . commentPositions [ i ] ; int commentStart = comment [ <NUM_LIT:0> ] ; if ( commentStart < <NUM_LIT:0> ) commentStart = - commentStart ; if ( position < commentStart ) { top = i - <NUM_LIT:1> ; } else { int commentEnd = comment [ <NUM_LIT:1> ] ; if ( commentEnd < <NUM_LIT:0> ) commentEnd = - commentEnd ; if ( position >= commentEnd ) { bottom = i + <NUM_LIT:1> ; } else { return i ; } } } return - <NUM_LIT:1> ; } private IRegion getCoveringAdaptedRegion ( int offset , int end ) { int index = getIndexOfAdaptedRegionAt ( offset ) ; if ( index < <NUM_LIT:0> ) { index = - ( index + <NUM_LIT:1> ) ; index -- ; if ( index < <NUM_LIT:0> ) { return null ; } } IRegion region = this . adaptedRegions [ index ] ; if ( ( region . getOffset ( ) <= offset ) && ( end <= region . getOffset ( ) + region . getLength ( ) - <NUM_LIT:1> ) ) { return region ; } return null ; } private int getCurrentCommentIndentation ( int start ) { int linePtr = - Arrays . binarySearch ( this . lineEnds , start ) ; int indentation = <NUM_LIT:0> ; int beginningOfLine = getLineEnd ( linePtr - <NUM_LIT:1> ) + <NUM_LIT:1> ; if ( beginningOfLine == - <NUM_LIT:1> ) { beginningOfLine = <NUM_LIT:0> ; } int currentStartPosition = start ; char [ ] source = this . scanner . source ; while ( beginningOfLine > currentStartPosition ) { if ( linePtr > <NUM_LIT:0> ) { beginningOfLine = getLineEnd ( -- linePtr ) + <NUM_LIT:1> ; } else { beginningOfLine = <NUM_LIT:0> ; break ; } } for ( int i = beginningOfLine ; i < currentStartPosition ; i ++ ) { char currentCharacter = source [ i ] ; switch ( currentCharacter ) { case '<STR_LIT:\t>' : if ( this . tabLength != <NUM_LIT:0> ) { int reminder = indentation % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { indentation += this . tabLength ; } else { indentation = ( ( indentation / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } } break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : indentation = <NUM_LIT:0> ; break ; default : indentation ++ ; break ; } } return indentation ; } int getCurrentIndentation ( char [ ] whitespaces , int offset ) { if ( whitespaces == null ) return offset ; int length = whitespaces . length ; if ( this . tabLength == <NUM_LIT:0> ) return length ; int indentation = offset ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { char ch = whitespaces [ i ] ; switch ( ch ) { case '<STR_LIT:\t>' : int reminder = indentation % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { indentation += this . tabLength ; } else { indentation = ( ( indentation / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : indentation = <NUM_LIT:0> ; break ; default : indentation ++ ; break ; } } return indentation ; } int getCurrentIndentation ( int start ) { int linePtr = Arrays . binarySearch ( this . lineEnds , start ) ; if ( linePtr < <NUM_LIT:0> ) { linePtr = - linePtr - <NUM_LIT:1> ; } int indentation = <NUM_LIT:0> ; int beginningOfLine = getLineEnd ( linePtr ) + <NUM_LIT:1> ; if ( beginningOfLine == - <NUM_LIT:1> ) { beginningOfLine = <NUM_LIT:0> ; } char [ ] source = this . scanner . source ; for ( int i = beginningOfLine ; i < start ; i ++ ) { char currentCharacter = source [ i ] ; switch ( currentCharacter ) { case '<STR_LIT:\t>' : if ( this . tabLength != <NUM_LIT:0> ) { int reminder = indentation % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { indentation += this . tabLength ; } else { indentation = ( ( indentation / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } } break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : indentation = <NUM_LIT:0> ; break ; case '<CHAR_LIT:U+0020>' : indentation ++ ; break ; default : return indentation ; } } return indentation ; } public String getEmptyLines ( int linesNumber ) { if ( this . nlsTagCounter > <NUM_LIT:0> ) { return Util . EMPTY_STRING ; } String emptyLines ; if ( this . lastNumberOfNewLines == <NUM_LIT:0> ) { linesNumber ++ ; if ( this . indentEmptyLines ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; for ( int i = <NUM_LIT:0> ; i < linesNumber ; i ++ ) { printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( this . lineSeparator ) ; } emptyLines = this . tempBuffer . toString ( ) ; } else { emptyLines = getNewLineString ( linesNumber ) ; } this . lastNumberOfNewLines += linesNumber ; this . line += linesNumber ; this . column = <NUM_LIT:1> ; this . needSpace = false ; this . pendingSpace = false ; } else if ( this . lastNumberOfNewLines == <NUM_LIT:1> ) { if ( this . indentEmptyLines ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; for ( int i = <NUM_LIT:0> ; i < linesNumber ; i ++ ) { printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( this . lineSeparator ) ; } emptyLines = this . tempBuffer . toString ( ) ; } else { emptyLines = getNewLineString ( linesNumber ) ; } this . lastNumberOfNewLines += linesNumber ; this . line += linesNumber ; this . column = <NUM_LIT:1> ; this . needSpace = false ; this . pendingSpace = false ; } else { if ( ( this . lastNumberOfNewLines - <NUM_LIT:1> ) >= linesNumber ) { return Util . EMPTY_STRING ; } final int realNewLineNumber = linesNumber - this . lastNumberOfNewLines + <NUM_LIT:1> ; if ( this . indentEmptyLines ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; for ( int i = <NUM_LIT:0> ; i < realNewLineNumber ; i ++ ) { printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( this . lineSeparator ) ; } emptyLines = this . tempBuffer . toString ( ) ; } else { emptyLines = getNewLineString ( realNewLineNumber ) ; } this . lastNumberOfNewLines += realNewLineNumber ; this . line += realNewLineNumber ; this . column = <NUM_LIT:1> ; this . needSpace = false ; this . pendingSpace = false ; } return emptyLines ; } private int getIndexOfAdaptedRegionAt ( int offset ) { if ( this . adaptedRegions . length == <NUM_LIT:1> ) { int offset2 = this . adaptedRegions [ <NUM_LIT:0> ] . getOffset ( ) ; if ( offset2 == offset ) { return <NUM_LIT:0> ; } return offset2 < offset ? - <NUM_LIT:2> : - <NUM_LIT:1> ; } return Arrays . binarySearch ( this . adaptedRegions , new Region ( offset , <NUM_LIT:0> ) , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { int r1Offset = ( ( IRegion ) o1 ) . getOffset ( ) ; int r2Offset = ( ( IRegion ) o2 ) . getOffset ( ) ; return r1Offset - r2Offset ; } } ) ; } public OptimizedReplaceEdit getLastEdit ( ) { if ( this . editsIndex > <NUM_LIT:0> ) { return this . edits [ this . editsIndex - <NUM_LIT:1> ] ; } return null ; } public final int getLineEnd ( int lineNumber ) { if ( this . lineEnds == null ) return - <NUM_LIT:1> ; if ( lineNumber >= this . lineEnds . length + <NUM_LIT:1> ) return this . scannerEndPosition ; if ( lineNumber <= <NUM_LIT:0> ) return - <NUM_LIT:1> ; return this . lineEnds [ lineNumber - <NUM_LIT:1> ] ; } Alignment getMemberAlignment ( ) { return this . memberAlignment ; } public String getNewLine ( ) { if ( this . nlsTagCounter > <NUM_LIT:0> ) { return Util . EMPTY_STRING ; } if ( this . lastNumberOfNewLines >= <NUM_LIT:1> ) { this . column = <NUM_LIT:1> ; return Util . EMPTY_STRING ; } this . line ++ ; this . lastNumberOfNewLines = <NUM_LIT:1> ; this . column = <NUM_LIT:1> ; this . needSpace = false ; this . pendingSpace = false ; return this . lineSeparator ; } private String getNewLineString ( int linesCount ) { int length = this . newEmptyLines . length ; if ( linesCount > length ) { System . arraycopy ( this . newEmptyLines , <NUM_LIT:0> , this . newEmptyLines = new String [ linesCount + <NUM_LIT:10> ] , <NUM_LIT:0> , length ) ; } String newLineString = this . newEmptyLines [ linesCount - <NUM_LIT:1> ] ; if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; for ( int j = <NUM_LIT:0> ; j < linesCount ; j ++ ) { this . tempBuffer . append ( this . lineSeparator ) ; } newLineString = this . tempBuffer . toString ( ) ; this . newEmptyLines [ linesCount - <NUM_LIT:1> ] = newLineString ; } return newLineString ; } public int getNextIndentationLevel ( int someColumn ) { int indent = someColumn - <NUM_LIT:1> ; if ( indent == <NUM_LIT:0> ) return this . indentationLevel ; if ( this . tabChar == DefaultCodeFormatterOptions . TAB ) { if ( this . useTabsOnlyForLeadingIndents ) { return indent ; } if ( this . indentationSize == <NUM_LIT:0> ) { return indent ; } int rem = indent % this . indentationSize ; int addition = rem == <NUM_LIT:0> ? <NUM_LIT:0> : this . indentationSize - rem ; return indent + addition ; } return indent ; } private String getPreserveEmptyLines ( int count ) { if ( count == <NUM_LIT:0> ) { if ( this . currentAlignment != null && ! this . formatter . preferences . join_wrapped_lines ) { if ( this . lastNumberOfNewLines == <NUM_LIT:0> || this . memberAlignment == null || this . memberAlignment . location . inputOffset < this . currentAlignment . location . inputOffset ) { if ( DefaultCodeFormatter . DEBUG ) { System . out . println ( "<STR_LIT>" ) ; System . out . println ( "<STR_LIT>" + this . indentationLevel ) ; System . out . println ( "<STR_LIT>" ) ; System . out . print ( this . currentAlignment . toString ( new StringBuffer ( ) , <NUM_LIT:1> ) ) ; if ( this . memberAlignment != null ) { System . out . println ( "<STR_LIT>" ) ; System . out . print ( this . memberAlignment . toString ( new StringBuffer ( ) , <NUM_LIT:1> ) ) ; } } this . indentationLevel = this . currentAlignment . location . outputIndentationLevel ; this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( getNewLine ( ) ) ; int currentIndentation = getCurrentIndentation ( this . scanner . currentPosition ) ; int currentTokenStartPosition = this . scanner . currentPosition ; int nextToken = - <NUM_LIT:1> ; try { nextToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { } this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; boolean canUseAlignmentIndentation = ( nextToken != TerminalTokens . TokenNameLBRACE || this . currentAlignment . kind != Alignment . LOCAL_DECLARATION_ASSIGNMENT ) ; if ( canUseAlignmentIndentation && ( ! this . formatBrace || this . currentAlignment . kind == Alignment . ARRAY_INITIALIZER || this . currentAlignment . kind == Alignment . BINARY_EXPRESSION ) && this . indentationLevel < this . currentAlignment . breakIndentationLevel ) { this . indentationLevel = this . currentAlignment . breakIndentationLevel ; } if ( this . indentationLevel < currentIndentation ) { this . indentationLevel = currentIndentation ; } if ( DefaultCodeFormatter . DEBUG ) { System . out . println ( "<STR_LIT>" + this . formatBrace ) ; System . out . println ( "<STR_LIT>" + ( currentIndentation + <NUM_LIT:1> ) ) ; System . out . println ( "<STR_LIT>" + this . scanner . currentPosition ) ; System . out . print ( "<STR_LIT>" ) ; int linePtr = Arrays . binarySearch ( this . lineEnds , this . scanner . currentPosition ) ; if ( linePtr < <NUM_LIT:0> ) { linePtr = - linePtr - <NUM_LIT:1> ; } int i = getLineEnd ( linePtr ) + <NUM_LIT:1> ; while ( this . scanner . source [ i ] != '<STR_LIT>' ) { System . out . print ( this . scanner . source [ i ++ ] ) ; } System . out . println ( ) ; System . out . println ( "<STR_LIT>" + this . indentationLevel ) ; System . out . println ( ) ; } this . preserveLineBreakIndentation = true ; printIndentationIfNecessary ( this . tempBuffer ) ; return this . tempBuffer . toString ( ) ; } } return Util . EMPTY_STRING ; } if ( this . blank_lines_between_import_groups >= <NUM_LIT:0> ) { return getEmptyLines ( this . blank_lines_between_import_groups ) ; } if ( this . formatter . preferences . number_of_empty_lines_to_preserve != <NUM_LIT:0> ) { int linesToPreserve = Math . min ( count , this . formatter . preferences . number_of_empty_lines_to_preserve ) ; return getEmptyLines ( linesToPreserve ) ; } return getNewLine ( ) ; } private IRegion getAdaptedRegionAt ( int offset ) { int index = getIndexOfAdaptedRegionAt ( offset ) ; if ( index < <NUM_LIT:0> ) { return null ; } return this . adaptedRegions [ index ] ; } public TextEdit getRootEdit ( ) { adaptRegions ( ) ; adaptEdits ( ) ; MultiTextEdit edit = null ; int regionsLength = this . adaptedRegions . length ; int textRegionStart ; int textRegionEnd ; if ( regionsLength == <NUM_LIT:1> ) { IRegion lastRegion = this . adaptedRegions [ <NUM_LIT:0> ] ; textRegionStart = lastRegion . getOffset ( ) ; textRegionEnd = textRegionStart + lastRegion . getLength ( ) ; } else { textRegionStart = this . adaptedRegions [ <NUM_LIT:0> ] . getOffset ( ) ; IRegion lastRegion = this . adaptedRegions [ regionsLength - <NUM_LIT:1> ] ; textRegionEnd = lastRegion . getOffset ( ) + lastRegion . getLength ( ) ; } int length = textRegionEnd - textRegionStart + <NUM_LIT:1> ; if ( textRegionStart <= <NUM_LIT:0> ) { if ( length <= <NUM_LIT:0> ) { edit = new MultiTextEdit ( <NUM_LIT:0> , <NUM_LIT:0> ) ; } else { edit = new MultiTextEdit ( <NUM_LIT:0> , textRegionEnd ) ; } } else { edit = new MultiTextEdit ( textRegionStart , length - <NUM_LIT:1> ) ; } for ( int i = <NUM_LIT:0> , max = this . editsIndex ; i < max ; i ++ ) { OptimizedReplaceEdit currentEdit = this . edits [ i ] ; if ( isValidEdit ( currentEdit ) ) { try { edit . addChild ( new ReplaceEdit ( currentEdit . offset , currentEdit . length , currentEdit . replacement ) ) ; } catch ( MalformedTreeException ex ) { CommentFormatterUtil . log ( ex ) ; throw ex ; } } } this . edits = null ; return edit ; } public void handleLineTooLong ( ) { if ( this . formatter . preferences . wrap_outer_expressions_when_nested ) { handleLineTooLongSmartly ( ) ; return ; } int relativeDepth = <NUM_LIT:0> , outerMostDepth = - <NUM_LIT:1> ; Alignment targetAlignment = this . currentAlignment ; while ( targetAlignment != null ) { if ( targetAlignment . tieBreakRule == Alignment . R_OUTERMOST && targetAlignment . couldBreak ( ) ) { outerMostDepth = relativeDepth ; } targetAlignment = targetAlignment . enclosing ; relativeDepth ++ ; } if ( outerMostDepth >= <NUM_LIT:0> ) { throw new AlignmentException ( AlignmentException . LINE_TOO_LONG , outerMostDepth ) ; } relativeDepth = <NUM_LIT:0> ; targetAlignment = this . currentAlignment ; while ( targetAlignment != null ) { if ( targetAlignment . couldBreak ( ) ) { throw new AlignmentException ( AlignmentException . LINE_TOO_LONG , relativeDepth ) ; } targetAlignment = targetAlignment . enclosing ; relativeDepth ++ ; } } private void handleLineTooLongSmartly ( ) { int relativeDepth = <NUM_LIT:0> , outerMostDepth = - <NUM_LIT:1> ; Alignment targetAlignment = this . currentAlignment ; int previousKind = - <NUM_LIT:1> ; int insideMessage = <NUM_LIT:0> ; boolean insideStringConcat = false ; while ( targetAlignment != null ) { boolean couldBreak = targetAlignment . tieBreakRule == Alignment . R_OUTERMOST || ( ! insideStringConcat && insideMessage > <NUM_LIT:0> && targetAlignment . kind == Alignment . MESSAGE_ARGUMENTS && ( ! targetAlignment . wasReset ( ) || previousKind != Alignment . MESSAGE_SEND ) ) ; if ( couldBreak && targetAlignment . couldBreak ( ) ) { outerMostDepth = relativeDepth ; } switch ( targetAlignment . kind ) { case Alignment . MESSAGE_ARGUMENTS : case Alignment . MESSAGE_SEND : insideMessage ++ ; break ; case Alignment . STRING_CONCATENATION : insideStringConcat = true ; break ; } previousKind = targetAlignment . kind ; targetAlignment = targetAlignment . enclosing ; relativeDepth ++ ; } if ( outerMostDepth >= <NUM_LIT:0> ) { throw new AlignmentException ( AlignmentException . LINE_TOO_LONG , outerMostDepth ) ; } relativeDepth = <NUM_LIT:0> ; targetAlignment = this . currentAlignment ; AlignmentException alignmentException = null ; int msgArgsDepth = - <NUM_LIT:1> ; while ( targetAlignment != null ) { if ( targetAlignment . kind == Alignment . MESSAGE_ARGUMENTS ) { msgArgsDepth = relativeDepth ; } if ( alignmentException == null ) { if ( targetAlignment . couldBreak ( ) ) { alignmentException = new AlignmentException ( AlignmentException . LINE_TOO_LONG , relativeDepth ) ; if ( insideStringConcat ) throw alignmentException ; } } else if ( targetAlignment . wasSplit ) { if ( ! targetAlignment . wasReset ( ) ) { targetAlignment . reset ( ) ; if ( msgArgsDepth > alignmentException . relativeDepth ) { alignmentException . relativeDepth = msgArgsDepth ; } throw alignmentException ; } } targetAlignment = targetAlignment . enclosing ; relativeDepth ++ ; } if ( alignmentException != null ) { throw alignmentException ; } if ( this . currentAlignment != null ) { this . currentAlignment . blockAlign = false ; this . currentAlignment . tooLong = true ; } } private boolean hasNLSTag ( int sourceStart ) { if ( this . lineEnds == null ) return false ; int index = Arrays . binarySearch ( this . lineEnds , sourceStart ) ; int currentLineEnd = getLineEnd ( - index ) ; if ( currentLineEnd != - <NUM_LIT:1> ) { int commentIndex = getCommentIndex ( currentLineEnd ) ; if ( commentIndex < <NUM_LIT:0> ) { commentIndex = - commentIndex - <NUM_LIT:2> ; } if ( commentIndex >= <NUM_LIT:0> && commentIndex < this . commentPositions . length ) { int start = this . commentPositions [ commentIndex ] [ <NUM_LIT:0> ] ; if ( start < <NUM_LIT:0> ) { start = - start ; int lineIndexForComment = Arrays . binarySearch ( this . lineEnds , start ) ; if ( lineIndexForComment == index ) { return CharOperation . indexOf ( Scanner . TAG_PREFIX , this . scanner . source , true , start , currentLineEnd ) != - <NUM_LIT:1> ; } } } } return false ; } private boolean includesBlockComments ( ) { return ( ( this . formatComments & INCLUDE_BLOCK_COMMENTS ) == INCLUDE_BLOCK_COMMENTS && this . headerEndPosition < this . scanner . currentPosition ) || ( this . formatter . preferences . comment_format_header && this . headerEndPosition >= this . scanner . currentPosition ) ; } private boolean includesJavadocComments ( ) { return ( ( this . formatComments & INCLUDE_JAVA_DOC ) == INCLUDE_JAVA_DOC && this . headerEndPosition < this . scanner . currentPosition ) || ( this . formatter . preferences . comment_format_header && this . headerEndPosition >= this . scanner . currentPosition ) ; } private boolean includesLineComments ( ) { return ( ( this . formatComments & INCLUDE_LINE_COMMENTS ) == INCLUDE_LINE_COMMENTS && this . headerEndPosition < this . scanner . currentPosition ) || ( this . formatter . preferences . comment_format_header && this . headerEndPosition >= this . scanner . currentPosition ) ; } boolean includesComments ( ) { return ( this . formatComments & CodeFormatter . F_INCLUDE_COMMENTS ) != <NUM_LIT:0> ; } public void indent ( ) { this . indentationLevel += this . indentationSize ; this . numberOfIndentations ++ ; } private void initializeScanner ( long sourceLevel , DefaultCodeFormatterOptions preferences ) { this . useTags = preferences . use_tags ; char [ ] [ ] taskTags = null ; if ( this . useTags ) { this . disablingTag = preferences . disabling_tag ; this . enablingTag = preferences . enabling_tag ; if ( this . disablingTag == null ) { if ( this . enablingTag != null ) { taskTags = new char [ ] [ ] { this . enablingTag } ; } } else if ( this . enablingTag == null ) { taskTags = new char [ ] [ ] { this . disablingTag } ; } else { taskTags = new char [ ] [ ] { this . disablingTag , this . enablingTag } ; } } this . scanner = new Scanner ( true , true , false , sourceLevel , taskTags , null , true ) ; this . editsEnabled = true ; } private void initFormatterCommentParser ( ) { if ( this . formatterCommentParser == null ) { this . formatterCommentParser = new FormatterCommentParser ( this . scanner . sourceLevel ) ; } this . formatterCommentParser . scanner . setSource ( this . scanner . source ) ; this . formatterCommentParser . source = this . scanner . source ; this . formatterCommentParser . scanner . lineEnds = this . lineEnds ; this . formatterCommentParser . scanner . linePtr = this . maxLines ; this . formatterCommentParser . parseHtmlTags = this . formatter . preferences . comment_format_html ; } private boolean isOnFirstColumn ( int start ) { if ( this . lineEnds == null ) return start == <NUM_LIT:0> ; int index = Arrays . binarySearch ( this . lineEnds , start ) ; int previousLineEnd = getLineEnd ( - index - <NUM_LIT:1> ) ; return previousLineEnd != - <NUM_LIT:1> && previousLineEnd == start - <NUM_LIT:1> ; } private boolean isValidEdit ( OptimizedReplaceEdit edit ) { final int editLength = edit . length ; final int editReplacementLength = edit . replacement . length ( ) ; final int editOffset = edit . offset ; if ( editLength != <NUM_LIT:0> ) { IRegion covering = getCoveringAdaptedRegion ( editOffset , ( editOffset + editLength - <NUM_LIT:1> ) ) ; if ( covering != null ) { if ( editReplacementLength != <NUM_LIT:0> && editLength == editReplacementLength ) { for ( int i = editOffset , max = editOffset + editLength ; i < max ; i ++ ) { if ( this . scanner . source [ i ] != edit . replacement . charAt ( i - editOffset ) ) { return true ; } } return false ; } return true ; } IRegion starting = getAdaptedRegionAt ( editOffset + editLength ) ; if ( starting != null ) { int i = editOffset ; for ( int max = editOffset + editLength ; i < max ; i ++ ) { int replacementStringIndex = i - editOffset ; if ( replacementStringIndex >= editReplacementLength || this . scanner . source [ i ] != edit . replacement . charAt ( replacementStringIndex ) ) { break ; } } if ( i - editOffset != editReplacementLength && i != editOffset + editLength - <NUM_LIT:1> ) { edit . offset = starting . getOffset ( ) ; edit . length = <NUM_LIT:0> ; edit . replacement = edit . replacement . substring ( i - editOffset ) ; return true ; } } return false ; } IRegion covering = getCoveringAdaptedRegion ( editOffset , editOffset ) ; if ( covering != null ) { return true ; } if ( editOffset == this . scannerEndPosition ) { int index = Arrays . binarySearch ( this . adaptedRegions , new Region ( editOffset , <NUM_LIT:0> ) , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { IRegion r1 = ( IRegion ) o1 ; IRegion r2 = ( IRegion ) o2 ; int r1End = r1 . getOffset ( ) + r1 . getLength ( ) ; int r2End = r2 . getOffset ( ) + r2 . getLength ( ) ; return r1End - r2End ; } } ) ; if ( index < <NUM_LIT:0> ) { return false ; } return true ; } return false ; } private void preserveEmptyLines ( int count , int insertPosition ) { if ( count > <NUM_LIT:0> ) { if ( this . blank_lines_between_import_groups >= <NUM_LIT:0> ) { printEmptyLines ( this . blank_lines_between_import_groups , insertPosition ) ; } else if ( this . formatter . preferences . number_of_empty_lines_to_preserve != <NUM_LIT:0> ) { int linesToPreserve = Math . min ( count , this . formatter . preferences . number_of_empty_lines_to_preserve ) ; printEmptyLines ( linesToPreserve , insertPosition ) ; } else { printNewLine ( insertPosition ) ; } } } private void print ( int length , boolean considerSpaceIfAny ) { if ( this . checkLineWrapping && length + this . column > this . pageWidth ) { handleLineTooLong ( ) ; } this . lastNumberOfNewLines = <NUM_LIT:0> ; if ( this . indentationLevel != <NUM_LIT:0> ) { printIndentationIfNecessary ( ) ; } if ( considerSpaceIfAny ) { space ( ) ; } if ( this . pendingSpace ) { addInsertEdit ( this . scanner . getCurrentTokenStartPosition ( ) , "<STR_LIT:U+0020>" ) ; } this . pendingSpace = false ; this . needSpace = false ; this . column += length ; this . needSpace = true ; } private void printBlockComment ( boolean isJavadoc ) { int currentTokenStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; int currentTokenEndPosition = this . scanner . getCurrentTokenEndPosition ( ) + <NUM_LIT:1> ; boolean includesBlockComments = ! isJavadoc && includesBlockComments ( ) ; this . scanner . resetTo ( currentTokenStartPosition , currentTokenEndPosition - <NUM_LIT:1> ) ; int currentCharacter ; boolean isNewLine = false ; int start = currentTokenStartPosition ; int nextCharacterStart = currentTokenStartPosition ; int previousStart = currentTokenStartPosition ; boolean onFirstColumn = isOnFirstColumn ( start ) ; boolean indentComment = false ; if ( this . indentationLevel != <NUM_LIT:0> ) { if ( isJavadoc || ! this . formatter . preferences . never_indent_block_comments_on_first_column || ! onFirstColumn ) { indentComment = true ; printIndentationIfNecessary ( ) ; } } if ( this . pendingSpace ) { addInsertEdit ( currentTokenStartPosition , "<STR_LIT:U+0020>" ) ; } this . needSpace = false ; this . pendingSpace = false ; int commentColumn = this . column ; if ( includesBlockComments ) { if ( printBlockComment ( currentTokenStartPosition , currentTokenEndPosition ) ) { return ; } } int currentIndentationLevel = this . indentationLevel ; if ( ( commentColumn - <NUM_LIT:1> ) > this . indentationLevel ) { this . indentationLevel = commentColumn - <NUM_LIT:1> ; } int currentCommentIndentation = onFirstColumn ? <NUM_LIT:0> : getCurrentCommentIndentation ( start ) ; boolean formatComment = ( isJavadoc && ( this . formatComments & CodeFormatter . K_JAVA_DOC ) != <NUM_LIT:0> ) || ( ! isJavadoc && ( this . formatComments & CodeFormatter . K_MULTI_LINE_COMMENT ) != <NUM_LIT:0> ) ; try { while ( nextCharacterStart <= currentTokenEndPosition && ( currentCharacter = this . scanner . getNextChar ( ) ) != - <NUM_LIT:1> ) { nextCharacterStart = this . scanner . currentPosition ; switch ( currentCharacter ) { case '<STR_LIT>' : start = previousStart ; isNewLine = true ; if ( this . scanner . getNextChar ( '<STR_LIT:\n>' ) ) { currentCharacter = '<STR_LIT:\n>' ; nextCharacterStart = this . scanner . currentPosition ; } break ; case '<STR_LIT:\n>' : start = previousStart ; isNewLine = true ; nextCharacterStart = this . scanner . currentPosition ; break ; default : if ( isNewLine ) { this . column = <NUM_LIT:1> ; this . line ++ ; isNewLine = false ; boolean addSpace = false ; if ( onFirstColumn ) { if ( formatComment ) { if ( ScannerHelper . isWhitespace ( ( char ) currentCharacter ) ) { int previousStartPosition = this . scanner . currentPosition ; while ( currentCharacter != - <NUM_LIT:1> && currentCharacter != '<STR_LIT>' && currentCharacter != '<STR_LIT:\n>' && ScannerHelper . isWhitespace ( ( char ) currentCharacter ) ) { previousStart = nextCharacterStart ; previousStartPosition = this . scanner . currentPosition ; currentCharacter = this . scanner . getNextChar ( ) ; nextCharacterStart = this . scanner . currentPosition ; } if ( currentCharacter == '<STR_LIT>' || currentCharacter == '<STR_LIT:\n>' ) { nextCharacterStart = previousStartPosition ; } } if ( currentCharacter != '<STR_LIT>' && currentCharacter != '<STR_LIT:\n>' ) { addSpace = true ; } } } else { if ( ScannerHelper . isWhitespace ( ( char ) currentCharacter ) ) { int previousStartPosition = this . scanner . currentPosition ; int currentIndentation = <NUM_LIT:0> ; loop : while ( currentCharacter != - <NUM_LIT:1> && currentCharacter != '<STR_LIT>' && currentCharacter != '<STR_LIT:\n>' && ScannerHelper . isWhitespace ( ( char ) currentCharacter ) ) { if ( currentIndentation >= currentCommentIndentation ) { break loop ; } previousStart = nextCharacterStart ; previousStartPosition = this . scanner . currentPosition ; switch ( currentCharacter ) { case '<STR_LIT:\t>' : if ( this . tabLength != <NUM_LIT:0> ) { int reminder = currentIndentation % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { currentIndentation += this . tabLength ; } else { currentIndentation = ( ( currentIndentation / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } } break ; default : currentIndentation ++ ; } currentCharacter = this . scanner . getNextChar ( ) ; nextCharacterStart = this . scanner . currentPosition ; } if ( currentCharacter == '<STR_LIT>' || currentCharacter == '<STR_LIT:\n>' ) { nextCharacterStart = previousStartPosition ; } } if ( formatComment ) { int previousStartTemp = previousStart ; int nextCharacterStartTemp = nextCharacterStart ; while ( currentCharacter != - <NUM_LIT:1> && currentCharacter != '<STR_LIT>' && currentCharacter != '<STR_LIT:\n>' && ScannerHelper . isWhitespace ( ( char ) currentCharacter ) ) { previousStart = nextCharacterStart ; currentCharacter = this . scanner . getNextChar ( ) ; nextCharacterStart = this . scanner . currentPosition ; } if ( currentCharacter == '<CHAR_LIT>' ) { addSpace = true ; } else { previousStart = previousStartTemp ; nextCharacterStart = nextCharacterStartTemp ; } this . scanner . currentPosition = nextCharacterStart ; } } String replacement ; if ( indentComment ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( this . lineSeparator ) ; if ( this . indentationLevel > <NUM_LIT:0> ) { printIndentationIfNecessary ( this . tempBuffer ) ; } if ( addSpace ) { this . tempBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } replacement = this . tempBuffer . toString ( ) ; } else { replacement = addSpace ? this . lineSeparatorAndSpace : this . lineSeparator ; } addReplaceEdit ( start , previousStart - <NUM_LIT:1> , replacement ) ; } else { this . column += ( nextCharacterStart - previousStart ) ; } } previousStart = nextCharacterStart ; this . scanner . currentPosition = nextCharacterStart ; } } finally { this . indentationLevel = currentIndentationLevel ; } this . lastNumberOfNewLines = <NUM_LIT:0> ; this . needSpace = false ; this . scanner . resetTo ( currentTokenEndPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; } private boolean printBlockComment ( int currentTokenStartPosition , int currentTokenEndPosition ) { int maxColumn = this . formatter . preferences . comment_line_length + <NUM_LIT:1> ; int indentLevel = this . indentationLevel ; int indentations = this . numberOfIndentations ; switch ( this . tabChar ) { case DefaultCodeFormatterOptions . TAB : switch ( this . tabLength ) { case <NUM_LIT:0> : this . indentationLevel = <NUM_LIT:0> ; this . column = <NUM_LIT:1> ; this . numberOfIndentations = <NUM_LIT:0> ; break ; case <NUM_LIT:1> : this . indentationLevel = this . column - <NUM_LIT:1> ; this . numberOfIndentations = this . indentationLevel ; break ; default : this . indentationLevel = ( this . column / this . tabLength ) * this . tabLength ; this . column = this . indentationLevel + <NUM_LIT:1> ; this . numberOfIndentations = this . indentationLevel / this . tabLength ; } break ; case DefaultCodeFormatterOptions . MIXED : if ( this . tabLength == <NUM_LIT:0> ) { this . indentationLevel = <NUM_LIT:0> ; this . column = <NUM_LIT:1> ; this . numberOfIndentations = <NUM_LIT:0> ; } else { this . indentationLevel = this . column - <NUM_LIT:1> ; this . numberOfIndentations = this . indentationLevel / this . tabLength ; } break ; case DefaultCodeFormatterOptions . SPACE : if ( this . indentationSize == <NUM_LIT:0> ) { this . indentationLevel = <NUM_LIT:0> ; this . column = <NUM_LIT:1> ; this . numberOfIndentations = <NUM_LIT:0> ; } else { this . indentationLevel = this . column - <NUM_LIT:1> ; } break ; } this . blockCommentBuffer . setLength ( <NUM_LIT:0> ) ; this . scanner . getNextChar ( ) ; this . scanner . getNextChar ( ) ; this . column += <NUM_LIT:2> ; this . scanner . skipComments = true ; this . blockCommentTokensBuffer . setLength ( <NUM_LIT:0> ) ; int editStart = this . scanner . currentPosition ; int editEnd = - <NUM_LIT:1> ; int previousToken = - <NUM_LIT:1> ; boolean newLine = false ; boolean multiLines = false ; boolean hasMultiLines = false ; boolean hasTokens = false ; boolean bufferHasTokens = false ; boolean bufferHasNewLine = false ; boolean lineHasTokens = false ; int hasTextOnFirstLine = <NUM_LIT:0> ; boolean firstWord = true ; boolean clearBlankLines = this . formatter . preferences . comment_clear_blank_lines_in_block_comment ; boolean joinLines = this . formatter . preferences . join_lines_in_comments ; boolean newLinesAtBoundaries = this . formatter . preferences . comment_new_lines_at_block_boundaries ; int scannerLine = Util . getLineNumber ( this . scanner . currentPosition , this . lineEnds , <NUM_LIT:0> , this . maxLines ) ; int firstLine = scannerLine ; int lineNumber = scannerLine ; int lastTextLine = - <NUM_LIT:1> ; while ( ! this . scanner . atEnd ( ) ) { int token ; try { token = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException iie ) { token = consumeInvalidToken ( currentTokenEndPosition - <NUM_LIT:1> ) ; newLine = false ; } boolean insertSpace = ( previousToken == TerminalTokens . TokenNameWHITESPACE ) && ( ! firstWord || ! hasTokens ) ; boolean isTokenStar = false ; switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( this . blockCommentTokensBuffer . length ( ) > <NUM_LIT:0> ) { if ( hasTextOnFirstLine == <NUM_LIT:1> && multiLines ) { printBlockCommentHeaderLine ( this . blockCommentBuffer ) ; hasTextOnFirstLine = - <NUM_LIT:1> ; } this . blockCommentBuffer . append ( this . blockCommentTokensBuffer ) ; this . column += this . blockCommentTokensBuffer . length ( ) ; this . blockCommentTokensBuffer . setLength ( <NUM_LIT:0> ) ; bufferHasTokens = true ; bufferHasNewLine = false ; } if ( previousToken == - <NUM_LIT:1> ) { previousToken = SKIP_FIRST_WHITESPACE_TOKEN ; } else { previousToken = token ; } lineNumber = Util . getLineNumber ( this . scanner . currentPosition , this . lineEnds , scannerLine > <NUM_LIT:1> ? scannerLine - <NUM_LIT:2> : <NUM_LIT:0> , this . maxLines ) ; if ( lineNumber > scannerLine ) { hasMultiLines = true ; newLine = true ; } scannerLine = lineNumber ; continue ; case TerminalTokens . TokenNameMULTIPLY : isTokenStar = true ; lineNumber = Util . getLineNumber ( this . scanner . currentPosition , this . lineEnds , scannerLine > <NUM_LIT:1> ? scannerLine - <NUM_LIT:2> : <NUM_LIT:0> , this . maxLines ) ; if ( lineNumber == firstLine && previousToken == SKIP_FIRST_WHITESPACE_TOKEN ) { this . blockCommentBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } previousToken = token ; if ( this . scanner . currentCharacter == '<CHAR_LIT:/>' ) { editEnd = this . scanner . startPosition - <NUM_LIT:1> ; if ( this . blockCommentTokensBuffer . length ( ) > <NUM_LIT:0> ) { this . blockCommentBuffer . append ( this . blockCommentTokensBuffer ) ; this . column += this . blockCommentTokensBuffer . length ( ) ; } if ( newLinesAtBoundaries ) { if ( multiLines || hasMultiLines ) { this . blockCommentBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . blockCommentBuffer ) ; } } this . blockCommentBuffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column += BLOCK_FOOTER_LENGTH + <NUM_LIT:1> ; this . scanner . getNextChar ( ) ; continue ; } if ( newLine ) { scannerLine = lineNumber ; newLine = false ; continue ; } break ; case TerminalTokens . TokenNameMULTIPLY_EQUAL : if ( newLine ) { this . scanner . resetTo ( this . scanner . startPosition , currentTokenEndPosition - <NUM_LIT:1> ) ; this . scanner . getNextChar ( ) ; previousToken = TerminalTokens . TokenNameMULTIPLY ; scannerLine = Util . getLineNumber ( this . scanner . currentPosition , this . lineEnds , scannerLine > <NUM_LIT:1> ? scannerLine - <NUM_LIT:2> : <NUM_LIT:0> , this . maxLines ) ; continue ; } break ; case TerminalTokens . TokenNameMINUS : case TerminalTokens . TokenNameMINUS_MINUS : if ( previousToken == - <NUM_LIT:1> ) { this . indentationLevel = indentLevel ; this . numberOfIndentations = indentations ; this . lastNumberOfNewLines = <NUM_LIT:0> ; this . needSpace = false ; this . scanner . skipComments = false ; this . scanner . resetTo ( currentTokenStartPosition , currentTokenEndPosition - <NUM_LIT:1> ) ; return false ; } break ; default : break ; } int linesGap ; int max ; lineNumber = Util . getLineNumber ( this . scanner . currentPosition , this . lineEnds , scannerLine > <NUM_LIT:1> ? scannerLine - <NUM_LIT:2> : <NUM_LIT:0> , this . maxLines ) ; if ( lastTextLine == - <NUM_LIT:1> ) { linesGap = newLinesAtBoundaries ? lineNumber - firstLine : <NUM_LIT:0> ; max = <NUM_LIT:0> ; } else { linesGap = lineNumber - lastTextLine ; if ( token == TerminalTokens . TokenNameAT && linesGap == <NUM_LIT:1> ) { linesGap = <NUM_LIT:2> ; } max = joinLines && lineHasTokens ? <NUM_LIT:1> : <NUM_LIT:0> ; } if ( linesGap > max ) { if ( clearBlankLines ) { if ( token == TerminalTokens . TokenNameAT ) { linesGap = <NUM_LIT:1> ; } else { linesGap = ( max == <NUM_LIT:0> || ! joinLines ) ? <NUM_LIT:1> : <NUM_LIT:0> ; } } for ( int i = <NUM_LIT:0> ; i < linesGap ; i ++ ) { if ( this . blockCommentTokensBuffer . length ( ) > <NUM_LIT:0> ) { if ( hasTextOnFirstLine == <NUM_LIT:1> ) { printBlockCommentHeaderLine ( this . blockCommentBuffer ) ; hasTextOnFirstLine = - <NUM_LIT:1> ; } this . blockCommentBuffer . append ( this . blockCommentTokensBuffer ) ; this . blockCommentTokensBuffer . setLength ( <NUM_LIT:0> ) ; bufferHasTokens = true ; } this . blockCommentBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . blockCommentBuffer ) ; this . blockCommentBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; firstWord = true ; multiLines = true ; bufferHasNewLine = true ; } insertSpace = insertSpace && linesGap == <NUM_LIT:0> ; } if ( newLine ) lineHasTokens = false ; int tokenStart = this . scanner . getCurrentTokenStartPosition ( ) ; int tokenLength = ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - tokenStart ; hasTokens = true ; if ( ! isTokenStar ) lineHasTokens = true ; if ( hasTextOnFirstLine == <NUM_LIT:0> && ! isTokenStar ) { if ( firstLine == lineNumber ) { hasTextOnFirstLine = <NUM_LIT:1> ; this . column ++ ; } else { hasTextOnFirstLine = - <NUM_LIT:1> ; } } int lastColumn = this . column + this . blockCommentTokensBuffer . length ( ) + tokenLength ; if ( insertSpace ) lastColumn ++ ; if ( lineHasTokens && ! firstWord && lastColumn > maxColumn ) { String tokensString = this . blockCommentTokensBuffer . toString ( ) . trim ( ) ; int tokensStringLength = tokensString . length ( ) ; if ( hasTextOnFirstLine == <NUM_LIT:1> ) { printBlockCommentHeaderLine ( this . blockCommentBuffer ) ; } if ( ( this . indentationLevel + tokensStringLength + tokenLength ) > maxColumn ) { this . blockCommentBuffer . append ( this . blockCommentTokensBuffer ) ; this . column += this . blockCommentTokensBuffer . length ( ) ; this . blockCommentTokensBuffer . setLength ( <NUM_LIT:0> ) ; bufferHasNewLine = false ; bufferHasTokens = true ; } if ( bufferHasTokens && ! bufferHasNewLine ) { this . blockCommentBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . blockCommentBuffer ) ; this . blockCommentBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; } if ( this . blockCommentTokensBuffer . length ( ) > <NUM_LIT:0> ) { this . blockCommentBuffer . append ( tokensString ) ; this . column += tokensStringLength ; this . blockCommentTokensBuffer . setLength ( <NUM_LIT:0> ) ; } this . blockCommentBuffer . append ( this . scanner . source , tokenStart , tokenLength ) ; bufferHasTokens = true ; bufferHasNewLine = false ; this . column += tokenLength ; multiLines = true ; hasTextOnFirstLine = - <NUM_LIT:1> ; } else { if ( insertSpace ) { this . blockCommentTokensBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } this . blockCommentTokensBuffer . append ( this . scanner . source , tokenStart , tokenLength ) ; } previousToken = token ; newLine = false ; firstWord = false ; scannerLine = lineNumber ; lastTextLine = lineNumber ; } if ( this . nlsTagCounter == <NUM_LIT:0> || ! multiLines ) { if ( hasTokens || multiLines ) { StringBuffer replacement ; if ( hasTextOnFirstLine == <NUM_LIT:1> ) { this . blockCommentTokensBuffer . setLength ( <NUM_LIT:0> ) ; replacement = this . blockCommentTokensBuffer ; if ( ( hasMultiLines || multiLines ) ) { int col = this . column ; replacement . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( replacement ) ; replacement . append ( BLOCK_LINE_PREFIX ) ; this . column = col ; } else if ( this . blockCommentBuffer . length ( ) == <NUM_LIT:0> || this . blockCommentBuffer . charAt ( <NUM_LIT:0> ) != '<CHAR_LIT:U+0020>' ) { replacement . append ( '<CHAR_LIT:U+0020>' ) ; } replacement . append ( this . blockCommentBuffer ) ; } else { replacement = this . blockCommentBuffer ; } addReplaceEdit ( editStart , editEnd , replacement . toString ( ) ) ; } } this . indentationLevel = indentLevel ; this . numberOfIndentations = indentations ; this . lastNumberOfNewLines = <NUM_LIT:0> ; this . needSpace = false ; this . scanner . resetTo ( currentTokenEndPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; this . scanner . skipComments = false ; return true ; } private void printBlockCommentHeaderLine ( StringBuffer buffer ) { if ( ! this . formatter . preferences . comment_new_lines_at_block_boundaries ) { buffer . insert ( <NUM_LIT:0> , '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } else if ( buffer . length ( ) == <NUM_LIT:0> ) { buffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( buffer ) ; buffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; } else { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; buffer . insert ( <NUM_LIT:0> , this . tempBuffer . toString ( ) ) ; } } public void printEndOfCompilationUnit ( ) { try { int currentTokenStartPosition = this . scanner . currentPosition ; boolean hasComment = false ; boolean hasLineComment = false ; boolean hasWhitespace = false ; int count = <NUM_LIT:0> ; while ( true ) { this . currentToken = this . scanner . getNextToken ( ) ; switch ( this . currentToken ) { case TerminalTokens . TokenNameWHITESPACE : char [ ] whiteSpaces = this . scanner . getCurrentTokenSource ( ) ; count = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = whiteSpaces . length ; i < max ; i ++ ) { switch ( whiteSpaces [ i ] ) { case '<STR_LIT>' : if ( ( i + <NUM_LIT:1> ) < max ) { if ( whiteSpaces [ i + <NUM_LIT:1> ] == '<STR_LIT:\n>' ) { i ++ ; } } count ++ ; break ; case '<STR_LIT:\n>' : count ++ ; } } if ( count == <NUM_LIT:0> ) { hasWhitespace = true ; addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; } else if ( hasLineComment ) { preserveEmptyLines ( count , this . scanner . getCurrentTokenStartPosition ( ) ) ; addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; } else if ( hasComment ) { if ( count == <NUM_LIT:1> ) { this . printNewLine ( this . scanner . getCurrentTokenStartPosition ( ) ) ; } else { preserveEmptyLines ( count - <NUM_LIT:1> , this . scanner . getCurrentTokenStartPosition ( ) ) ; } addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; } else { addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; } currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_LINE : if ( count >= <NUM_LIT:1> ) { if ( count > <NUM_LIT:1> ) { preserveEmptyLines ( count - <NUM_LIT:1> , this . scanner . getCurrentTokenStartPosition ( ) ) ; } else if ( count == <NUM_LIT:1> ) { printNewLine ( this . scanner . getCurrentTokenStartPosition ( ) ) ; } } else if ( hasWhitespace ) { space ( ) ; } hasWhitespace = false ; printLineComment ( ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasLineComment = true ; count = <NUM_LIT:0> ; break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : if ( count >= <NUM_LIT:1> ) { if ( count > <NUM_LIT:1> ) { preserveEmptyLines ( count - <NUM_LIT:1> , this . scanner . getCurrentTokenStartPosition ( ) ) ; } else if ( count == <NUM_LIT:1> ) { printNewLine ( this . scanner . getCurrentTokenStartPosition ( ) ) ; } } else if ( hasWhitespace ) { space ( ) ; } hasWhitespace = false ; printBlockComment ( false ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasLineComment = false ; hasComment = true ; count = <NUM_LIT:0> ; break ; case TerminalTokens . TokenNameCOMMENT_JAVADOC : if ( count >= <NUM_LIT:1> ) { if ( count > <NUM_LIT:1> ) { preserveEmptyLines ( count - <NUM_LIT:1> , this . scanner . startPosition ) ; } else if ( count == <NUM_LIT:1> ) { printNewLine ( this . scanner . startPosition ) ; } } else if ( hasWhitespace ) { space ( ) ; } hasWhitespace = false ; if ( includesJavadocComments ( ) ) { printJavadocComment ( this . scanner . startPosition , this . scanner . currentPosition ) ; } else { printBlockComment ( true ) ; } printNewLine ( ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasLineComment = false ; hasComment = true ; count = <NUM_LIT:0> ; break ; case TerminalTokens . TokenNameSEMICOLON : print ( this . scanner . currentPosition - this . scanner . startPosition , this . formatter . preferences . insert_space_before_semicolon ) ; break ; case TerminalTokens . TokenNameEOF : if ( count >= <NUM_LIT:1> || this . formatter . preferences . insert_new_line_at_end_of_file_if_missing ) { this . printNewLine ( this . scannerEndPosition ) ; } return ; default : this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } } } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } private void printCodeSnippet ( int startPosition , int endPosition , int linesGap ) { String snippet = new String ( this . scanner . source , startPosition , endPosition - startPosition + <NUM_LIT:1> ) ; int firstLine = Util . getLineNumber ( startPosition , this . lineEnds , <NUM_LIT:0> , this . maxLines ) - <NUM_LIT:1> ; int lastLine = Util . getLineNumber ( endPosition , this . lineEnds , firstLine > <NUM_LIT:1> ? firstLine - <NUM_LIT:2> : <NUM_LIT:0> , this . maxLines ) - <NUM_LIT:1> ; this . codeSnippetBuffer . setLength ( <NUM_LIT:0> ) ; if ( firstLine == lastLine && linesGap == <NUM_LIT:0> ) { this . codeSnippetBuffer . append ( snippet ) ; } else { boolean hasCharsAfterStar = false ; if ( linesGap == <NUM_LIT:0> ) { this . codeSnippetBuffer . append ( this . scanner . source , startPosition , this . lineEnds [ firstLine ] + <NUM_LIT:1> - startPosition ) ; firstLine ++ ; } int initialLength = this . codeSnippetBuffer . length ( ) ; for ( int currentLine = firstLine ; currentLine <= lastLine ; currentLine ++ ) { this . scanner . resetTo ( this . lineEnds [ currentLine - <NUM_LIT:1> ] + <NUM_LIT:1> , this . lineEnds [ currentLine ] ) ; int lineStart = this . scanner . currentPosition ; boolean hasStar = false ; loop : while ( ! this . scanner . atEnd ( ) ) { char ch = ( char ) this . scanner . getNextChar ( ) ; switch ( ch ) { case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : case '<CHAR_LIT>' : break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : break loop ; case '<CHAR_LIT>' : hasStar = true ; break loop ; default : if ( ScannerHelper . isWhitespace ( ch ) ) { break ; } break loop ; } } if ( hasStar ) { lineStart = this . scanner . currentPosition ; if ( ! hasCharsAfterStar && ! this . scanner . atEnd ( ) ) { char ch = ( char ) this . scanner . getNextChar ( ) ; boolean atEnd = this . scanner . atEnd ( ) ; switch ( ch ) { case '<CHAR_LIT:U+0020>' : case '<STR_LIT:\t>' : case '<CHAR_LIT>' : break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : atEnd = true ; break ; default : if ( ! ScannerHelper . isWhitespace ( ch ) ) { if ( hasStar ) { hasCharsAfterStar = true ; currentLine = firstLine - <NUM_LIT:1> ; this . codeSnippetBuffer . setLength ( initialLength ) ; continue ; } } break ; } if ( ! hasCharsAfterStar && ! atEnd ) { lineStart = this . scanner . currentPosition ; } } } int end = currentLine == lastLine ? endPosition : this . lineEnds [ currentLine ] ; this . codeSnippetBuffer . append ( this . scanner . source , lineStart , end + <NUM_LIT:1> - lineStart ) ; } } HTMLEntity2JavaReader reader = new HTMLEntity2JavaReader ( new StringReader ( this . codeSnippetBuffer . toString ( ) ) ) ; char [ ] buf = new char [ this . codeSnippetBuffer . length ( ) ] ; String convertedSnippet ; try { int read = reader . read ( buf ) ; convertedSnippet = new String ( buf , <NUM_LIT:0> , read ) ; } catch ( IOException e ) { CommentFormatterUtil . log ( e ) ; return ; } String formattedSnippet = convertedSnippet ; Map options = this . formatter . preferences . getMap ( ) ; if ( this . scanner . sourceLevel > ClassFileConstants . JDK1_3 ) { options . put ( JavaCore . COMPILER_SOURCE , CompilerOptions . versionFromJdkLevel ( this . scanner . sourceLevel ) ) ; } TextEdit edit = CommentFormatterUtil . format2 ( CodeFormatter . K_UNKNOWN | CodeFormatter . F_INCLUDE_COMMENTS , convertedSnippet , <NUM_LIT:0> , this . lineSeparator , options ) ; if ( edit == null ) { formattedSnippet = this . codeSnippetBuffer . toString ( ) ; } else { formattedSnippet = CommentFormatterUtil . evaluateFormatterEdit ( convertedSnippet , edit , null ) ; Java2HTMLEntityReader javaReader = new Java2HTMLEntityReader ( new StringReader ( formattedSnippet ) ) ; buf = new char [ <NUM_LIT> ] ; this . codeSnippetBuffer . setLength ( <NUM_LIT:0> ) ; int l ; try { do { l = javaReader . read ( buf ) ; if ( l != - <NUM_LIT:1> ) this . codeSnippetBuffer . append ( buf , <NUM_LIT:0> , l ) ; } while ( l > <NUM_LIT:0> ) ; formattedSnippet = this . codeSnippetBuffer . toString ( ) ; } catch ( IOException e ) { CommentFormatterUtil . log ( e ) ; return ; } } this . codeSnippetBuffer . setLength ( <NUM_LIT:0> ) ; ILineTracker tracker = new DefaultLineTracker ( ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . codeSnippetBuffer ) ; this . codeSnippetBuffer . append ( BLOCK_LINE_PREFIX ) ; String linePrefix = this . codeSnippetBuffer . toString ( ) ; this . codeSnippetBuffer . setLength ( <NUM_LIT:0> ) ; String replacement = formattedSnippet ; tracker . set ( formattedSnippet ) ; int numberOfLines = tracker . getNumberOfLines ( ) ; if ( numberOfLines > <NUM_LIT:1> ) { int lastLineOffset = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i < numberOfLines - <NUM_LIT:1> ; i ++ ) { if ( i > <NUM_LIT:0> ) this . codeSnippetBuffer . append ( linePrefix ) ; try { lastLineOffset = tracker . getLineOffset ( i + <NUM_LIT:1> ) ; this . codeSnippetBuffer . append ( formattedSnippet . substring ( tracker . getLineOffset ( i ) , lastLineOffset ) ) ; } catch ( BadLocationException e ) { CommentFormatterUtil . log ( e ) ; return ; } } this . codeSnippetBuffer . append ( linePrefix ) ; this . codeSnippetBuffer . append ( formattedSnippet . substring ( lastLineOffset ) ) ; replacement = this . codeSnippetBuffer . toString ( ) ; } addReplaceEdit ( startPosition , endPosition , replacement ) ; } void printComment ( ) { printComment ( CodeFormatter . K_UNKNOWN , NO_TRAILING_COMMENT ) ; } void printComment ( int kind , int trailing ) { final boolean rejectLineComment = kind == CodeFormatter . K_MULTI_LINE_COMMENT || kind == CodeFormatter . K_JAVA_DOC ; final boolean rejectBlockComment = kind == CodeFormatter . K_SINGLE_LINE_COMMENT || kind == CodeFormatter . K_JAVA_DOC ; final boolean rejectJavadocComment = kind == CodeFormatter . K_SINGLE_LINE_COMMENT || kind == CodeFormatter . K_MULTI_LINE_COMMENT ; try { int currentTokenStartPosition = this . scanner . currentPosition ; boolean hasComment = false ; boolean hasLineComment = false ; boolean hasWhitespaces = false ; int lines = <NUM_LIT:0> ; while ( ( this . currentToken = this . scanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { int foundTaskCount = this . scanner . foundTaskCount ; switch ( this . currentToken ) { case TerminalTokens . TokenNameWHITESPACE : char [ ] whiteSpaces = this . scanner . getCurrentTokenSource ( ) ; int whitespacesStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; int whitespacesEndPosition = this . scanner . getCurrentTokenEndPosition ( ) ; lines = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> , max = whiteSpaces . length ; i < max ; i ++ ) { switch ( whiteSpaces [ i ] ) { case '<STR_LIT>' : if ( ( i + <NUM_LIT:1> ) < max ) { if ( whiteSpaces [ i + <NUM_LIT:1> ] == '<STR_LIT:\n>' ) { i ++ ; } } lines ++ ; break ; case '<STR_LIT:\n>' : lines ++ ; } } boolean realTrailing = trailing > NO_TRAILING_COMMENT ; if ( realTrailing && this . scanner . currentCharacter == '<CHAR_LIT:/>' && ( lines == <NUM_LIT:0> || ( lines == <NUM_LIT:1> && ! hasLineComment && trailing == IMPORT_TRAILING_COMMENT ) ) ) { boolean canChangeTrailing = ( trailing & COMPLEX_TRAILING_COMMENT ) != <NUM_LIT:0> ; if ( trailing == BASIC_TRAILING_COMMENT && hasLineComment ) { int currentCommentIndentation = getCurrentIndentation ( whiteSpaces , <NUM_LIT:0> ) ; int relativeIndentation = currentCommentIndentation - this . lastLineComment . currentIndentation ; if ( this . tabLength == <NUM_LIT:0> ) { canChangeTrailing = relativeIndentation == <NUM_LIT:0> ; } else { canChangeTrailing = relativeIndentation > - this . tabLength ; } } if ( canChangeTrailing ) { int currentPosition = this . scanner . currentPosition ; if ( this . scanner . getNextToken ( ) == TerminalTokens . TokenNameCOMMENT_LINE ) { realTrailing = ! hasLineComment ; switch ( this . scanner . getNextToken ( ) ) { case TerminalTokens . TokenNameCOMMENT_LINE : realTrailing = false ; break ; case TerminalTokens . TokenNameWHITESPACE : if ( this . scanner . getNextToken ( ) == TerminalTokens . TokenNameCOMMENT_LINE ) { realTrailing = false ; } break ; } } this . scanner . resetTo ( currentPosition , this . scanner . eofPosition - <NUM_LIT:1> ) ; } } if ( lines > <NUM_LIT:1> || ( lines == <NUM_LIT:1> && hasLineComment ) ) { this . lastLineComment . contiguous = false ; } this . lastLineComment . leadingSpaces = whiteSpaces ; this . lastLineComment . lines = lines ; if ( realTrailing ) { if ( hasLineComment ) { if ( lines >= <NUM_LIT:1> ) { currentTokenStartPosition = whitespacesStartPosition ; preserveEmptyLines ( lines , currentTokenStartPosition ) ; addDeleteEdit ( currentTokenStartPosition , whitespacesEndPosition ) ; this . scanner . resetTo ( this . scanner . currentPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } if ( lines >= <NUM_LIT:1> ) { if ( hasComment ) { this . printNewLine ( whitespacesStartPosition ) ; } this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } hasWhitespaces = true ; currentTokenStartPosition = this . scanner . currentPosition ; addDeleteEdit ( whitespacesStartPosition , whitespacesEndPosition ) ; } else { if ( lines == <NUM_LIT:0> ) { hasWhitespaces = true ; addDeleteEdit ( whitespacesStartPosition , whitespacesEndPosition ) ; } else if ( hasLineComment ) { currentTokenStartPosition = whitespacesStartPosition ; preserveEmptyLines ( lines , currentTokenStartPosition ) ; addDeleteEdit ( currentTokenStartPosition , whitespacesEndPosition ) ; } else if ( hasComment ) { if ( lines == <NUM_LIT:1> ) { this . printNewLine ( whitespacesStartPosition ) ; } else { preserveEmptyLines ( lines - <NUM_LIT:1> , whitespacesStartPosition ) ; } addDeleteEdit ( whitespacesStartPosition , whitespacesEndPosition ) ; } else if ( lines != <NUM_LIT:0> && ( ! this . formatter . preferences . join_wrapped_lines || this . formatter . preferences . number_of_empty_lines_to_preserve != <NUM_LIT:0> || this . blank_lines_between_import_groups > <NUM_LIT:0> ) ) { addReplaceEdit ( whitespacesStartPosition , whitespacesEndPosition , getPreserveEmptyLines ( lines - <NUM_LIT:1> ) ) ; } else { addDeleteEdit ( whitespacesStartPosition , whitespacesEndPosition ) ; } } currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_LINE : if ( this . useTags && this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; if ( ! this . editsEnabled && this . editsIndex > <NUM_LIT:1> ) { OptimizedReplaceEdit currentEdit = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; if ( this . scanner . startPosition == currentEdit . offset + currentEdit . length ) { printNewLinesBeforeDisablingComment ( ) ; } } } if ( rejectLineComment ) break ; if ( lines >= <NUM_LIT:1> ) { if ( lines > <NUM_LIT:1> ) { preserveEmptyLines ( lines - <NUM_LIT:1> , this . scanner . getCurrentTokenStartPosition ( ) ) ; } else if ( lines == <NUM_LIT:1> ) { printNewLine ( this . scanner . getCurrentTokenStartPosition ( ) ) ; } } else if ( hasWhitespaces ) { space ( ) ; } hasWhitespaces = false ; printLineComment ( ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasLineComment = true ; lines = <NUM_LIT:0> ; if ( this . useTags && ! this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; } break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : if ( this . useTags && this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; if ( ! this . editsEnabled && this . editsIndex > <NUM_LIT:1> ) { OptimizedReplaceEdit currentEdit = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; if ( this . scanner . startPosition == currentEdit . offset + currentEdit . length ) { printNewLinesBeforeDisablingComment ( ) ; } } } if ( trailing > NO_TRAILING_COMMENT && lines >= <NUM_LIT:1> ) { this . scanner . resetTo ( this . scanner . getCurrentTokenStartPosition ( ) , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } this . lastLineComment . contiguous = false ; if ( rejectBlockComment ) break ; if ( lines >= <NUM_LIT:1> ) { if ( lines > <NUM_LIT:1> ) { preserveEmptyLines ( lines - <NUM_LIT:1> , this . scanner . getCurrentTokenStartPosition ( ) ) ; } else if ( lines == <NUM_LIT:1> ) { printNewLine ( this . scanner . getCurrentTokenStartPosition ( ) ) ; } } else if ( hasWhitespaces ) { space ( ) ; } hasWhitespaces = false ; printBlockComment ( false ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasLineComment = false ; hasComment = true ; lines = <NUM_LIT:0> ; if ( this . useTags && ! this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; } break ; case TerminalTokens . TokenNameCOMMENT_JAVADOC : if ( this . useTags && this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; if ( ! this . editsEnabled && this . editsIndex > <NUM_LIT:1> ) { OptimizedReplaceEdit currentEdit = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; if ( this . scanner . startPosition == currentEdit . offset + currentEdit . length ) { printNewLinesBeforeDisablingComment ( ) ; } } } if ( trailing > NO_TRAILING_COMMENT ) { this . scanner . resetTo ( this . scanner . getCurrentTokenStartPosition ( ) , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } this . lastLineComment . contiguous = false ; if ( rejectJavadocComment ) break ; if ( lines >= <NUM_LIT:1> ) { if ( lines > <NUM_LIT:1> ) { preserveEmptyLines ( lines - <NUM_LIT:1> , this . scanner . getCurrentTokenStartPosition ( ) ) ; } else if ( lines == <NUM_LIT:1> ) { printNewLine ( this . scanner . getCurrentTokenStartPosition ( ) ) ; } } else if ( hasWhitespaces ) { space ( ) ; } hasWhitespaces = false ; if ( includesJavadocComments ( ) ) { printJavadocComment ( this . scanner . startPosition , this . scanner . currentPosition ) ; } else { printBlockComment ( true ) ; } if ( this . useTags && ! this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; } printNewLine ( ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasLineComment = false ; hasComment = true ; lines = <NUM_LIT:0> ; break ; default : this . lastLineComment . contiguous = false ; this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } } } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } void printComment ( int kind , String source , int start , int end , int level ) { resetScanner ( source . toCharArray ( ) ) ; this . scanner . resetTo ( start , end ) ; this . numberOfIndentations = level ; this . indentationLevel = level * this . indentationSize ; this . column = this . indentationLevel + <NUM_LIT:1> ; switch ( kind ) { case CodeFormatter . K_SINGLE_LINE_COMMENT : printComment ( kind , NO_TRAILING_COMMENT ) ; break ; case CodeFormatter . K_MULTI_LINE_COMMENT : printComment ( kind , NO_TRAILING_COMMENT ) ; break ; case CodeFormatter . K_JAVA_DOC : printJavadocComment ( start , end ) ; break ; } } private void printLineComment ( ) { int currentTokenStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; int currentTokenEndPosition = this . scanner . getCurrentTokenEndPosition ( ) + <NUM_LIT:1> ; boolean includesLineComments = includesLineComments ( ) ; boolean isNlsTag = false ; if ( CharOperation . indexOf ( Scanner . TAG_PREFIX , this . scanner . source , true , currentTokenStartPosition , currentTokenEndPosition ) != - <NUM_LIT:1> ) { this . nlsTagCounter = <NUM_LIT:0> ; isNlsTag = true ; } this . scanner . resetTo ( currentTokenStartPosition , currentTokenEndPosition - <NUM_LIT:1> ) ; int currentCharacter ; int start = currentTokenStartPosition ; int nextCharacterStart = currentTokenStartPosition ; int commentIndentationLevel ; boolean onFirstColumn = isOnFirstColumn ( start ) ; if ( this . indentationLevel == <NUM_LIT:0> ) { commentIndentationLevel = this . column - <NUM_LIT:1> ; } else { if ( onFirstColumn && ( ( includesLineComments && ! this . formatter . preferences . comment_format_line_comment_starting_on_first_column ) || this . formatter . preferences . never_indent_line_comments_on_first_column ) ) { commentIndentationLevel = this . column - <NUM_LIT:1> ; } else { if ( this . lastLineComment . contiguous ) { int currentCommentIndentation = getCurrentIndentation ( this . lastLineComment . leadingSpaces , <NUM_LIT:0> ) ; int relativeIndentation = currentCommentIndentation - this . lastLineComment . currentIndentation ; boolean similarCommentsIndentation = false ; if ( this . tabLength == <NUM_LIT:0> ) { similarCommentsIndentation = relativeIndentation == <NUM_LIT:0> ; } else if ( relativeIndentation > - this . tabLength ) { similarCommentsIndentation = relativeIndentation == <NUM_LIT:0> || currentCommentIndentation != <NUM_LIT:0> && this . lastLineComment . currentIndentation != <NUM_LIT:0> ; } if ( similarCommentsIndentation && this . lastLineComment . indentation != this . indentationLevel ) { int currentIndentationLevel = this . indentationLevel ; this . indentationLevel = this . lastLineComment . indentation ; printIndentationIfNecessary ( ) ; this . indentationLevel = currentIndentationLevel ; commentIndentationLevel = this . lastLineComment . indentation ; } else { printIndentationIfNecessary ( ) ; commentIndentationLevel = this . column - <NUM_LIT:1> ; } } else { if ( this . currentAlignment != null && this . currentAlignment . kind == Alignment . ARRAY_INITIALIZER && this . indentationLevel < this . currentAlignment . breakIndentationLevel && this . lastLineComment . lines > <NUM_LIT:0> ) { int currentIndentationLevel = this . indentationLevel ; this . indentationLevel = this . currentAlignment . breakIndentationLevel ; printIndentationIfNecessary ( ) ; this . indentationLevel = currentIndentationLevel ; commentIndentationLevel = this . currentAlignment . breakIndentationLevel ; } else { printIndentationIfNecessary ( ) ; commentIndentationLevel = this . column - <NUM_LIT:1> ; } } } } this . lastLineComment . contiguous = true ; this . lastLineComment . currentIndentation = getCurrentCommentIndentation ( currentTokenStartPosition ) ; this . lastLineComment . indentation = commentIndentationLevel ; if ( this . pendingSpace ) { addInsertEdit ( currentTokenStartPosition , "<STR_LIT:U+0020>" ) ; } this . needSpace = false ; this . pendingSpace = false ; int previousStart = currentTokenStartPosition ; if ( ! isNlsTag && includesLineComments && ( ! onFirstColumn || this . formatter . preferences . comment_format_line_comment_starting_on_first_column ) ) { printLineComment ( currentTokenStartPosition , currentTokenEndPosition - <NUM_LIT:1> ) ; } else { loop : while ( nextCharacterStart <= currentTokenEndPosition && ( currentCharacter = this . scanner . getNextChar ( ) ) != - <NUM_LIT:1> ) { nextCharacterStart = this . scanner . currentPosition ; switch ( currentCharacter ) { case '<STR_LIT>' : start = previousStart ; break loop ; case '<STR_LIT:\n>' : start = previousStart ; break loop ; } previousStart = nextCharacterStart ; } if ( start != currentTokenStartPosition ) { addReplaceEdit ( start , currentTokenEndPosition - <NUM_LIT:1> , this . lineSeparator ) ; this . line ++ ; this . column = <NUM_LIT:1> ; this . lastNumberOfNewLines = <NUM_LIT:1> ; } } this . needSpace = false ; this . pendingSpace = false ; if ( this . currentAlignment != null ) { if ( this . memberAlignment != null ) { if ( this . currentAlignment . location . inputOffset > this . memberAlignment . location . inputOffset ) { if ( this . currentAlignment . couldBreak ( ) && this . currentAlignment . wasSplit ) { this . currentAlignment . performFragmentEffect ( ) ; } } else { this . indentationLevel = Math . max ( this . indentationLevel , this . memberAlignment . breakIndentationLevel ) ; } } else if ( this . currentAlignment . couldBreak ( ) && this . currentAlignment . wasSplit ) { this . currentAlignment . performFragmentEffect ( ) ; } } this . scanner . resetTo ( currentTokenEndPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; } private void printLineComment ( int commentStart , int commentEnd ) { int firstColumn = this . column ; int indentLevel = this . indentationLevel ; int indentations = this . numberOfIndentations ; this . indentationLevel = getNextIndentationLevel ( firstColumn ) ; if ( this . indentationSize != <NUM_LIT:0> ) { this . numberOfIndentations = this . indentationLevel / this . indentationSize ; } else { this . numberOfIndentations = <NUM_LIT:0> ; } this . scanner . resetTo ( commentStart , commentEnd ) ; this . scanner . getNextChar ( ) ; this . scanner . getNextChar ( ) ; this . column += <NUM_LIT:2> ; int maxColumn = this . formatter . preferences . comment_line_length + <NUM_LIT:1> ; int previousToken = - <NUM_LIT:1> ; int lastTokenEndPosition = commentStart ; int spaceStartPosition = - <NUM_LIT:1> ; int spaceEndPosition = - <NUM_LIT:1> ; this . scanner . skipComments = true ; String newLineString = null ; this . commentIndentation = null ; while ( ! this . scanner . atEnd ( ) ) { int token ; try { token = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException iie ) { token = consumeInvalidToken ( commentEnd ) ; } switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( previousToken == - <NUM_LIT:1> ) { previousToken = SKIP_FIRST_WHITESPACE_TOKEN ; } else { previousToken = token ; } spaceStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; spaceEndPosition = this . scanner . getCurrentTokenEndPosition ( ) ; continue ; case TerminalTokens . TokenNameEOF : continue ; case TerminalTokens . TokenNameIdentifier : if ( previousToken == - <NUM_LIT:1> || previousToken == SKIP_FIRST_WHITESPACE_TOKEN ) { char [ ] identifier = this . scanner . getCurrentTokenSource ( ) ; int startPosition = this . scanner . getCurrentTokenStartPosition ( ) ; int restartPosition = this . scanner . currentPosition ; if ( CharOperation . equals ( identifier , Parser . FALL_THROUGH_TAG , <NUM_LIT:0> , <NUM_LIT:5> ) && this . scanner . currentCharacter == '<CHAR_LIT:->' ) { try { this . scanner . getNextToken ( ) ; token = this . scanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameIdentifier ) { identifier = this . scanner . getCurrentTokenSource ( ) ; if ( CharOperation . endsWith ( Parser . FALL_THROUGH_TAG , identifier ) ) { if ( previousToken == SKIP_FIRST_WHITESPACE_TOKEN ) { addReplaceEdit ( spaceStartPosition , startPosition - <NUM_LIT:1> , "<STR_LIT:U+0020>" ) ; } this . scanner . startPosition = startPosition ; previousToken = token ; break ; } } } catch ( InvalidInputException iie ) { } } this . scanner . startPosition = startPosition ; this . scanner . currentPosition = restartPosition ; } break ; } int tokenStart = this . scanner . getCurrentTokenStartPosition ( ) ; int tokenLength = ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - tokenStart ; if ( previousToken == - <NUM_LIT:1> ) { addInsertEdit ( this . scanner . startPosition , "<STR_LIT:U+0020>" ) ; this . column ++ ; } else if ( previousToken == SKIP_FIRST_WHITESPACE_TOKEN ) { addReplaceEdit ( spaceStartPosition , this . scanner . startPosition - <NUM_LIT:1> , "<STR_LIT:U+0020>" ) ; this . column ++ ; spaceStartPosition = - <NUM_LIT:1> ; } else { boolean insertSpace = previousToken == TerminalTokens . TokenNameWHITESPACE ; if ( insertSpace ) { tokenLength ++ ; } if ( spaceStartPosition > <NUM_LIT:0> && ( this . column + tokenLength ) > maxColumn ) { this . lastNumberOfNewLines ++ ; this . line ++ ; if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; if ( ! this . formatter . preferences . never_indent_line_comments_on_first_column ) { printIndentationIfNecessary ( this . tempBuffer ) ; } this . tempBuffer . append ( LINE_COMMENT_PREFIX ) ; this . column += LINE_COMMENT_PREFIX_LENGTH ; newLineString = this . tempBuffer . toString ( ) ; firstColumn = this . column ; } else { this . column = firstColumn ; } if ( lastTokenEndPosition > spaceEndPosition ) { this . column += lastTokenEndPosition - ( spaceEndPosition + <NUM_LIT:1> ) ; } if ( this . edits [ this . editsIndex - <NUM_LIT:1> ] . offset == spaceStartPosition ) { this . editsIndex -- ; } addReplaceEdit ( spaceStartPosition , spaceEndPosition , newLineString ) ; spaceStartPosition = - <NUM_LIT:1> ; if ( insertSpace ) { tokenLength -- ; } } else if ( insertSpace ) { addReplaceEdit ( spaceStartPosition , this . scanner . startPosition - <NUM_LIT:1> , "<STR_LIT:U+0020>" ) ; } } this . column += tokenLength ; previousToken = token ; lastTokenEndPosition = this . scanner . currentPosition ; } this . scanner . skipComments = false ; this . indentationLevel = indentLevel ; this . numberOfIndentations = indentations ; this . lastNumberOfNewLines = <NUM_LIT:0> ; this . scanner . resetTo ( lastTokenEndPosition , commentEnd ) ; while ( ! this . scanner . atEnd ( ) ) { spaceEndPosition = this . scanner . currentPosition ; this . scanner . getNextChar ( ) ; if ( this . scanner . currentCharacter == '<STR_LIT:\n>' || this . scanner . currentCharacter == '<STR_LIT>' ) { this . column = <NUM_LIT:1> ; this . line ++ ; this . lastNumberOfNewLines ++ ; break ; } } int startReplace = previousToken == SKIP_FIRST_WHITESPACE_TOKEN ? spaceStartPosition : lastTokenEndPosition ; if ( this . column == <NUM_LIT:1> && commentEnd >= startReplace ) { addReplaceEdit ( startReplace , commentEnd , this . formatter . preferences . line_separator ) ; } } public void printEmptyLines ( int linesNumber ) { this . printEmptyLines ( linesNumber , this . scanner . getCurrentTokenEndPosition ( ) + <NUM_LIT:1> ) ; } private void printEmptyLines ( int linesNumber , int insertPosition ) { final String buffer = getEmptyLines ( linesNumber ) ; if ( Util . EMPTY_STRING == buffer ) return ; addInsertEdit ( insertPosition , buffer ) ; } void printIndentationIfNecessary ( ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; printIndentationIfNecessary ( this . tempBuffer ) ; if ( this . tempBuffer . length ( ) > <NUM_LIT:0> ) { addInsertEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . tempBuffer . toString ( ) ) ; this . pendingSpace = false ; } } private void printIndentationIfNecessary ( StringBuffer buffer ) { switch ( this . tabChar ) { case DefaultCodeFormatterOptions . TAB : boolean useTabsForLeadingIndents = this . useTabsOnlyForLeadingIndents ; int numberOfLeadingIndents = this . numberOfIndentations ; int indentationsAsTab = <NUM_LIT:0> ; if ( useTabsForLeadingIndents ) { while ( this . column <= this . indentationLevel ) { if ( this . tabLength > <NUM_LIT:0> && indentationsAsTab < numberOfLeadingIndents ) { if ( buffer != null ) buffer . append ( '<STR_LIT:\t>' ) ; indentationsAsTab ++ ; int complement = this . tabLength - ( ( this . column - <NUM_LIT:1> ) % this . tabLength ) ; this . column += complement ; } else { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } this . needSpace = false ; } } else if ( this . tabLength > <NUM_LIT:0> ) { while ( this . column <= this . indentationLevel ) { if ( buffer != null ) buffer . append ( '<STR_LIT:\t>' ) ; int complement = this . tabLength - ( ( this . column - <NUM_LIT:1> ) % this . tabLength ) ; this . column += complement ; this . needSpace = false ; } } break ; case DefaultCodeFormatterOptions . SPACE : while ( this . column <= this . indentationLevel ) { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; this . needSpace = false ; } break ; case DefaultCodeFormatterOptions . MIXED : useTabsForLeadingIndents = this . useTabsOnlyForLeadingIndents ; numberOfLeadingIndents = this . numberOfIndentations ; indentationsAsTab = <NUM_LIT:0> ; if ( useTabsForLeadingIndents ) { final int columnForLeadingIndents = numberOfLeadingIndents * this . indentationSize ; while ( this . column <= this . indentationLevel ) { if ( this . column <= columnForLeadingIndents ) { if ( this . tabLength > <NUM_LIT:0> && ( this . column - <NUM_LIT:1> + this . tabLength ) <= this . indentationLevel ) { if ( buffer != null ) buffer . append ( '<STR_LIT:\t>' ) ; this . column += this . tabLength ; } else if ( ( this . column - <NUM_LIT:1> + this . indentationSize ) <= this . indentationLevel ) { for ( int i = <NUM_LIT:0> , max = this . indentationSize ; i < max ; i ++ ) { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } } else { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } } else { for ( int i = this . column , max = this . indentationLevel ; i <= max ; i ++ ) { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } } this . needSpace = false ; } } else { while ( this . column <= this . indentationLevel ) { if ( this . tabLength > <NUM_LIT:0> && ( this . column - <NUM_LIT:1> + this . tabLength ) <= this . indentationLevel ) { if ( buffer != null ) buffer . append ( '<STR_LIT:\t>' ) ; this . column += this . tabLength ; } else if ( this . indentationSize > <NUM_LIT:0> && ( this . column - <NUM_LIT:1> + this . indentationSize ) <= this . indentationLevel ) { for ( int i = <NUM_LIT:0> , max = this . indentationSize ; i < max ; i ++ ) { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } } else { if ( buffer != null ) buffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } this . needSpace = false ; } } break ; } } private void printJavadocBlock ( FormatJavadocBlock block ) { if ( block == null ) return ; int previousEnd = block . tagEnd ; int maxNodes = block . nodesPtr ; boolean headerLine = block . isHeaderLine ( ) && this . lastNumberOfNewLines == <NUM_LIT:0> ; int maxColumn = this . formatter . preferences . comment_line_length + <NUM_LIT:1> ; if ( headerLine ) { maxColumn ++ ; } if ( ! block . isInlined ( ) ) { this . lastNumberOfNewLines = <NUM_LIT:0> ; } if ( block . isDescription ( ) ) { if ( ! block . isInlined ( ) ) { this . commentIndentation = null ; } } else { int tagLength = previousEnd - block . sourceStart + <NUM_LIT:1> ; this . column += tagLength ; if ( ! block . isInlined ( ) ) { boolean indentRootTags = this . formatter . preferences . comment_indent_root_tags && ! block . isInDescription ( ) ; int commentIndentationLevel = <NUM_LIT:0> ; if ( indentRootTags ) { commentIndentationLevel = tagLength + <NUM_LIT:1> ; boolean indentParamTag = this . formatter . preferences . comment_indent_parameter_description && block . isInParamTag ( ) ; if ( indentParamTag ) { commentIndentationLevel += this . indentationSize ; } } setCommentIndentation ( commentIndentationLevel ) ; } FormatJavadocReference reference = block . reference ; if ( reference != null ) { printJavadocBlockReference ( block , reference ) ; previousEnd = reference . sourceEnd ; } if ( maxNodes < <NUM_LIT:0> ) { if ( block . isInlined ( ) ) { this . column ++ ; } return ; } } int previousLine = Util . getLineNumber ( previousEnd , this . lineEnds , <NUM_LIT:0> , this . maxLines ) ; boolean clearBlankLines = this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment ; boolean joinLines = this . formatter . preferences . join_lines_in_comments ; for ( int i = <NUM_LIT:0> ; i <= maxNodes ; i ++ ) { FormatJavadocNode node = block . nodes [ i ] ; int nodeStart = node . sourceStart ; int newLines ; if ( i == <NUM_LIT:0> ) { newLines = this . formatter . preferences . comment_insert_new_line_for_parameter && block . isParamTag ( ) ? <NUM_LIT:1> : <NUM_LIT:0> ; if ( nodeStart > ( previousEnd + <NUM_LIT:1> ) ) { if ( ! clearBlankLines || ! joinLines ) { int startLine = Util . getLineNumber ( nodeStart , this . lineEnds , previousLine - <NUM_LIT:1> , this . maxLines ) ; int gapLine = previousLine ; if ( joinLines ) gapLine ++ ; if ( startLine > gapLine ) { newLines = startLine - previousLine ; } if ( clearBlankLines ) { if ( newLines > <NUM_LIT:0> ) newLines = <NUM_LIT:1> ; } } if ( newLines == <NUM_LIT:0> && ( ! node . isImmutable ( ) || block . reference != null ) ) { newLines = printJavadocBlockNodesNewLines ( block , node , previousEnd ) ; } if ( block . isImmutable ( ) ) { printJavadocGapLinesForImmutableBlock ( block ) ; } else { printJavadocGapLines ( previousEnd + <NUM_LIT:1> , nodeStart - <NUM_LIT:1> , newLines , clearBlankLines , false , null ) ; } } else { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; if ( newLines > <NUM_LIT:0> ) { for ( int j = <NUM_LIT:0> ; j < newLines ; j ++ ) { printJavadocNewLine ( this . tempBuffer ) ; } addInsertEdit ( nodeStart , this . tempBuffer . toString ( ) ) ; } } } else { newLines = this . column > maxColumn ? <NUM_LIT:1> : <NUM_LIT:0> ; if ( ! clearBlankLines && node . lineStart > ( previousLine + <NUM_LIT:1> ) ) newLines = node . lineStart - previousLine ; if ( newLines < node . linesBefore ) newLines = node . linesBefore ; if ( newLines == <NUM_LIT:0> ) { newLines = printJavadocBlockNodesNewLines ( block , node , previousEnd ) ; } if ( newLines > <NUM_LIT:0> || nodeStart > ( previousEnd + <NUM_LIT:1> ) ) { printJavadocGapLines ( previousEnd + <NUM_LIT:1> , nodeStart - <NUM_LIT:1> , newLines , clearBlankLines , false , null ) ; } } if ( headerLine && newLines > <NUM_LIT:0> ) { headerLine = false ; maxColumn -- ; } if ( node . isText ( ) ) { FormatJavadocText text = ( FormatJavadocText ) node ; if ( text . isImmutable ( ) ) { if ( text . isImmutableHtmlTag ( ) && newLines > <NUM_LIT:0> && this . commentIndentation != null ) { addInsertEdit ( node . sourceStart , this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } printJavadocImmutableText ( text , block , newLines > <NUM_LIT:0> ) ; this . column += getTextLength ( block , text ) ; } else if ( text . isHtmlTag ( ) ) { printJavadocHtmlTag ( text , block , newLines > <NUM_LIT:0> ) ; } else { printJavadocText ( text , block , newLines > <NUM_LIT:0> ) ; } } else { if ( newLines > <NUM_LIT:0> && this . commentIndentation != null ) { addInsertEdit ( node . sourceStart , this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } printJavadocBlock ( ( FormatJavadocBlock ) node ) ; } previousEnd = node . sourceEnd ; previousLine = Util . getLineNumber ( previousEnd , this . lineEnds , node . lineStart > <NUM_LIT:1> ? node . lineStart - <NUM_LIT:2> : <NUM_LIT:0> , this . maxLines ) ; } this . lastNumberOfNewLines = <NUM_LIT:0> ; } private int printJavadocBlockNodesNewLines ( FormatJavadocBlock block , FormatJavadocNode node , int previousEnd ) { int maxColumn = this . formatter . preferences . comment_line_length + <NUM_LIT:1> ; int nodeStart = node . sourceStart ; try { this . scanner . resetTo ( nodeStart , node . sourceEnd ) ; int length = <NUM_LIT:0> ; boolean newLine = false ; boolean headerLine = block . isHeaderLine ( ) && this . lastNumberOfNewLines == <NUM_LIT:0> ; int firstColumn = <NUM_LIT:1> + this . indentationLevel + BLOCK_LINE_PREFIX_LENGTH ; if ( this . commentIndentation != null ) firstColumn += this . commentIndentation . length ( ) ; if ( headerLine ) maxColumn ++ ; FormatJavadocText text = null ; boolean isImmutableNode = node . isImmutable ( ) ; boolean nodeIsText = node . isText ( ) ; if ( nodeIsText ) { text = ( FormatJavadocText ) node ; } else { FormatJavadocBlock inlinedBlock = ( FormatJavadocBlock ) node ; if ( isImmutableNode ) { text = ( FormatJavadocText ) inlinedBlock . getLastNode ( ) ; if ( text != null ) { length += inlinedBlock . tagEnd - inlinedBlock . sourceStart + <NUM_LIT:1> ; if ( nodeStart > ( previousEnd + <NUM_LIT:1> ) ) { length ++ ; } this . scanner . resetTo ( text . sourceStart , node . sourceEnd ) ; } } } if ( text != null ) { if ( isImmutableNode ) { if ( nodeStart > ( previousEnd + <NUM_LIT:1> ) ) { length ++ ; } int lastColumn = this . column + length ; while ( ! this . scanner . atEnd ( ) ) { try { int token = this . scanner . getNextToken ( ) ; switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( CharOperation . indexOf ( '<STR_LIT:\n>' , this . scanner . source , this . scanner . startPosition , this . scanner . currentPosition ) >= <NUM_LIT:0> ) { return <NUM_LIT:0> ; } lastColumn = getCurrentIndentation ( this . scanner . getCurrentTokenSource ( ) , lastColumn ) ; break ; case TerminalTokens . TokenNameMULTIPLY : if ( newLine ) { newLine = false ; continue ; } lastColumn ++ ; break ; default : lastColumn += ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; break ; } } catch ( InvalidInputException iie ) { lastColumn += ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; } if ( lastColumn > maxColumn ) { return <NUM_LIT:1> ; } } return <NUM_LIT:0> ; } if ( text . isHtmlTag ( ) ) { if ( text . getHtmlTagID ( ) == JAVADOC_SINGLE_BREAK_TAG_ID ) { return <NUM_LIT:0> ; } this . scanner . getNextToken ( ) ; if ( this . scanner . getNextToken ( ) == TerminalTokens . TokenNameDIVIDE ) { length ++ ; this . scanner . getNextToken ( ) ; } length += ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; this . scanner . getNextToken ( ) ; length ++ ; } else { while ( true ) { int token = this . scanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameWHITESPACE || token == TerminalTokens . TokenNameEOF ) break ; int tokenLength = ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; length += tokenLength ; if ( ( this . column + length ) >= maxColumn ) { break ; } } } } else { FormatJavadocBlock inlinedBlock = ( FormatJavadocBlock ) node ; length += inlinedBlock . tagEnd - inlinedBlock . sourceStart + <NUM_LIT:1> ; if ( inlinedBlock . reference != null ) { length ++ ; this . scanner . resetTo ( inlinedBlock . reference . sourceStart , inlinedBlock . reference . sourceEnd ) ; int previousToken = - <NUM_LIT:1> ; loop : while ( ! this . scanner . atEnd ( ) ) { int token = this . scanner . getNextToken ( ) ; int tokenLength = ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( previousToken == TerminalTokens . TokenNameCOMMA ) { length ++ ; } break ; case TerminalTokens . TokenNameMULTIPLY : break ; default : length += tokenLength ; if ( ( this . column + length ) > maxColumn ) { break loop ; } break ; } previousToken = token ; } } length ++ ; } if ( nodeStart > ( previousEnd + <NUM_LIT:1> ) ) { length ++ ; } if ( ( firstColumn + length ) >= maxColumn && node == block . nodes [ <NUM_LIT:0> ] ) { return <NUM_LIT:0> ; } if ( ( this . column + length ) > maxColumn ) { return <NUM_LIT:1> ; } } catch ( InvalidInputException iie ) { int tokenLength = <NUM_LIT:1> ; if ( nodeStart > ( previousEnd + <NUM_LIT:1> ) ) { tokenLength ++ ; } if ( ( this . column + tokenLength ) > maxColumn ) { return <NUM_LIT:1> ; } } return <NUM_LIT:0> ; } private void printJavadocBlockReference ( FormatJavadocBlock block , FormatJavadocReference reference ) { int maxColumn = this . formatter . preferences . comment_line_length + <NUM_LIT:1> ; boolean headerLine = block . isHeaderLine ( ) ; boolean inlined = block . isInlined ( ) ; if ( headerLine ) maxColumn ++ ; this . scanner . resetTo ( block . tagEnd + <NUM_LIT:1> , reference . sourceEnd ) ; this . javadocBlockRefBuffer . setLength ( <NUM_LIT:0> ) ; boolean needFormat = false ; int previousToken = - <NUM_LIT:1> ; int spacePosition = - <NUM_LIT:1> ; String newLineString = null ; int firstColumn = - <NUM_LIT:1> ; while ( ! this . scanner . atEnd ( ) ) { int token ; try { token = this . scanner . getNextToken ( ) ; int tokenLength = ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( previousToken != - <NUM_LIT:1> || tokenLength > <NUM_LIT:1> || this . scanner . currentCharacter != '<CHAR_LIT:U+0020>' ) needFormat = true ; switch ( previousToken ) { case TerminalTokens . TokenNameMULTIPLY : case TerminalTokens . TokenNameLPAREN : break ; default : spacePosition = this . javadocBlockRefBuffer . length ( ) ; case - <NUM_LIT:1> : this . javadocBlockRefBuffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; break ; } break ; case TerminalTokens . TokenNameMULTIPLY : break ; default : if ( ! inlined && spacePosition > <NUM_LIT:0> && ( this . column + tokenLength ) > maxColumn ) { this . lastNumberOfNewLines ++ ; this . line ++ ; if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; if ( this . commentIndentation != null ) { this . tempBuffer . append ( this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } newLineString = this . tempBuffer . substring ( <NUM_LIT:0> , this . tempBuffer . length ( ) - <NUM_LIT:1> ) ; firstColumn = this . column ; } else { this . column = firstColumn ; } this . column = firstColumn + this . javadocBlockRefBuffer . length ( ) - spacePosition - <NUM_LIT:1> ; this . javadocBlockRefBuffer . insert ( spacePosition , newLineString ) ; if ( headerLine ) { headerLine = false ; maxColumn -- ; } spacePosition = - <NUM_LIT:1> ; } this . javadocBlockRefBuffer . append ( this . scanner . source , this . scanner . startPosition , tokenLength ) ; this . column += tokenLength ; break ; } previousToken = token ; } catch ( InvalidInputException iie ) { } } if ( needFormat ) { addReplaceEdit ( block . tagEnd + <NUM_LIT:1> , reference . sourceEnd , this . javadocBlockRefBuffer . toString ( ) ) ; } } private int getTextLength ( FormatJavadocBlock block , FormatJavadocText text ) { if ( text . isImmutable ( ) ) { this . scanner . resetTo ( text . sourceStart , text . sourceEnd ) ; int textLength = <NUM_LIT:0> ; while ( ! this . scanner . atEnd ( ) ) { try { int token = this . scanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameWHITESPACE ) { if ( CharOperation . indexOf ( '<STR_LIT:\n>' , this . scanner . source , this . scanner . startPosition , this . scanner . currentPosition ) >= <NUM_LIT:0> ) { textLength = <NUM_LIT:0> ; this . scanner . getNextChar ( ) ; if ( this . scanner . currentCharacter == '<CHAR_LIT>' ) { this . scanner . getNextChar ( ) ; if ( this . scanner . currentCharacter != '<CHAR_LIT:U+0020>' ) { textLength ++ ; } } else { textLength ++ ; } continue ; } } textLength += ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; } catch ( InvalidInputException e ) { textLength += ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - this . scanner . startPosition ; } } return textLength ; } if ( block . isOneLineTag ( ) ) { return text . sourceEnd - text . sourceStart + <NUM_LIT:1> ; } int startLine = Util . getLineNumber ( text . sourceStart , this . lineEnds , <NUM_LIT:0> , this . maxLines ) ; int endLine = startLine ; int previousEnd = - <NUM_LIT:1> ; for ( int i = <NUM_LIT:0> ; i <= text . separatorsPtr ; i ++ ) { int end = ( int ) ( text . separators [ i ] > > > <NUM_LIT:32> ) ; endLine = Util . getLineNumber ( end , this . lineEnds , endLine - <NUM_LIT:1> , this . maxLines ) ; if ( endLine > startLine ) { return previousEnd - text . sourceStart + <NUM_LIT:1> ; } previousEnd = end ; } return text . sourceEnd - text . sourceStart + <NUM_LIT:1> ; } void printJavadocComment ( int start , int end ) { int lastIndentationLevel = this . indentationLevel ; try { this . scanner . resetTo ( start , end - <NUM_LIT:1> ) ; if ( ! this . formatterCommentParser . parse ( start , end - <NUM_LIT:1> ) ) { return ; } FormatJavadoc javadoc = ( FormatJavadoc ) this . formatterCommentParser . docComment ; if ( this . indentationLevel != <NUM_LIT:0> ) { printIndentationIfNecessary ( ) ; } if ( this . pendingSpace ) { addInsertEdit ( start , "<STR_LIT:U+0020>" ) ; } if ( javadoc . blocks == null ) { return ; } this . needSpace = false ; this . pendingSpace = false ; int length = javadoc . blocks . length ; FormatJavadocBlock previousBlock = javadoc . blocks [ <NUM_LIT:0> ] ; this . lastNumberOfNewLines = <NUM_LIT:0> ; int currentLine = this . line ; int firstBlockStart = previousBlock . sourceStart ; printIndentationIfNecessary ( null ) ; this . column += JAVADOC_HEADER_LENGTH ; int index = <NUM_LIT:1> ; if ( length > <NUM_LIT:1> ) { if ( previousBlock . isDescription ( ) ) { printJavadocBlock ( previousBlock ) ; FormatJavadocBlock block = javadoc . blocks [ index ++ ] ; int newLines = this . formatter . preferences . comment_insert_empty_line_before_root_tags ? <NUM_LIT:2> : <NUM_LIT:1> ; printJavadocGapLines ( previousBlock . sourceEnd + <NUM_LIT:1> , block . sourceStart - <NUM_LIT:1> , newLines , this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment , false , null ) ; previousBlock = block ; } while ( index < length ) { printJavadocBlock ( previousBlock ) ; FormatJavadocBlock block = javadoc . blocks [ index ++ ] ; printJavadocGapLines ( previousBlock . sourceEnd + <NUM_LIT:1> , block . sourceStart - <NUM_LIT:1> , <NUM_LIT:1> , this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment , false , null ) ; previousBlock = block ; } } printJavadocBlock ( previousBlock ) ; int newLines = ( this . formatter . preferences . comment_new_lines_at_javadoc_boundaries && ( this . line > currentLine || javadoc . isMultiLine ( ) ) ) ? <NUM_LIT:1> : <NUM_LIT:0> ; printJavadocGapLines ( javadoc . textStart , firstBlockStart - <NUM_LIT:1> , newLines , this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment , false , null ) ; printJavadocGapLines ( previousBlock . sourceEnd + <NUM_LIT:1> , javadoc . textEnd , newLines , this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment , true , null ) ; } finally { this . scanner . resetTo ( end , this . scannerEndPosition - <NUM_LIT:1> ) ; this . needSpace = false ; this . indentationLevel = lastIndentationLevel ; this . lastNumberOfNewLines = <NUM_LIT:0> ; } } private void printJavadocGapLines ( int textStartPosition , int textEndPosition , int newLines , boolean clearBlankLines , boolean footer , StringBuffer output ) { try { if ( newLines == <NUM_LIT:0> ) { if ( output == null ) { addReplaceEdit ( textStartPosition , textEndPosition , "<STR_LIT:U+0020>" ) ; } else { output . append ( '<CHAR_LIT:U+0020>' ) ; } this . column ++ ; return ; } if ( textStartPosition > textEndPosition ) { if ( newLines > <NUM_LIT:0> ) { this . javadocGapLinesBuffer . setLength ( <NUM_LIT:0> ) ; for ( int i = <NUM_LIT:0> ; i < newLines ; i ++ ) { this . javadocGapLinesBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . javadocGapLinesBuffer ) ; if ( footer ) { this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } else { this . javadocGapLinesBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; } } if ( output == null ) { addInsertEdit ( textStartPosition , this . javadocGapLinesBuffer . toString ( ) ) ; } else { output . append ( this . javadocGapLinesBuffer ) ; } } return ; } this . scanner . resetTo ( textStartPosition , textEndPosition ) ; this . scanner . recordLineSeparator = true ; this . scanner . linePtr = Util . getLineNumber ( textStartPosition , this . lineEnds , <NUM_LIT:0> , this . maxLines ) - <NUM_LIT:2> ; int linePtr = this . scanner . linePtr ; int lineCount = <NUM_LIT:0> ; int start = textStartPosition ; boolean endsOnMultiply = false ; while ( ! this . scanner . atEnd ( ) ) { switch ( this . scanner . getNextToken ( ) ) { case TerminalTokens . TokenNameMULTIPLY : int linesGap = this . scanner . linePtr - linePtr ; if ( linesGap > <NUM_LIT:0> ) { this . javadocGapLinesBuffer . setLength ( <NUM_LIT:0> ) ; if ( lineCount > <NUM_LIT:0> ) { this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } for ( int i = <NUM_LIT:0> ; i < linesGap ; i ++ ) { if ( clearBlankLines && lineCount >= newLines ) { if ( textEndPosition >= start ) { if ( output == null ) { addReplaceEdit ( start , textEndPosition , this . javadocGapLinesBuffer . toString ( ) ) ; } else { output . append ( this . javadocGapLinesBuffer ) ; } } return ; } this . javadocGapLinesBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . javadocGapLinesBuffer ) ; if ( i == ( linesGap - <NUM_LIT:1> ) ) { this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } else { this . javadocGapLinesBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; } lineCount ++ ; } int currentTokenStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; int tokenLength = this . scanner . currentPosition - currentTokenStartPosition ; if ( output == null ) { addReplaceEdit ( start , currentTokenStartPosition - <NUM_LIT:1> , this . javadocGapLinesBuffer . toString ( ) ) ; } else { output . append ( this . javadocGapLinesBuffer ) ; output . append ( this . scanner . source , currentTokenStartPosition , tokenLength ) ; } this . column += tokenLength ; if ( footer && clearBlankLines && lineCount == newLines ) { if ( textEndPosition >= currentTokenStartPosition ) { if ( output == null ) { addDeleteEdit ( currentTokenStartPosition , textEndPosition ) ; } } return ; } } start = this . scanner . currentPosition ; linePtr = this . scanner . linePtr ; endsOnMultiply = true ; break ; default : endsOnMultiply = false ; break ; } } if ( lineCount < newLines ) { this . javadocGapLinesBuffer . setLength ( <NUM_LIT:0> ) ; if ( lineCount > <NUM_LIT:0> ) { this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } for ( int i = lineCount ; i < newLines - <NUM_LIT:1> ; i ++ ) { printJavadocNewLine ( this . javadocGapLinesBuffer ) ; } this . javadocGapLinesBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . javadocGapLinesBuffer ) ; if ( footer ) { this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; this . column ++ ; } else { this . javadocGapLinesBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; } if ( output == null ) { if ( textEndPosition >= start ) { addReplaceEdit ( start , textEndPosition , this . javadocGapLinesBuffer . toString ( ) ) ; } else { addInsertEdit ( textEndPosition + <NUM_LIT:1> , this . javadocGapLinesBuffer . toString ( ) ) ; } } else { output . append ( this . javadocGapLinesBuffer ) ; } } else { if ( textEndPosition >= start ) { this . javadocGapLinesBuffer . setLength ( <NUM_LIT:0> ) ; if ( this . scanner . linePtr > linePtr ) { if ( lineCount > <NUM_LIT:0> ) { this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } this . javadocGapLinesBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . javadocGapLinesBuffer ) ; } this . javadocGapLinesBuffer . append ( '<CHAR_LIT:U+0020>' ) ; if ( output == null ) { addReplaceEdit ( start , textEndPosition , this . javadocGapLinesBuffer . toString ( ) ) ; } else { output . append ( this . javadocGapLinesBuffer ) ; } this . needSpace = false ; } else if ( endsOnMultiply ) { if ( output == null ) { addInsertEdit ( textEndPosition + <NUM_LIT:1> , "<STR_LIT:U+0020>" ) ; } else { output . append ( '<CHAR_LIT:U+0020>' ) ; } this . needSpace = false ; } this . column ++ ; } } catch ( InvalidInputException iie ) { } finally { this . scanner . recordLineSeparator = false ; this . needSpace = false ; this . scanner . resetTo ( textEndPosition + <NUM_LIT:1> , this . scannerEndPosition - <NUM_LIT:1> ) ; this . lastNumberOfNewLines += newLines ; this . line += newLines ; } } private void printJavadocImmutableText ( FormatJavadocText text , FormatJavadocBlock block , boolean textOnNewLine ) { try { int textLineStart = text . lineStart ; this . scanner . tokenizeWhiteSpace = false ; String newLineString = null ; for ( int idx = <NUM_LIT:0> , max = text . separatorsPtr ; idx <= max ; idx ++ ) { int start = ( int ) text . separators [ idx ] ; int lineStart = Util . getLineNumber ( start , this . lineEnds , textLineStart - <NUM_LIT:1> , this . maxLines ) ; while ( textLineStart < lineStart ) { int end = this . lineEnds [ textLineStart - <NUM_LIT:1> ] ; this . scanner . resetTo ( end , start ) ; int token = this . scanner . getNextToken ( ) ; switch ( token ) { case TerminalTokens . TokenNameMULTIPLY : case TerminalTokens . TokenNameMULTIPLY_EQUAL : break ; default : return ; } if ( this . scanner . currentCharacter == '<CHAR_LIT:U+0020>' ) { this . scanner . getNextChar ( ) ; } if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; newLineString = this . tempBuffer . toString ( ) ; } addReplaceEdit ( end + <NUM_LIT:1> , this . scanner . getCurrentTokenEndPosition ( ) , newLineString ) ; textLineStart ++ ; } } } catch ( InvalidInputException iie ) { } finally { this . needSpace = false ; this . scanner . tokenizeWhiteSpace = true ; this . scanner . resetTo ( text . sourceEnd + <NUM_LIT:1> , this . scannerEndPosition - <NUM_LIT:1> ) ; } } private void printJavadocGapLinesForImmutableBlock ( FormatJavadocBlock block ) { int firstLineEnd = - <NUM_LIT:1> ; int newLineStart = - <NUM_LIT:1> ; int secondLineStart = - <NUM_LIT:1> ; int starPosition = - <NUM_LIT:1> ; int offset = <NUM_LIT:0> ; int start = block . tagEnd + <NUM_LIT:1> ; int end = block . nodes [ <NUM_LIT:0> ] . sourceStart - <NUM_LIT:1> ; this . scanner . resetTo ( start , end ) ; int lineStart = block . lineStart ; int lineEnd = Util . getLineNumber ( block . nodes [ <NUM_LIT:0> ] . sourceEnd , this . lineEnds , lineStart - <NUM_LIT:1> , this . maxLines ) ; boolean multiLinesBlock = lineEnd > ( lineStart + <NUM_LIT:1> ) ; int previousPosition = this . scanner . currentPosition ; String newLineString = null ; int indentationColumn = <NUM_LIT:0> ; int leadingSpaces = - <NUM_LIT:1> ; while ( ! this . scanner . atEnd ( ) ) { char ch = ( char ) this . scanner . getNextChar ( ) ; switch ( ch ) { case '<STR_LIT:\t>' : if ( secondLineStart > <NUM_LIT:0> || firstLineEnd < <NUM_LIT:0> ) { int reminder = this . tabLength == <NUM_LIT:0> ? <NUM_LIT:0> : offset % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { offset += this . tabLength ; } else { offset = ( ( offset / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } } else if ( leadingSpaces >= <NUM_LIT:0> ) { int reminder = this . tabLength == <NUM_LIT:0> ? <NUM_LIT:0> : offset % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { leadingSpaces += this . tabLength ; } else { leadingSpaces = ( ( offset / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } } break ; case '<STR_LIT>' : case '<STR_LIT:\n>' : if ( firstLineEnd < <NUM_LIT:0> ) { firstLineEnd = previousPosition ; } if ( leadingSpaces > <NUM_LIT:0> && multiLinesBlock ) { if ( newLineString == null ) { this . column = <NUM_LIT:1> ; this . tempBuffer . setLength ( <NUM_LIT:0> ) ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; newLineString = this . tempBuffer . toString ( ) ; indentationColumn = this . column ; } else { this . column = indentationColumn ; } addReplaceEdit ( newLineStart , newLineStart + indentationColumn - <NUM_LIT:2> , newLineString ) ; } newLineStart = this . scanner . currentPosition ; leadingSpaces = <NUM_LIT:0> ; starPosition = - <NUM_LIT:1> ; if ( multiLinesBlock ) { offset = <NUM_LIT:0> ; secondLineStart = - <NUM_LIT:1> ; } break ; case '<CHAR_LIT>' : if ( starPosition < <NUM_LIT:0> && firstLineEnd > <NUM_LIT:0> ) { secondLineStart = this . scanner . currentPosition ; starPosition = this . scanner . currentPosition ; leadingSpaces = - <NUM_LIT:1> ; } break ; default : if ( secondLineStart > <NUM_LIT:0> ) { if ( secondLineStart == starPosition ) { secondLineStart = this . scanner . currentPosition ; } else { if ( offset == <NUM_LIT:0> && multiLinesBlock ) { if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; indentationColumn = this . column ; newLineString = this . tempBuffer . toString ( ) ; } else { this . column = indentationColumn ; } addReplaceEdit ( newLineStart , secondLineStart - <NUM_LIT:1> , newLineString ) ; } offset ++ ; } } else if ( firstLineEnd < <NUM_LIT:0> ) { offset ++ ; } else if ( leadingSpaces >= <NUM_LIT:0> ) { leadingSpaces ++ ; } break ; } previousPosition = this . scanner . currentPosition ; } if ( multiLinesBlock ) { this . column += offset ; } else { this . column ++ ; } if ( ! multiLinesBlock ) { addReplaceEdit ( firstLineEnd , end , "<STR_LIT:U+0020>" ) ; } else if ( secondLineStart > <NUM_LIT:0> ) { if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; newLineString = this . tempBuffer . toString ( ) ; indentationColumn = this . column ; } else { this . column = indentationColumn ; } addReplaceEdit ( newLineStart , secondLineStart - <NUM_LIT:1> , newLineString ) ; } else if ( leadingSpaces > <NUM_LIT:0> ) { if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; newLineString = this . tempBuffer . toString ( ) ; indentationColumn = this . column ; } else { this . column = indentationColumn ; } addReplaceEdit ( newLineStart , newLineStart + indentationColumn - <NUM_LIT:2> , newLineString ) ; } this . needSpace = false ; this . scanner . resetTo ( end + <NUM_LIT:1> , this . scannerEndPosition - <NUM_LIT:1> ) ; } private int printJavadocHtmlTag ( FormatJavadocText text , FormatJavadocBlock block , boolean textOnNewLine ) { boolean clearBlankLines = this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment ; boolean headerLine = block . isHeaderLine ( ) && this . lastNumberOfNewLines == <NUM_LIT:0> ; int firstColumn = <NUM_LIT:1> + this . indentationLevel + BLOCK_LINE_PREFIX_LENGTH ; if ( headerLine ) firstColumn ++ ; int textStart = text . sourceStart ; int nextStart = textStart ; int startLine = Util . getLineNumber ( textStart , this . lineEnds , <NUM_LIT:0> , this . maxLines ) ; int htmlTagID = text . getHtmlTagID ( ) ; if ( text . depth >= this . javadocHtmlTagBuffers . length ) { int length = this . javadocHtmlTagBuffers . length ; System . arraycopy ( this . javadocHtmlTagBuffers , <NUM_LIT:0> , this . javadocHtmlTagBuffers = new StringBuffer [ text . depth + <NUM_LIT:6> ] , <NUM_LIT:0> , length ) ; } StringBuffer buffer = this . javadocHtmlTagBuffers [ text . depth ] ; if ( buffer == null ) { buffer = new StringBuffer ( ) ; this . javadocHtmlTagBuffers [ text . depth ] = buffer ; } else { buffer . setLength ( <NUM_LIT:0> ) ; } int max = text . separatorsPtr ; int linesAfter = <NUM_LIT:0> ; int previousEnd = - <NUM_LIT:1> ; boolean isHtmlBreakTag = htmlTagID == JAVADOC_SINGLE_BREAK_TAG_ID ; boolean isHtmlSeparatorTag = htmlTagID == JAVADOC_SEPARATOR_TAGS_ID ; if ( isHtmlBreakTag ) { return <NUM_LIT:1> ; } boolean isCode = htmlTagID == JAVADOC_CODE_TAGS_ID ; for ( int idx = <NUM_LIT:0> , ptr = <NUM_LIT:0> ; idx <= max || ( text . htmlNodesPtr != - <NUM_LIT:1> && ptr <= text . htmlNodesPtr ) ; idx ++ ) { int end = ( idx > max ) ? text . sourceEnd : ( int ) ( text . separators [ idx ] > > > <NUM_LIT:32> ) ; int nodeKind = <NUM_LIT:0> ; if ( text . htmlNodesPtr >= <NUM_LIT:0> && ptr <= text . htmlNodesPtr && end > text . htmlNodes [ ptr ] . sourceStart ) { FormatJavadocNode node = text . htmlNodes [ ptr ] ; FormatJavadocText htmlTag = node . isText ( ) ? ( FormatJavadocText ) node : null ; int newLines = htmlTag == null ? <NUM_LIT:0> : htmlTag . linesBefore ; if ( linesAfter > newLines ) { newLines = linesAfter ; if ( newLines > <NUM_LIT:1> && clearBlankLines ) { if ( idx < <NUM_LIT:2> || ( text . htmlIndexes [ idx - <NUM_LIT:2> ] & JAVADOC_TAGS_ID_MASK ) != JAVADOC_CODE_TAGS_ID ) { newLines = <NUM_LIT:1> ; } } } if ( textStart < previousEnd ) { addReplaceEdit ( textStart , previousEnd , buffer . toString ( ) ) ; } boolean immutable = node . isImmutable ( ) ; if ( newLines == <NUM_LIT:0> ) { newLines = printJavadocBlockNodesNewLines ( block , node , previousEnd ) ; } int nodeStart = node . sourceStart ; if ( newLines > <NUM_LIT:0> || ( idx > <NUM_LIT:1> && nodeStart > ( previousEnd + <NUM_LIT:1> ) ) ) { printJavadocGapLines ( previousEnd + <NUM_LIT:1> , nodeStart - <NUM_LIT:1> , newLines , clearBlankLines , false , null ) ; } if ( newLines > <NUM_LIT:0> ) textOnNewLine = true ; buffer . setLength ( <NUM_LIT:0> ) ; if ( node . isText ( ) ) { if ( immutable ) { if ( textOnNewLine && this . commentIndentation != null ) { addInsertEdit ( node . sourceStart , this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } printJavadocImmutableText ( htmlTag , block , textOnNewLine ) ; this . column += getTextLength ( block , htmlTag ) ; linesAfter = <NUM_LIT:0> ; } else { linesAfter = printJavadocHtmlTag ( htmlTag , block , textOnNewLine ) ; } nodeKind = <NUM_LIT:1> ; } else { if ( textOnNewLine && this . commentIndentation != null ) { addInsertEdit ( node . sourceStart , this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } printJavadocBlock ( ( FormatJavadocBlock ) node ) ; linesAfter = <NUM_LIT:0> ; nodeKind = <NUM_LIT:2> ; } textStart = node . sourceEnd + <NUM_LIT:1> ; ptr ++ ; if ( idx > max ) { return linesAfter ; } } else { if ( idx > <NUM_LIT:0> && linesAfter > <NUM_LIT:0> ) { printJavadocGapLines ( previousEnd + <NUM_LIT:1> , nextStart - <NUM_LIT:1> , linesAfter , clearBlankLines , false , buffer ) ; textOnNewLine = true ; } boolean needIndentation = textOnNewLine ; if ( idx > <NUM_LIT:0> ) { if ( ! needIndentation && text . isTextAfterHtmlSeparatorTag ( idx - <NUM_LIT:1> ) ) { needIndentation = true ; } } this . needSpace = idx > <NUM_LIT:1> && ( previousEnd + <NUM_LIT:1> ) < nextStart ; printJavadocTextLine ( buffer , nextStart , end , block , idx == <NUM_LIT:0> , needIndentation , idx == <NUM_LIT:0> || text . htmlIndexes [ idx - <NUM_LIT:1> ] != - <NUM_LIT:1> ) ; linesAfter = <NUM_LIT:0> ; if ( idx == <NUM_LIT:0> ) { if ( isHtmlSeparatorTag ) { linesAfter = <NUM_LIT:1> ; } } else if ( text . htmlIndexes [ idx - <NUM_LIT:1> ] == JAVADOC_SINGLE_BREAK_TAG_ID ) { linesAfter = <NUM_LIT:1> ; } } nextStart = ( int ) text . separators [ idx ] ; int endLine = Util . getLineNumber ( end , this . lineEnds , startLine - <NUM_LIT:1> , this . maxLines ) ; startLine = Util . getLineNumber ( nextStart , this . lineEnds , endLine - <NUM_LIT:1> , this . maxLines ) ; int linesGap = startLine - endLine ; if ( linesGap > <NUM_LIT:0> ) { if ( clearBlankLines ) { } else { if ( idx == <NUM_LIT:0> || linesGap > <NUM_LIT:1> || ( idx < max && nodeKind == <NUM_LIT:1> && ( text . htmlIndexes [ idx - <NUM_LIT:1> ] & JAVADOC_TAGS_ID_MASK ) != JAVADOC_IMMUTABLE_TAGS_ID ) ) { if ( linesAfter < linesGap ) { linesAfter = linesGap ; } } } } textOnNewLine = linesAfter > <NUM_LIT:0> ; if ( isCode ) { int codeEnd = ( int ) ( text . separators [ max ] > > > <NUM_LIT:32> ) ; if ( codeEnd > end ) { if ( this . formatter . preferences . comment_format_source ) { if ( textStart < end ) addReplaceEdit ( textStart , end , buffer . toString ( ) ) ; if ( linesGap > <NUM_LIT:0> ) { int lineStart = this . scanner . getLineStart ( startLine ) ; if ( nextStart > lineStart ) { this . scanner . resetTo ( lineStart , nextStart - <NUM_LIT:1> ) ; try { int token = this . scanner . getNextToken ( ) ; if ( token == TerminalTokens . TokenNameWHITESPACE ) { token = this . scanner . getNextToken ( ) ; } if ( token == TerminalTokens . TokenNameMULTIPLY ) { nextStart = this . scanner . currentPosition ; } } catch ( InvalidInputException iie ) { } } } int newLines = linesGap ; if ( newLines == <NUM_LIT:0> ) newLines = <NUM_LIT:1> ; this . needSpace = false ; printJavadocGapLines ( end + <NUM_LIT:1> , nextStart - <NUM_LIT:1> , newLines , false , false , null ) ; printCodeSnippet ( nextStart , codeEnd , linesGap ) ; nextStart = ( int ) text . separators [ max ] ; printJavadocGapLines ( codeEnd + <NUM_LIT:1> , nextStart - <NUM_LIT:1> , <NUM_LIT:1> , false , false , null ) ; return <NUM_LIT:2> ; } } else { nextStart = ( int ) text . separators [ max ] ; if ( ( nextStart - <NUM_LIT:1> ) > ( end + <NUM_LIT:1> ) ) { int line1 = Util . getLineNumber ( end + <NUM_LIT:1> , this . lineEnds , startLine - <NUM_LIT:1> , this . maxLines ) ; int line2 = Util . getLineNumber ( nextStart - <NUM_LIT:1> , this . lineEnds , line1 - <NUM_LIT:1> , this . maxLines ) ; int gapLines = line2 - line1 - <NUM_LIT:1> ; printJavadocGapLines ( end + <NUM_LIT:1> , nextStart - <NUM_LIT:1> , gapLines , false , false , null ) ; if ( gapLines > <NUM_LIT:0> ) textOnNewLine = true ; } } return <NUM_LIT:1> ; } previousEnd = end ; } boolean closingTag = isHtmlBreakTag || ( text . htmlIndexes != null && ( text . htmlIndexes [ max ] & JAVADOC_TAGS_ID_MASK ) == htmlTagID ) ; boolean isValidHtmlSeparatorTag = max > <NUM_LIT:0> && isHtmlSeparatorTag && closingTag ; if ( previousEnd != - <NUM_LIT:1> ) { if ( isValidHtmlSeparatorTag ) { if ( linesAfter == <NUM_LIT:0> ) linesAfter = <NUM_LIT:1> ; } if ( linesAfter > <NUM_LIT:0> ) { printJavadocGapLines ( previousEnd + <NUM_LIT:1> , nextStart - <NUM_LIT:1> , linesAfter , clearBlankLines , false , buffer ) ; textOnNewLine = linesAfter > <NUM_LIT:0> ; } } boolean needIndentation = textOnNewLine ; if ( ! needIndentation && ! isHtmlBreakTag && text . htmlIndexes != null && text . isTextAfterHtmlSeparatorTag ( max ) ) { needIndentation = true ; } this . needSpace = ! closingTag && max > <NUM_LIT:0> && ( previousEnd + <NUM_LIT:1> ) < nextStart ; printJavadocTextLine ( buffer , nextStart , text . sourceEnd , block , max <= <NUM_LIT:0> , needIndentation , closingTag ) ; if ( textStart < text . sourceEnd ) { addReplaceEdit ( textStart , text . sourceEnd , buffer . toString ( ) ) ; } this . needSpace = false ; this . scanner . resetTo ( text . sourceEnd + <NUM_LIT:1> , this . scannerEndPosition - <NUM_LIT:1> ) ; return isValidHtmlSeparatorTag ? <NUM_LIT:1> : <NUM_LIT:0> ; } private void printJavadocNewLine ( StringBuffer buffer ) { buffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( buffer ) ; buffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; this . line ++ ; this . lastNumberOfNewLines ++ ; } private void printJavadocText ( FormatJavadocText text , FormatJavadocBlock block , boolean textOnNewLine ) { boolean clearBlankLines = this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment ; boolean joinLines = this . formatter . preferences . join_lines_in_comments ; this . javadocTextBuffer . setLength ( <NUM_LIT:0> ) ; int textStart = text . sourceStart ; int nextStart = textStart ; int startLine = Util . getLineNumber ( textStart , this . lineEnds , <NUM_LIT:0> , this . maxLines ) ; for ( int idx = <NUM_LIT:0> , max = text . separatorsPtr ; idx <= max ; idx ++ ) { int end = ( int ) ( text . separators [ idx ] > > > <NUM_LIT:32> ) ; boolean needIndentation = textOnNewLine ; if ( idx > <NUM_LIT:0> ) { if ( ! needIndentation && text . isTextAfterHtmlSeparatorTag ( idx - <NUM_LIT:1> ) ) { needIndentation = true ; } } this . needSpace = idx > <NUM_LIT:0> ; printJavadocTextLine ( this . javadocTextBuffer , nextStart , end , block , idx == <NUM_LIT:0> || ( ! joinLines && textOnNewLine ) , needIndentation , false ) ; textOnNewLine = false ; nextStart = ( int ) text . separators [ idx ] ; if ( ! clearBlankLines || ! joinLines ) { int endLine = Util . getLineNumber ( end , this . lineEnds , startLine - <NUM_LIT:1> , this . maxLines ) ; startLine = Util . getLineNumber ( nextStart , this . lineEnds , endLine - <NUM_LIT:1> , this . maxLines ) ; int gapLine = endLine ; if ( joinLines ) gapLine ++ ; if ( startLine > gapLine ) { addReplaceEdit ( textStart , end , this . javadocTextBuffer . toString ( ) ) ; textStart = nextStart ; this . javadocTextBuffer . setLength ( <NUM_LIT:0> ) ; int newLines = startLine - endLine ; if ( clearBlankLines ) newLines = <NUM_LIT:1> ; printJavadocGapLines ( end + <NUM_LIT:1> , nextStart - <NUM_LIT:1> , newLines , this . formatter . preferences . comment_clear_blank_lines_in_javadoc_comment , false , null ) ; textOnNewLine = true ; } else if ( startLine > endLine ) { textOnNewLine = ! joinLines ; } } } boolean needIndentation = textOnNewLine ; this . needSpace = text . separatorsPtr >= <NUM_LIT:0> ; printJavadocTextLine ( this . javadocTextBuffer , nextStart , text . sourceEnd , block , text . separatorsPtr == - <NUM_LIT:1> , needIndentation , false ) ; addReplaceEdit ( textStart , text . sourceEnd , this . javadocTextBuffer . toString ( ) ) ; this . needSpace = false ; this . scanner . resetTo ( text . sourceEnd + <NUM_LIT:1> , this . scannerEndPosition - <NUM_LIT:1> ) ; } private void printJavadocTextLine ( StringBuffer buffer , int textStart , int textEnd , FormatJavadocBlock block , boolean firstText , boolean needIndentation , boolean isHtmlTag ) { boolean headerLine = block . isHeaderLine ( ) && this . lastNumberOfNewLines == <NUM_LIT:0> ; this . javadocTokensBuffer . setLength ( <NUM_LIT:0> ) ; int firstColumn = <NUM_LIT:1> + this . indentationLevel + BLOCK_LINE_PREFIX_LENGTH ; int maxColumn = this . formatter . preferences . comment_line_length + <NUM_LIT:1> ; if ( headerLine ) { firstColumn ++ ; maxColumn ++ ; } if ( needIndentation && this . commentIndentation != null ) { buffer . append ( this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; firstColumn += this . commentIndentation . length ( ) ; } if ( this . column < firstColumn ) { this . column = firstColumn ; } String newLineString = null ; try { this . scanner . resetTo ( textStart , textEnd ) ; this . scanner . skipComments = true ; int previousToken = - <NUM_LIT:1> ; boolean textOnNewLine = needIndentation ; while ( ! this . scanner . atEnd ( ) ) { int token ; try { token = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException iie ) { token = consumeInvalidToken ( textEnd ) ; } int tokensBufferLength = this . javadocTokensBuffer . length ( ) ; int tokenStart = this . scanner . getCurrentTokenStartPosition ( ) ; int tokenLength = ( this . scanner . atEnd ( ) ? this . scanner . eofPosition : this . scanner . currentPosition ) - tokenStart ; boolean insertSpace = ( previousToken == TerminalTokens . TokenNameWHITESPACE || this . needSpace ) && ! textOnNewLine ; String tokensBufferString = this . javadocTokensBuffer . toString ( ) . trim ( ) ; switch ( token ) { case TerminalTokens . TokenNameWHITESPACE : if ( tokensBufferLength > <NUM_LIT:0> ) { boolean shouldSplit = ( this . column + tokensBufferLength ) > maxColumn && ! isHtmlTag && ( insertSpace || tokensBufferLength > <NUM_LIT:1> ) && tokensBufferString . charAt ( <NUM_LIT:0> ) != '<CHAR_LIT>' ; if ( shouldSplit ) { this . lastNumberOfNewLines ++ ; this . line ++ ; if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; if ( this . commentIndentation != null ) { this . tempBuffer . append ( this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } firstColumn = this . column ; newLineString = this . tempBuffer . toString ( ) ; } else { this . column = firstColumn ; } buffer . append ( newLineString ) ; buffer . append ( tokensBufferString ) ; this . column += tokensBufferString . length ( ) ; if ( headerLine ) { firstColumn -- ; maxColumn -- ; headerLine = false ; } } else { buffer . append ( this . javadocTokensBuffer ) ; this . column += tokensBufferLength ; } this . javadocTokensBuffer . setLength ( <NUM_LIT:0> ) ; } textOnNewLine = false ; previousToken = token ; continue ; case TerminalTokens . TokenNameCharacterLiteral : if ( this . scanner . currentPosition > this . scanner . eofPosition ) { this . scanner . resetTo ( this . scanner . startPosition , textEnd ) ; this . scanner . getNextChar ( ) ; token = <NUM_LIT:1> ; } break ; } int lastColumn = this . column + tokensBufferLength + tokenLength ; if ( insertSpace ) lastColumn ++ ; boolean shouldSplit = lastColumn > maxColumn && ( ! isHtmlTag || previousToken == - <NUM_LIT:1> ) && token != TerminalTokens . TokenNameAT && ( tokensBufferLength == <NUM_LIT:0> || this . javadocTokensBuffer . charAt ( tokensBufferLength - <NUM_LIT:1> ) != '<CHAR_LIT>' ) ; if ( shouldSplit ) { if ( ( tokensBufferLength > <NUM_LIT:0> || tokenLength < maxColumn ) && ! isHtmlTag && tokensBufferLength > <NUM_LIT:0> && ( firstColumn + tokensBufferLength + tokenLength ) >= maxColumn ) { buffer . append ( this . javadocTokensBuffer ) ; this . column += tokensBufferLength ; this . javadocTokensBuffer . setLength ( <NUM_LIT:0> ) ; tokensBufferLength = <NUM_LIT:0> ; textOnNewLine = false ; } if ( ( tokensBufferLength > <NUM_LIT:0> || this . column > firstColumn ) && ( ! textOnNewLine || ! firstText ) ) { this . lastNumberOfNewLines ++ ; this . line ++ ; if ( newLineString == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( this . lineSeparator ) ; this . column = <NUM_LIT:1> ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; if ( this . commentIndentation != null ) { this . tempBuffer . append ( this . commentIndentation ) ; this . column += this . commentIndentation . length ( ) ; } firstColumn = this . column ; newLineString = this . tempBuffer . toString ( ) ; } else { this . column = firstColumn ; } buffer . append ( newLineString ) ; } if ( tokensBufferLength > <NUM_LIT:0> ) { String tokensString = tokensBufferString ; buffer . append ( tokensString ) ; this . column += tokensString . length ( ) ; this . javadocTokensBuffer . setLength ( <NUM_LIT:0> ) ; tokensBufferLength = <NUM_LIT:0> ; } buffer . append ( this . scanner . source , tokenStart , tokenLength ) ; this . column += tokenLength ; textOnNewLine = false ; if ( headerLine ) { firstColumn -- ; maxColumn -- ; headerLine = false ; } } else { if ( insertSpace ) { this . javadocTokensBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } this . javadocTokensBuffer . append ( this . scanner . source , tokenStart , tokenLength ) ; } previousToken = token ; this . needSpace = false ; if ( headerLine && lastColumn == maxColumn && this . scanner . atEnd ( ) ) { this . lastNumberOfNewLines ++ ; this . line ++ ; } } } finally { this . scanner . skipComments = false ; if ( this . javadocTokensBuffer . length ( ) > <NUM_LIT:0> ) { buffer . append ( this . javadocTokensBuffer ) ; this . column += this . javadocTokensBuffer . length ( ) ; } } } public void printModifiers ( Annotation [ ] annotations , ASTVisitor visitor ) { printModifiers ( annotations , visitor , ICodeFormatterConstants . ANNOTATION_UNSPECIFIED ) ; } public void printModifiers ( Annotation [ ] annotations , ASTVisitor visitor , int annotationSourceKind ) { try { int annotationsLength = annotations != null ? annotations . length : <NUM_LIT:0> ; int annotationsIndex = <NUM_LIT:0> ; boolean isFirstModifier = true ; int currentTokenStartPosition = this . scanner . currentPosition ; boolean hasComment = false ; boolean hasModifiers = false ; while ( ( this . currentToken = this . scanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { int foundTaskCount = this . scanner . foundTaskCount ; switch ( this . currentToken ) { case TerminalTokens . TokenNamepublic : case TerminalTokens . TokenNameprotected : case TerminalTokens . TokenNameprivate : case TerminalTokens . TokenNamestatic : case TerminalTokens . TokenNameabstract : case TerminalTokens . TokenNamefinal : case TerminalTokens . TokenNamenative : case TerminalTokens . TokenNamesynchronized : case TerminalTokens . TokenNametransient : case TerminalTokens . TokenNamevolatile : case TerminalTokens . TokenNamestrictfp : hasModifiers = true ; print ( this . scanner . currentPosition - this . scanner . startPosition , ! isFirstModifier ) ; isFirstModifier = false ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameAT : hasModifiers = true ; if ( ! isFirstModifier ) { space ( ) ; } this . scanner . resetTo ( this . scanner . getCurrentTokenStartPosition ( ) , this . scannerEndPosition - <NUM_LIT:1> ) ; if ( annotationsIndex < annotationsLength ) { boolean insertSpaceBeforeBrace = this . formatter . preferences . insert_space_before_opening_brace_in_array_initializer ; this . formatter . preferences . insert_space_before_opening_brace_in_array_initializer = false ; try { annotations [ annotationsIndex ++ ] . traverse ( visitor , ( BlockScope ) null ) ; } finally { this . formatter . preferences . insert_space_before_opening_brace_in_array_initializer = insertSpaceBeforeBrace ; } boolean shouldAddNewLine = false ; switch ( annotationSourceKind ) { case ICodeFormatterConstants . ANNOTATION_ON_MEMBER : if ( this . formatter . preferences . insert_new_line_after_annotation_on_member ) { shouldAddNewLine = true ; } break ; case ICodeFormatterConstants . ANNOTATION_ON_PARAMETER : if ( this . formatter . preferences . insert_new_line_after_annotation_on_parameter ) { shouldAddNewLine = true ; } break ; case ICodeFormatterConstants . ANNOTATION_ON_LOCAL_VARIABLE : if ( this . formatter . preferences . insert_new_line_after_annotation_on_local_variable ) { shouldAddNewLine = true ; } break ; default : } if ( shouldAddNewLine ) { this . printNewLine ( ) ; } } else { return ; } isFirstModifier = false ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : if ( this . useTags && this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; if ( ! this . editsEnabled && this . editsIndex > <NUM_LIT:1> ) { OptimizedReplaceEdit currentEdit = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; if ( this . scanner . startPosition == currentEdit . offset + currentEdit . length ) { printNewLinesBeforeDisablingComment ( ) ; } } } printBlockComment ( this . currentToken == TerminalTokens . TokenNameCOMMENT_JAVADOC ) ; if ( this . useTags && ! this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; } currentTokenStartPosition = this . scanner . currentPosition ; hasComment = true ; break ; case TerminalTokens . TokenNameCOMMENT_LINE : if ( this . useTags && this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; if ( ! this . editsEnabled && this . editsIndex > <NUM_LIT:1> ) { OptimizedReplaceEdit currentEdit = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; if ( this . scanner . startPosition == currentEdit . offset + currentEdit . length ) { printNewLinesBeforeDisablingComment ( ) ; } } } printLineComment ( ) ; if ( this . useTags && ! this . editsEnabled && foundTaskCount > <NUM_LIT:0> ) { setEditsEnabled ( foundTaskCount ) ; } currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameWHITESPACE : addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; int count = <NUM_LIT:0> ; char [ ] whiteSpaces = this . scanner . getCurrentTokenSource ( ) ; for ( int i = <NUM_LIT:0> , max = whiteSpaces . length ; i < max ; i ++ ) { switch ( whiteSpaces [ i ] ) { case '<STR_LIT>' : if ( ( i + <NUM_LIT:1> ) < max ) { if ( whiteSpaces [ i + <NUM_LIT:1> ] == '<STR_LIT:\n>' ) { i ++ ; } } count ++ ; break ; case '<STR_LIT:\n>' : count ++ ; } } if ( count >= <NUM_LIT:1> && hasComment ) { printNewLine ( ) ; } currentTokenStartPosition = this . scanner . currentPosition ; hasComment = false ; break ; default : if ( hasModifiers ) { space ( ) ; } this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } } } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } public void printNewLine ( ) { this . printNewLine ( this . scanner . getCurrentTokenEndPosition ( ) + <NUM_LIT:1> ) ; } public void printNewLine ( int insertPosition ) { if ( this . nlsTagCounter > <NUM_LIT:0> ) { return ; } if ( this . lastNumberOfNewLines >= <NUM_LIT:1> ) { if ( ! this . preserveLineBreakIndentation ) { this . column = <NUM_LIT:1> ; } this . preserveLineBreakIndentation = false ; return ; } addInsertEdit ( insertPosition , this . lineSeparator ) ; this . line ++ ; this . lastNumberOfNewLines = <NUM_LIT:1> ; this . column = <NUM_LIT:1> ; this . needSpace = false ; this . pendingSpace = false ; this . preserveLineBreakIndentation = false ; this . lastLineComment . contiguous = false ; } private void printNewLinesBeforeDisablingComment ( ) { int linePtr = Arrays . binarySearch ( this . lineEnds , this . scanner . startPosition ) ; if ( linePtr < <NUM_LIT:0> ) { linePtr = - linePtr - <NUM_LIT:1> ; } int indentation = <NUM_LIT:0> ; int beginningOfLine = getLineEnd ( linePtr ) + <NUM_LIT:1> ; if ( beginningOfLine == - <NUM_LIT:1> ) { beginningOfLine = <NUM_LIT:0> ; } OptimizedReplaceEdit currentEdit = this . edits [ this . editsIndex - <NUM_LIT:1> ] ; int offset = currentEdit . offset ; if ( offset >= beginningOfLine ) return ; int scannerStartPosition = this . scanner . startPosition ; int scannerEofPosition = this . scanner . eofPosition ; int scannerCurrentPosition = this . scanner . currentPosition ; char scannerCurrentChar = this . scanner . currentCharacter ; int length = currentEdit . length ; this . scanner . resetTo ( beginningOfLine , offset + length - <NUM_LIT:1> ) ; try { while ( ! this . scanner . atEnd ( ) ) { char ch = ( char ) this . scanner . getNextChar ( ) ; switch ( ch ) { case '<STR_LIT:\t>' : if ( this . tabLength != <NUM_LIT:0> ) { int reminder = indentation % this . tabLength ; if ( reminder == <NUM_LIT:0> ) { indentation += this . tabLength ; } else { indentation = ( ( indentation / this . tabLength ) + <NUM_LIT:1> ) * this . tabLength ; } } break ; case '<CHAR_LIT:U+0020>' : indentation ++ ; break ; default : return ; } } String indentationString ; int currentIndentation = getCurrentIndentation ( this . scanner . currentPosition ) ; if ( currentIndentation > <NUM_LIT:0> && this . indentationLevel > <NUM_LIT:0> ) { int col = this . column ; this . tempBuffer . setLength ( <NUM_LIT:0> ) ; printIndentationIfNecessary ( this . tempBuffer ) ; indentationString = this . tempBuffer . toString ( ) ; this . column = col ; } else { indentationString = Util . EMPTY_STRING ; } String replacement = currentEdit . replacement ; if ( replacement . length ( ) == <NUM_LIT:0> ) { this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( beginningOfLine , offset + length - beginningOfLine , indentationString ) ; } else { int idx = replacement . lastIndexOf ( this . lineSeparator ) ; if ( idx >= <NUM_LIT:0> ) { int start = idx + this . lsLength ; this . tempBuffer . setLength ( <NUM_LIT:0> ) ; this . tempBuffer . append ( replacement . substring ( <NUM_LIT:0> , start ) ) ; if ( indentationString != Util . EMPTY_STRING ) { this . tempBuffer . append ( indentationString ) ; } this . edits [ this . editsIndex - <NUM_LIT:1> ] = new OptimizedReplaceEdit ( offset , length , this . tempBuffer . toString ( ) ) ; } } } finally { this . scanner . startPosition = scannerStartPosition ; this . scanner . eofPosition = scannerEofPosition ; this . scanner . currentPosition = scannerCurrentPosition ; this . scanner . currentCharacter = scannerCurrentChar ; } } private boolean printNewLinesCharacters ( int offset , int length ) { boolean foundNewLine = false ; int scannerStartPosition = this . scanner . startPosition ; int scannerEofPosition = this . scanner . eofPosition ; int scannerCurrentPosition = this . scanner . currentPosition ; char scannerCurrentChar = this . scanner . currentCharacter ; this . scanner . resetTo ( offset , offset + length - <NUM_LIT:1> ) ; try { while ( ! this . scanner . atEnd ( ) ) { int start = this . scanner . currentPosition ; char ch = ( char ) this . scanner . getNextChar ( ) ; boolean needReplace = ch != this . firstLS ; switch ( ch ) { case '<STR_LIT>' : if ( this . scanner . atEnd ( ) ) break ; ch = ( char ) this . scanner . getNextChar ( ) ; if ( ch != '<STR_LIT:\n>' ) break ; needReplace = needReplace || this . lsLength != <NUM_LIT:2> ; case '<STR_LIT:\n>' : if ( needReplace ) { if ( this . editsIndex == <NUM_LIT:0> || this . edits [ this . editsIndex - <NUM_LIT:1> ] . offset != start ) { this . edits [ this . editsIndex ++ ] = new OptimizedReplaceEdit ( start , this . scanner . currentPosition - start , this . lineSeparator ) ; } } foundNewLine = true ; break ; } } } finally { this . scanner . startPosition = scannerStartPosition ; this . scanner . eofPosition = scannerEofPosition ; this . scanner . currentPosition = scannerCurrentPosition ; this . scanner . currentCharacter = scannerCurrentChar ; } return foundNewLine ; } public void printNextToken ( int expectedTokenType ) { printNextToken ( expectedTokenType , false ) ; } public void printNextToken ( int expectedTokenType , boolean considerSpaceIfAny ) { switch ( expectedTokenType ) { case TerminalTokens . TokenNameRBRACE : case TerminalTokens . TokenNameLBRACE : this . formatBrace = true ; } try { printComment ( CodeFormatter . K_UNKNOWN , NO_TRAILING_COMMENT ) ; try { this . currentToken = this . scanner . getNextToken ( ) ; if ( expectedTokenType != this . currentToken ) { throw new AbortFormatting ( "<STR_LIT>" + expectedTokenType + "<STR_LIT>" + this . currentToken ) ; } print ( this . scanner . currentPosition - this . scanner . startPosition , considerSpaceIfAny ) ; } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } finally { switch ( expectedTokenType ) { case TerminalTokens . TokenNameRBRACE : case TerminalTokens . TokenNameLBRACE : this . formatBrace = false ; } } } public void printNextToken ( int [ ] expectedTokenTypes ) { printNextToken ( expectedTokenTypes , false ) ; } public void printNextToken ( int [ ] expectedTokenTypes , boolean considerSpaceIfAny ) { printComment ( CodeFormatter . K_UNKNOWN , NO_TRAILING_COMMENT ) ; try { this . currentToken = this . scanner . getNextToken ( ) ; if ( Arrays . binarySearch ( expectedTokenTypes , this . currentToken ) < <NUM_LIT:0> ) { StringBuffer expectations = new StringBuffer ( <NUM_LIT:5> ) ; for ( int i = <NUM_LIT:0> ; i < expectedTokenTypes . length ; i ++ ) { if ( i > <NUM_LIT:0> ) { expectations . append ( '<CHAR_LIT:U+002C>' ) ; } expectations . append ( expectedTokenTypes [ i ] ) ; } throw new AbortFormatting ( "<STR_LIT>" + expectations . toString ( ) + "<STR_LIT>" + this . currentToken ) ; } print ( this . scanner . currentPosition - this . scanner . startPosition , considerSpaceIfAny ) ; } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } public void printArrayQualifiedReference ( int numberOfTokens , int sourceEnd ) { int currentTokenStartPosition = this . scanner . currentPosition ; int numberOfIdentifiers = <NUM_LIT:0> ; try { do { printComment ( CodeFormatter . K_UNKNOWN , NO_TRAILING_COMMENT ) ; switch ( this . currentToken = this . scanner . getNextToken ( ) ) { case TerminalTokens . TokenNameEOF : return ; case TerminalTokens . TokenNameWHITESPACE : addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : printBlockComment ( false ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_LINE : printLineComment ( ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameIdentifier : print ( this . scanner . currentPosition - this . scanner . startPosition , false ) ; currentTokenStartPosition = this . scanner . currentPosition ; if ( ++ numberOfIdentifiers == numberOfTokens ) { this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } break ; case TerminalTokens . TokenNameDOT : print ( this . scanner . currentPosition - this . scanner . startPosition , false ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameRPAREN : currentTokenStartPosition = this . scanner . startPosition ; default : this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } } while ( this . scanner . currentPosition <= sourceEnd ) ; } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } public void printQualifiedReference ( int sourceEnd , boolean expectParenthesis ) { int currentTokenStartPosition = this . scanner . currentPosition ; try { do { printComment ( CodeFormatter . K_UNKNOWN , NO_TRAILING_COMMENT ) ; switch ( this . currentToken = this . scanner . getNextToken ( ) ) { case TerminalTokens . TokenNameEOF : return ; case TerminalTokens . TokenNameWHITESPACE : addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : printBlockComment ( false ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_LINE : printLineComment ( ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameIdentifier : case TerminalTokens . TokenNameDOT : print ( this . scanner . currentPosition - this . scanner . startPosition , false ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameRPAREN : if ( expectParenthesis ) { currentTokenStartPosition = this . scanner . startPosition ; } default : this . scanner . resetTo ( currentTokenStartPosition , this . scannerEndPosition - <NUM_LIT:1> ) ; return ; } } while ( this . scanner . currentPosition <= sourceEnd ) ; } catch ( InvalidInputException e ) { throw new AbortFormatting ( e ) ; } } private void printRule ( StringBuffer stringBuffer ) { for ( int i = <NUM_LIT:0> ; i < this . pageWidth ; i ++ ) { if ( ( i % this . tabLength ) == <NUM_LIT:0> ) { stringBuffer . append ( '<CHAR_LIT>' ) ; } else { stringBuffer . append ( '<CHAR_LIT:->' ) ; } } stringBuffer . append ( this . lineSeparator ) ; for ( int i = <NUM_LIT:0> ; i < ( this . pageWidth / this . tabLength ) ; i ++ ) { stringBuffer . append ( i ) ; stringBuffer . append ( '<STR_LIT:\t>' ) ; } } void redoAlignment ( AlignmentException e ) { if ( e . relativeDepth > <NUM_LIT:0> ) { e . relativeDepth -- ; this . currentAlignment = this . currentAlignment . enclosing ; throw e ; } resetAt ( this . currentAlignment . location ) ; this . scanner . resetTo ( this . currentAlignment . location . inputOffset , this . scanner . eofPosition - <NUM_LIT:1> ) ; this . currentAlignment . chunkKind = <NUM_LIT:0> ; } void redoMemberAlignment ( AlignmentException e ) { resetAt ( this . memberAlignment . location ) ; this . scanner . resetTo ( this . memberAlignment . location . inputOffset , this . scanner . eofPosition - <NUM_LIT:1> ) ; this . memberAlignment . chunkKind = <NUM_LIT:0> ; } public void reset ( ) { this . checkLineWrapping = true ; this . line = <NUM_LIT:0> ; this . column = <NUM_LIT:1> ; this . editsIndex = <NUM_LIT:0> ; this . nlsTagCounter = <NUM_LIT:0> ; } private void resetAt ( Location location ) { this . line = location . outputLine ; this . column = location . outputColumn ; this . indentationLevel = location . outputIndentationLevel ; this . numberOfIndentations = location . numberOfIndentations ; this . lastNumberOfNewLines = location . lastNumberOfNewLines ; this . needSpace = location . needSpace ; this . pendingSpace = location . pendingSpace ; this . editsIndex = location . editsIndex ; this . nlsTagCounter = location . nlsTagCounter ; if ( this . editsIndex > <NUM_LIT:0> ) { this . edits [ this . editsIndex - <NUM_LIT:1> ] = location . textEdit ; } this . formatter . lastLocalDeclarationSourceStart = location . lastLocalDeclarationSourceStart ; } public void resetScanner ( char [ ] compilationUnitSource ) { this . scanner . setSource ( compilationUnitSource ) ; this . scannerEndPosition = compilationUnitSource . length ; this . scanner . resetTo ( <NUM_LIT:0> , this . scannerEndPosition - <NUM_LIT:1> ) ; this . edits = new OptimizedReplaceEdit [ INITIAL_SIZE ] ; this . maxLines = this . lineEnds == null ? - <NUM_LIT:1> : this . lineEnds . length - <NUM_LIT:1> ; this . scanner . lineEnds = this . lineEnds ; this . scanner . linePtr = this . maxLines ; initFormatterCommentParser ( ) ; } private void resize ( ) { System . arraycopy ( this . edits , <NUM_LIT:0> , ( this . edits = new OptimizedReplaceEdit [ this . editsIndex * <NUM_LIT:2> ] ) , <NUM_LIT:0> , this . editsIndex ) ; } private void setCommentIndentation ( int commentIndentationLevel ) { if ( commentIndentationLevel == <NUM_LIT:0> ) { this . commentIndentation = null ; } else { int length = COMMENT_INDENTATIONS . length ; if ( commentIndentationLevel > length ) { System . arraycopy ( COMMENT_INDENTATIONS , <NUM_LIT:0> , COMMENT_INDENTATIONS = new String [ commentIndentationLevel + <NUM_LIT:10> ] , <NUM_LIT:0> , length ) ; } this . commentIndentation = COMMENT_INDENTATIONS [ commentIndentationLevel - <NUM_LIT:1> ] ; if ( this . commentIndentation == null ) { this . tempBuffer . setLength ( <NUM_LIT:0> ) ; for ( int i = <NUM_LIT:0> ; i < commentIndentationLevel ; i ++ ) { this . tempBuffer . append ( '<CHAR_LIT:U+0020>' ) ; } this . commentIndentation = this . tempBuffer . toString ( ) ; COMMENT_INDENTATIONS [ commentIndentationLevel - <NUM_LIT:1> ] = this . commentIndentation ; } } } private void setEditsEnabled ( int count ) { for ( int i = <NUM_LIT:0> ; i < count ; i ++ ) { if ( this . disablingTag != null && CharOperation . equals ( this . scanner . foundTaskTags [ i ] , this . disablingTag ) ) { this . editsEnabled = false ; } if ( this . enablingTag != null && CharOperation . equals ( this . scanner . foundTaskTags [ i ] , this . enablingTag ) ) { this . editsEnabled = true ; } } } void setIncludeComments ( boolean on ) { if ( on ) { this . formatComments |= CodeFormatter . F_INCLUDE_COMMENTS ; } else { this . formatComments &= ~ CodeFormatter . F_INCLUDE_COMMENTS ; } } void setHeaderComment ( int position ) { this . headerEndPosition = position ; } public void space ( ) { if ( ! this . needSpace ) return ; this . lastNumberOfNewLines = <NUM_LIT:0> ; this . pendingSpace = true ; this . column ++ ; this . needSpace = false ; } public String toString ( ) { StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( "<STR_LIT>" + this . pageWidth + "<STR_LIT>" ) ; switch ( this . tabChar ) { case DefaultCodeFormatterOptions . TAB : stringBuffer . append ( "<STR_LIT>" ) ; break ; case DefaultCodeFormatterOptions . SPACE : stringBuffer . append ( "<STR_LIT>" ) ; break ; default : stringBuffer . append ( "<STR_LIT>" ) ; } stringBuffer . append ( "<STR_LIT>" + this . tabLength + "<STR_LIT:)>" ) . append ( this . lineSeparator ) . append ( "<STR_LIT>" + this . line + "<STR_LIT>" + this . column + "<STR_LIT>" + this . indentationLevel + "<STR_LIT:)>" ) . append ( this . lineSeparator ) . append ( "<STR_LIT>" + this . needSpace + "<STR_LIT>" + this . lastNumberOfNewLines + "<STR_LIT>" + this . checkLineWrapping + "<STR_LIT:)>" ) . append ( this . lineSeparator ) . append ( "<STR_LIT>" ) . append ( this . lineSeparator ) ; if ( this . tabLength > <NUM_LIT:0> ) { printRule ( stringBuffer ) ; } return stringBuffer . toString ( ) ; } public void unIndent ( ) { this . indentationLevel -= this . indentationSize ; this . numberOfIndentations -- ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; public interface ICodeFormatterConstants { public static final int ANNOTATION_UNSPECIFIED = <NUM_LIT:0> ; public static final int ANNOTATION_ON_MEMBER = <NUM_LIT:1> ; public static final int ANNOTATION_ON_PARAMETER = <NUM_LIT:2> ; public static final int ANNOTATION_ON_LOCAL_VARIABLE = <NUM_LIT:3> ; } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import org . eclipse . jdt . internal . formatter . comment . IJavaDocTagConstants ; public class FormatJavadocText extends FormatJavadocNode implements IJavaDocTagConstants { long [ ] separators ; int separatorsPtr = - <NUM_LIT:1> ; private int htmlTagIndex = - <NUM_LIT:1> ; boolean immutable = false ; FormatJavadocNode [ ] htmlNodes ; int [ ] htmlIndexes ; int htmlNodesPtr = - <NUM_LIT:1> ; int depth = <NUM_LIT:0> ; public FormatJavadocText ( int start , int end , int line , int htmlIndex , int htmlDepth ) { super ( start , end , line ) ; this . htmlTagIndex = htmlIndex ; this . depth = htmlDepth ; } void appendText ( FormatJavadocText text ) { text . immutable = this . immutable ; if ( this . depth == text . depth ) { addSeparator ( text ) ; this . sourceEnd = text . sourceEnd ; if ( text . isClosingHtmlTag ( ) ) { this . htmlTagIndex = text . htmlTagIndex ; } } else { appendNode ( text ) ; } if ( text . isHtmlTag ( ) ) { switch ( text . htmlTagIndex & JAVADOC_TAGS_ID_MASK ) { case JAVADOC_CODE_TAGS_ID : text . linesBefore = this . htmlNodesPtr == - <NUM_LIT:1> ? <NUM_LIT:0> : <NUM_LIT:2> ; break ; case JAVADOC_SEPARATOR_TAGS_ID : text . linesBefore = <NUM_LIT:1> ; break ; case JAVADOC_SINGLE_BREAK_TAG_ID : if ( ! text . isClosingHtmlTag ( ) ) text . linesBefore = <NUM_LIT:1> ; break ; case JAVADOC_BREAK_TAGS_ID : if ( ! text . isClosingHtmlTag ( ) ) text . linesBefore = <NUM_LIT:1> ; } } } void appendNode ( FormatJavadocNode node ) { if ( ++ this . htmlNodesPtr == <NUM_LIT:0> ) { this . htmlNodes = new FormatJavadocNode [ DEFAULT_ARRAY_SIZE ] ; } else { if ( this . htmlNodesPtr == this . htmlNodes . length ) { int size = this . htmlNodesPtr + DEFAULT_ARRAY_SIZE ; System . arraycopy ( this . htmlNodes , <NUM_LIT:0> , ( this . htmlNodes = new FormatJavadocNode [ size ] ) , <NUM_LIT:0> , this . htmlNodesPtr ) ; } } addSeparator ( node ) ; this . htmlNodes [ this . htmlNodesPtr ] = node ; this . sourceEnd = node . sourceEnd ; } private void addSeparator ( FormatJavadocNode node ) { if ( ++ this . separatorsPtr == <NUM_LIT:0> ) { this . separators = new long [ DEFAULT_ARRAY_SIZE ] ; this . htmlIndexes = new int [ DEFAULT_ARRAY_SIZE ] ; } else { if ( this . separatorsPtr == this . separators . length ) { int size = this . separatorsPtr + DEFAULT_ARRAY_SIZE ; System . arraycopy ( this . separators , <NUM_LIT:0> , ( this . separators = new long [ size ] ) , <NUM_LIT:0> , this . separatorsPtr ) ; System . arraycopy ( this . htmlIndexes , <NUM_LIT:0> , ( this . htmlIndexes = new int [ size ] ) , <NUM_LIT:0> , this . separatorsPtr ) ; } } this . separators [ this . separatorsPtr ] = ( ( ( long ) this . sourceEnd ) << <NUM_LIT:32> ) + node . sourceStart ; this . htmlIndexes [ this . separatorsPtr ] = node . isText ( ) ? ( ( FormatJavadocText ) node ) . htmlTagIndex : - <NUM_LIT:1> ; } void clean ( ) { int length = this . separators == null ? <NUM_LIT:0> : this . separators . length ; if ( this . separatorsPtr != ( length - <NUM_LIT:1> ) ) { System . arraycopy ( this . separators , <NUM_LIT:0> , this . separators = new long [ this . separatorsPtr + <NUM_LIT:1> ] , <NUM_LIT:0> , this . separatorsPtr + <NUM_LIT:1> ) ; System . arraycopy ( this . htmlIndexes , <NUM_LIT:0> , this . htmlIndexes = new int [ this . separatorsPtr + <NUM_LIT:1> ] , <NUM_LIT:0> , this . separatorsPtr + <NUM_LIT:1> ) ; } length = this . htmlNodes == null ? <NUM_LIT:0> : this . htmlNodes . length ; if ( this . htmlNodesPtr != ( length - <NUM_LIT:1> ) ) { System . arraycopy ( this . htmlNodes , <NUM_LIT:0> , this . htmlNodes = new FormatJavadocNode [ this . htmlNodesPtr + <NUM_LIT:1> ] , <NUM_LIT:0> , this . htmlNodesPtr + <NUM_LIT:1> ) ; for ( int i = <NUM_LIT:0> ; i <= this . htmlNodesPtr ; i ++ ) { this . htmlNodes [ i ] . clean ( ) ; } } } void closeTag ( ) { this . htmlTagIndex |= JAVADOC_CLOSED_TAG ; } int getHtmlTagIndex ( ) { return this . htmlTagIndex & JAVADOC_TAGS_INDEX_MASK ; } int getHtmlTagID ( ) { return this . htmlTagIndex & JAVADOC_TAGS_ID_MASK ; } FormatJavadocNode getLastNode ( ) { if ( this . htmlNodes != null ) { return this . htmlNodes [ this . htmlNodesPtr ] ; } return null ; } public boolean isClosingHtmlTag ( ) { return this . htmlTagIndex != - <NUM_LIT:1> && ( this . htmlTagIndex & JAVADOC_CLOSED_TAG ) != <NUM_LIT:0> ; } public boolean isHtmlTag ( ) { return this . htmlTagIndex != - <NUM_LIT:1> ; } public boolean isImmutableHtmlTag ( ) { return this . htmlTagIndex != - <NUM_LIT:1> && ( this . htmlTagIndex & JAVADOC_TAGS_ID_MASK ) == JAVADOC_IMMUTABLE_TAGS_ID ; } public boolean isImmutable ( ) { return this . immutable || ( this . htmlTagIndex != - <NUM_LIT:1> && ( this . htmlTagIndex & JAVADOC_TAGS_ID_MASK ) == JAVADOC_IMMUTABLE_TAGS_ID ) ; } public boolean isTextAfterHtmlSeparatorTag ( int separatorIndex ) { int ptr = separatorIndex ; if ( ptr > this . separatorsPtr ) return false ; int tagIndex = this . htmlIndexes [ ptr ] & JAVADOC_TAGS_ID_MASK ; return tagIndex != - <NUM_LIT:1> && tagIndex == JAVADOC_SEPARATOR_TAGS_ID ; } public boolean isText ( ) { return true ; } void setHeaderLine ( int javadocLineStart ) { for ( int i = <NUM_LIT:0> ; i < this . htmlNodesPtr ; i ++ ) { FormatJavadocNode node = this . htmlNodes [ i ] ; if ( ! node . isText ( ) ) { ( ( FormatJavadocBlock ) node ) . setHeaderLine ( javadocLineStart ) ; } } } protected void toString ( StringBuffer buffer ) { StringBuffer indentation = new StringBuffer ( ) ; for ( int t = <NUM_LIT:0> ; t <= this . depth ; t ++ ) indentation . append ( '<STR_LIT:\t>' ) ; buffer . append ( indentation ) ; if ( isImmutable ( ) ) { buffer . append ( "<STR_LIT>" ) ; } buffer . append ( "<STR_LIT:text>" ) ; super . toString ( buffer ) ; buffer . append ( "<STR_LIT:U+0020(>" ) ; buffer . append ( this . separatorsPtr + <NUM_LIT:1> ) . append ( "<STR_LIT>" ) ; buffer . append ( this . htmlNodesPtr + <NUM_LIT:1> ) . append ( "<STR_LIT>" ) ; buffer . append ( this . depth ) . append ( "<STR_LIT>" ) ; buffer . append ( this . linesBefore ) . append ( "<STR_LIT>" ) ; String tagID = "<STR_LIT>" ; switch ( getHtmlTagID ( ) ) { case JAVADOC_TAGS_ID_MASK : tagID = "<STR_LIT>" ; break ; case JAVADOC_SINGLE_BREAK_TAG_ID : tagID = "<STR_LIT>" ; break ; case JAVADOC_CODE_TAGS_ID : tagID = "<STR_LIT:code>" ; break ; case JAVADOC_BREAK_TAGS_ID : tagID = "<STR_LIT>" ; break ; case JAVADOC_IMMUTABLE_TAGS_ID : tagID = "<STR_LIT>" ; break ; case JAVADOC_SEPARATOR_TAGS_ID : tagID = "<STR_LIT>" ; break ; } buffer . append ( tagID ) . append ( "<STR_LIT>" ) ; buffer . append ( '<STR_LIT:\n>' ) ; } public void toStringDebug ( StringBuffer buffer , char [ ] source ) { if ( buffer . length ( ) > <NUM_LIT:0> ) { for ( int l = <NUM_LIT:0> ; l < this . linesBefore ; l ++ ) { buffer . append ( '<STR_LIT:\n>' ) ; for ( int t = <NUM_LIT:0> ; t < this . depth ; t ++ ) buffer . append ( '<STR_LIT:\t>' ) ; } } if ( this . separatorsPtr == - <NUM_LIT:1> ) { super . toStringDebug ( buffer , source ) ; return ; } int ptr = <NUM_LIT:0> ; int nextStart = this . sourceStart ; int idx = <NUM_LIT:0> ; while ( idx <= this . separatorsPtr || ( this . htmlNodesPtr != - <NUM_LIT:1> && ptr <= this . htmlNodesPtr ) ) { if ( idx > this . separatorsPtr ) { FormatJavadocNode node = this . htmlNodes [ ptr ++ ] ; node . toStringDebug ( buffer , source ) ; return ; } int end = ( int ) ( this . separators [ idx ] > > > <NUM_LIT:32> ) ; if ( this . htmlNodesPtr >= <NUM_LIT:0> && ptr <= this . htmlNodesPtr && end > this . htmlNodes [ ptr ] . sourceStart ) { FormatJavadocNode node = this . htmlNodes [ ptr ++ ] ; node . toStringDebug ( buffer , source ) ; } else { if ( idx > <NUM_LIT:1> && source [ nextStart ] != '<CHAR_LIT>' ) { buffer . append ( '<STR_LIT:\n>' ) ; for ( int t = <NUM_LIT:0> ; t < this . depth ; t ++ ) buffer . append ( '<STR_LIT:\t>' ) ; } buffer . append ( source , nextStart , end - nextStart + <NUM_LIT:1> ) ; } nextStart = ( int ) this . separators [ idx ++ ] ; } if ( source [ nextStart ] == '<CHAR_LIT>' ) { switch ( getHtmlTagID ( ) ) { case JAVADOC_CODE_TAGS_ID : buffer . append ( '<STR_LIT:\n>' ) ; for ( int t = <NUM_LIT:0> ; t < this . depth ; t ++ ) buffer . append ( '<STR_LIT:\t>' ) ; break ; } } buffer . append ( source , nextStart , this . sourceEnd - nextStart + <NUM_LIT:1> ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . formatter . comment . IJavaDocTagConstants ; public class FormatJavadocBlock extends FormatJavadocNode implements IJavaDocTagConstants { final static int INLINED = <NUM_LIT> ; final static int FIRST = <NUM_LIT> ; final static int ON_HEADER_LINE = <NUM_LIT> ; final static int TEXT_ON_TAG_LINE = <NUM_LIT> ; final static int ONE_LINE_TAG = <NUM_LIT> ; final static int PARAM_TAG = <NUM_LIT> ; final static int IN_PARAM_TAG = <NUM_LIT> ; final static int IN_DESCRIPTION = <NUM_LIT> ; final static int IMMUTABLE = <NUM_LIT> ; final static int MAX_TAG_HIERARCHY = <NUM_LIT:10> ; private int tagValue = NO_TAG_VALUE ; int tagEnd ; FormatJavadocReference reference ; FormatJavadocNode [ ] nodes ; int nodesPtr = - <NUM_LIT:1> ; int flags = <NUM_LIT:0> ; public FormatJavadocBlock ( int start , int end , int line , int value ) { super ( start , end , line ) ; this . tagValue = value ; this . tagEnd = end ; switch ( value ) { case TAG_PARAM_VALUE : case TAG_SERIAL_FIELD_VALUE : case TAG_THROWS_VALUE : case TAG_EXCEPTION_VALUE : this . flags |= PARAM_TAG ; break ; case TAG_CODE_VALUE : case TAG_LITERAL_VALUE : this . flags |= IMMUTABLE ; break ; } } private void addNode ( FormatJavadocNode node ) { if ( ++ this . nodesPtr == <NUM_LIT:0> ) { this . nodes = new FormatJavadocNode [ DEFAULT_ARRAY_SIZE ] ; } else if ( this . nodesPtr >= this . nodes . length ) { System . arraycopy ( this . nodes , <NUM_LIT:0> , this . nodes = new FormatJavadocNode [ this . nodes . length + INCREMENT_ARRAY_SIZE ] , <NUM_LIT:0> , this . nodesPtr ) ; } this . nodes [ this . nodesPtr ] = node ; this . sourceEnd = node . sourceEnd ; } void addBlock ( FormatJavadocBlock block , int htmlLevel ) { if ( this . nodes != null ) { FormatJavadocText [ ] textHierarchy = getTextHierarchy ( block , htmlLevel ) ; if ( textHierarchy != null ) { FormatJavadocText lastText = textHierarchy [ htmlLevel ] ; if ( lastText != null ) { lastText . appendNode ( block ) ; for ( int i = htmlLevel - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { textHierarchy [ i ] . sourceEnd = block . sourceEnd ; } this . sourceEnd = block . sourceEnd ; if ( isParamTag ( ) ) { block . flags |= IN_PARAM_TAG ; } else if ( isDescription ( ) ) { block . flags |= IN_DESCRIPTION ; } block . flags |= INLINED ; return ; } } } addNode ( block ) ; if ( isParamTag ( ) ) { block . flags |= IN_PARAM_TAG ; } else if ( isDescription ( ) ) { block . flags |= IN_DESCRIPTION ; } block . flags |= INLINED ; } void addText ( FormatJavadocText text ) { if ( this . nodes != null ) { FormatJavadocText [ ] textHierarchy = getTextHierarchy ( text , text . depth ) ; if ( textHierarchy != null ) { FormatJavadocText lastText = textHierarchy [ text . depth ] ; if ( lastText != null ) { lastText . appendText ( text ) ; for ( int i = text . depth - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { textHierarchy [ i ] . sourceEnd = text . sourceEnd ; } this . sourceEnd = text . sourceEnd ; return ; } if ( text . depth > <NUM_LIT:0> ) { FormatJavadocText parentText = textHierarchy [ text . depth - <NUM_LIT:1> ] ; if ( parentText != null ) { parentText . appendText ( text ) ; for ( int i = text . depth - <NUM_LIT:2> ; i >= <NUM_LIT:0> ; i -- ) { textHierarchy [ i ] . sourceEnd = text . sourceEnd ; } this . sourceEnd = text . sourceEnd ; return ; } } } } if ( text . isHtmlTag ( ) ) { switch ( text . getHtmlTagID ( ) ) { case JAVADOC_CODE_TAGS_ID : text . linesBefore = this . nodesPtr == - <NUM_LIT:1> ? <NUM_LIT:0> : <NUM_LIT:2> ; break ; case JAVADOC_SEPARATOR_TAGS_ID : text . linesBefore = <NUM_LIT:1> ; break ; } } addNode ( text ) ; if ( isImmutable ( ) ) { text . immutable = true ; } } void clean ( ) { int length = this . nodes == null ? <NUM_LIT:0> : this . nodes . length ; if ( this . nodesPtr != ( length - <NUM_LIT:1> ) ) { System . arraycopy ( this . nodes , <NUM_LIT:0> , this . nodes = new FormatJavadocNode [ this . nodesPtr + <NUM_LIT:1> ] , <NUM_LIT:0> , this . nodesPtr + <NUM_LIT:1> ) ; } for ( int i = <NUM_LIT:0> ; i <= this . nodesPtr ; i ++ ) { this . nodes [ i ] . clean ( ) ; } } FormatJavadocNode getLastNode ( ) { if ( this . nodes != null ) { return this . nodes [ this . nodesPtr ] ; } return null ; } FormatJavadocText [ ] getTextHierarchy ( FormatJavadocNode node , int htmlDepth ) { if ( this . nodes == null ) return null ; FormatJavadocText [ ] textHierarchy = null ; int ptr = <NUM_LIT:0> ; FormatJavadocText text = node . isText ( ) ? ( FormatJavadocText ) node : null ; FormatJavadocNode lastNode = this . nodes [ this . nodesPtr ] ; while ( lastNode . isText ( ) ) { FormatJavadocText lastText = ( FormatJavadocText ) lastNode ; int lastTagCategory = lastText . getHtmlTagID ( ) ; boolean lastSingleTag = lastTagCategory <= JAVADOC_SINGLE_TAGS_ID ; boolean lastTextCanHaveChildren = lastText . isHtmlTag ( ) && ! lastText . isClosingHtmlTag ( ) && ! lastSingleTag ; if ( lastText . depth == htmlDepth || lastText . htmlNodesPtr == - <NUM_LIT:1> ) { if ( lastText . isHtmlTag ( ) && text != null ) { boolean setLinesBefore = lastText . separatorsPtr == - <NUM_LIT:1> || ( ptr == <NUM_LIT:0> && lastText . isClosingHtmlTag ( ) ) ; if ( ! setLinesBefore && ptr > <NUM_LIT:0> && lastText . isClosingHtmlTag ( ) ) { FormatJavadocText parentText = textHierarchy [ ptr - <NUM_LIT:1> ] ; int textStart = ( int ) parentText . separators [ parentText . separatorsPtr ] ; if ( textStart < lastText . sourceStart ) { setLinesBefore = true ; } } if ( setLinesBefore ) { switch ( lastText . getHtmlTagID ( ) ) { case JAVADOC_CODE_TAGS_ID : if ( text . linesBefore < <NUM_LIT:2> ) { text . linesBefore = <NUM_LIT:2> ; } break ; case JAVADOC_SEPARATOR_TAGS_ID : case JAVADOC_SINGLE_BREAK_TAG_ID : if ( text . linesBefore < <NUM_LIT:1> ) { text . linesBefore = <NUM_LIT:1> ; } } } if ( text . isHtmlTag ( ) && ! text . isClosingHtmlTag ( ) && text . getHtmlTagIndex ( ) == lastText . getHtmlTagIndex ( ) && ! lastText . isClosingHtmlTag ( ) ) { lastText . closeTag ( ) ; return textHierarchy ; } } if ( lastTextCanHaveChildren || ( htmlDepth == <NUM_LIT:0> && ! lastText . isHtmlTag ( ) && text != null && ! text . isHtmlTag ( ) ) ) { if ( textHierarchy == null ) textHierarchy = new FormatJavadocText [ htmlDepth + <NUM_LIT:1> ] ; textHierarchy [ ptr ] = lastText ; return textHierarchy ; } return textHierarchy ; } if ( textHierarchy == null ) textHierarchy = new FormatJavadocText [ htmlDepth + <NUM_LIT:1> ] ; textHierarchy [ ptr ++ ] = lastText ; lastNode = lastText . htmlNodes [ lastText . htmlNodesPtr ] ; } return textHierarchy ; } public boolean hasTextOnTagLine ( ) { return ( this . flags & TEXT_ON_TAG_LINE ) != <NUM_LIT:0> ; } public boolean isDescription ( ) { return this . tagValue == NO_TAG_VALUE ; } public boolean isFirst ( ) { return ( this . flags & FIRST ) != <NUM_LIT:0> ; } public boolean isHeaderLine ( ) { return ( this . flags & ON_HEADER_LINE ) != <NUM_LIT:0> ; } public boolean isImmutable ( ) { return ( this . flags & IMMUTABLE ) == IMMUTABLE ; } public boolean isInDescription ( ) { return this . tagValue == NO_TAG_VALUE || ( this . flags & IN_DESCRIPTION ) == IN_DESCRIPTION ; } public boolean isInlined ( ) { return ( this . flags & INLINED ) != <NUM_LIT:0> ; } public boolean isInParamTag ( ) { return ( this . flags & ( PARAM_TAG | IN_PARAM_TAG ) ) != <NUM_LIT:0> ; } public boolean isOneLineTag ( ) { return ( this . flags & ONE_LINE_TAG ) != <NUM_LIT:0> ; } public boolean isParamTag ( ) { return ( this . flags & PARAM_TAG ) == PARAM_TAG ; } void setHeaderLine ( int javadocLineStart ) { if ( javadocLineStart == this . lineStart ) { this . flags |= ON_HEADER_LINE ; } for ( int i = <NUM_LIT:0> ; i < this . nodesPtr ; i ++ ) { this . nodes [ i ] . setHeaderLine ( javadocLineStart ) ; } } protected void toString ( StringBuffer buffer ) { boolean inlined = ( this . flags & INLINED ) != <NUM_LIT:0> ; if ( inlined ) buffer . append ( "<STR_LIT>" ) ; buffer . append ( '<CHAR_LIT>' ) ; if ( this . tagValue == TAG_OTHERS_VALUE ) { buffer . append ( "<STR_LIT>" ) ; } else { buffer . append ( TAG_NAMES [ this . tagValue ] ) ; } super . toString ( buffer ) ; if ( this . reference == null ) { buffer . append ( '<STR_LIT:\n>' ) ; } else { buffer . append ( "<STR_LIT:U+0020(>" ) ; this . reference . toString ( buffer ) ; buffer . append ( "<STR_LIT>" ) ; } StringBuffer flagsBuffer = new StringBuffer ( ) ; if ( isDescription ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT:description>" ) ; } if ( isFirst ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isHeaderLine ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isImmutable ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isInDescription ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isInlined ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isInParamTag ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isOneLineTag ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( isParamTag ( ) ) { if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) flagsBuffer . append ( '<CHAR_LIT:U+002C>' ) ; flagsBuffer . append ( "<STR_LIT>" ) ; } if ( flagsBuffer . length ( ) > <NUM_LIT:0> ) { if ( inlined ) buffer . append ( '<STR_LIT:\t>' ) ; buffer . append ( "<STR_LIT>" ) ; buffer . append ( flagsBuffer ) ; buffer . append ( '<STR_LIT:\n>' ) ; } if ( this . nodesPtr > - <NUM_LIT:1> ) { for ( int i = <NUM_LIT:0> ; i <= this . nodesPtr ; i ++ ) { if ( inlined ) buffer . append ( '<STR_LIT:\t>' ) ; this . nodes [ i ] . toString ( buffer ) ; } } } public String toStringDebug ( char [ ] source ) { StringBuffer buffer = new StringBuffer ( ) ; toStringDebug ( buffer , source ) ; return buffer . toString ( ) ; } public void toStringDebug ( StringBuffer buffer , char [ ] source ) { if ( this . tagValue > <NUM_LIT:0> ) { buffer . append ( source , this . sourceStart , this . tagEnd - this . sourceStart + <NUM_LIT:1> ) ; buffer . append ( '<CHAR_LIT:U+0020>' ) ; } if ( this . reference != null ) { this . reference . toStringDebug ( buffer , source ) ; } for ( int i = <NUM_LIT:0> ; i <= this . nodesPtr ; i ++ ) { this . nodes [ i ] . toStringDebug ( buffer , source ) ; } } void update ( Scanner scanner ) { int blockEnd = scanner . getLineNumber ( this . sourceEnd ) ; if ( blockEnd == this . lineStart ) { this . flags |= FormatJavadocBlock . ONE_LINE_TAG ; } for ( int i = <NUM_LIT:0> ; i <= this . nodesPtr ; i ++ ) { if ( ! this . nodes [ i ] . isText ( ) ) { ( ( FormatJavadocBlock ) this . nodes [ i ] ) . update ( scanner ) ; } } } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . jdt . core . formatter . DefaultCodeFormatterConstants ; import org . eclipse . jdt . core . JavaCore ; import org . eclipse . jdt . internal . compiler . util . Util ; import org . eclipse . jdt . internal . formatter . align . Alignment ; public class DefaultCodeFormatterOptions { public static final int TAB = <NUM_LIT:1> ; public static final int SPACE = <NUM_LIT:2> ; public static final int MIXED = <NUM_LIT:4> ; public static DefaultCodeFormatterOptions getDefaultSettings ( ) { DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions ( ) ; options . setDefaultSettings ( ) ; return options ; } public static DefaultCodeFormatterOptions getEclipseDefaultSettings ( ) { DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions ( ) ; options . setEclipseDefaultSettings ( ) ; return options ; } public static DefaultCodeFormatterOptions getJavaConventionsSettings ( ) { DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions ( ) ; options . setJavaConventionsSettings ( ) ; return options ; } public int alignment_for_arguments_in_allocation_expression ; public int alignment_for_arguments_in_annotation ; public int alignment_for_arguments_in_enum_constant ; public int alignment_for_arguments_in_explicit_constructor_call ; public int alignment_for_arguments_in_method_invocation ; public int alignment_for_arguments_in_qualified_allocation_expression ; public int alignment_for_assignment ; public int alignment_for_binary_expression ; public int alignment_for_compact_if ; public int alignment_for_conditional_expression ; public int alignment_for_enum_constants ; public int alignment_for_expressions_in_array_initializer ; public int alignment_for_method_declaration ; public int alignment_for_multiple_fields ; public int alignment_for_parameters_in_constructor_declaration ; public int alignment_for_parameters_in_method_declaration ; public int alignment_for_selector_in_method_invocation ; public int alignment_for_superclass_in_type_declaration ; public int alignment_for_superinterfaces_in_enum_declaration ; public int alignment_for_superinterfaces_in_type_declaration ; public int alignment_for_throws_clause_in_constructor_declaration ; public int alignment_for_throws_clause_in_method_declaration ; public boolean align_type_members_on_columns ; public String brace_position_for_annotation_type_declaration ; public String brace_position_for_anonymous_type_declaration ; public String brace_position_for_array_initializer ; public String brace_position_for_block ; public String brace_position_for_block_in_case ; public String brace_position_for_constructor_declaration ; public String brace_position_for_enum_constant ; public String brace_position_for_enum_declaration ; public String brace_position_for_method_declaration ; public String brace_position_for_type_declaration ; public String brace_position_for_switch ; public int continuation_indentation ; public int continuation_indentation_for_array_initializer ; public int blank_lines_after_imports ; public int blank_lines_after_package ; public int blank_lines_before_field ; public int blank_lines_before_first_class_body_declaration ; public int blank_lines_before_imports ; public int blank_lines_before_member_type ; public int blank_lines_before_method ; public int blank_lines_before_new_chunk ; public int blank_lines_before_package ; public int blank_lines_between_import_groups ; public int blank_lines_between_type_declarations ; public int blank_lines_at_beginning_of_method_body ; public boolean comment_clear_blank_lines_in_javadoc_comment ; public boolean comment_clear_blank_lines_in_block_comment ; public boolean comment_new_lines_at_block_boundaries ; public boolean comment_new_lines_at_javadoc_boundaries ; public boolean comment_format_javadoc_comment ; public boolean comment_format_line_comment ; public boolean comment_format_line_comment_starting_on_first_column ; public boolean comment_format_block_comment ; public boolean comment_format_header ; public boolean comment_format_html ; public boolean comment_format_source ; public boolean comment_indent_parameter_description ; public boolean comment_indent_root_tags ; public boolean comment_insert_empty_line_before_root_tags ; public boolean comment_insert_new_line_for_parameter ; public int comment_line_length ; public boolean use_tags ; public char [ ] disabling_tag ; public char [ ] enabling_tag ; private final static char [ ] DEFAULT_DISABLING_TAG = "<STR_LIT>" . toCharArray ( ) ; private final static char [ ] DEFAULT_ENABLING_TAG = "<STR_LIT>" . toCharArray ( ) ; public boolean indent_statements_compare_to_block ; public boolean indent_statements_compare_to_body ; public boolean indent_body_declarations_compare_to_annotation_declaration_header ; public boolean indent_body_declarations_compare_to_enum_constant_header ; public boolean indent_body_declarations_compare_to_enum_declaration_header ; public boolean indent_body_declarations_compare_to_type_header ; public boolean indent_breaks_compare_to_cases ; public boolean indent_empty_lines ; public boolean indent_switchstatements_compare_to_cases ; public boolean indent_switchstatements_compare_to_switch ; public int indentation_size ; public boolean insert_new_line_after_annotation_on_member ; public boolean insert_new_line_after_annotation_on_parameter ; public boolean insert_new_line_after_annotation_on_local_variable ; public boolean insert_new_line_after_label ; public boolean insert_new_line_after_opening_brace_in_array_initializer ; public boolean insert_new_line_at_end_of_file_if_missing ; public boolean insert_new_line_before_catch_in_try_statement ; public boolean insert_new_line_before_closing_brace_in_array_initializer ; public boolean insert_new_line_before_else_in_if_statement ; public boolean insert_new_line_before_finally_in_try_statement ; public boolean insert_new_line_before_while_in_do_statement ; public boolean insert_new_line_in_empty_anonymous_type_declaration ; public boolean insert_new_line_in_empty_block ; public boolean insert_new_line_in_empty_annotation_declaration ; public boolean insert_new_line_in_empty_enum_constant ; public boolean insert_new_line_in_empty_enum_declaration ; public boolean insert_new_line_in_empty_method_body ; public boolean insert_new_line_in_empty_type_declaration ; public boolean insert_space_after_and_in_type_parameter ; public boolean insert_space_after_assignment_operator ; public boolean insert_space_after_at_in_annotation ; public boolean insert_space_after_at_in_annotation_type_declaration ; public boolean insert_space_after_binary_operator ; public boolean insert_space_after_closing_angle_bracket_in_type_arguments ; public boolean insert_space_after_closing_angle_bracket_in_type_parameters ; public boolean insert_space_after_closing_paren_in_cast ; public boolean insert_space_after_closing_brace_in_block ; public boolean insert_space_after_colon_in_assert ; public boolean insert_space_after_colon_in_case ; public boolean insert_space_after_colon_in_conditional ; public boolean insert_space_after_colon_in_for ; public boolean insert_space_after_colon_in_labeled_statement ; public boolean insert_space_after_comma_in_allocation_expression ; public boolean insert_space_after_comma_in_annotation ; public boolean insert_space_after_comma_in_array_initializer ; public boolean insert_space_after_comma_in_constructor_declaration_parameters ; public boolean insert_space_after_comma_in_constructor_declaration_throws ; public boolean insert_space_after_comma_in_enum_constant_arguments ; public boolean insert_space_after_comma_in_enum_declarations ; public boolean insert_space_after_comma_in_explicit_constructor_call_arguments ; public boolean insert_space_after_comma_in_for_increments ; public boolean insert_space_after_comma_in_for_inits ; public boolean insert_space_after_comma_in_method_invocation_arguments ; public boolean insert_space_after_comma_in_method_declaration_parameters ; public boolean insert_space_after_comma_in_method_declaration_throws ; public boolean insert_space_after_comma_in_multiple_field_declarations ; public boolean insert_space_after_comma_in_multiple_local_declarations ; public boolean insert_space_after_comma_in_parameterized_type_reference ; public boolean insert_space_after_comma_in_superinterfaces ; public boolean insert_space_after_comma_in_type_arguments ; public boolean insert_space_after_comma_in_type_parameters ; public boolean insert_space_after_ellipsis ; public boolean insert_space_after_opening_angle_bracket_in_parameterized_type_reference ; public boolean insert_space_after_opening_angle_bracket_in_type_arguments ; public boolean insert_space_after_opening_angle_bracket_in_type_parameters ; public boolean insert_space_after_opening_bracket_in_array_allocation_expression ; public boolean insert_space_after_opening_bracket_in_array_reference ; public boolean insert_space_after_opening_brace_in_array_initializer ; public boolean insert_space_after_opening_paren_in_annotation ; public boolean insert_space_after_opening_paren_in_cast ; public boolean insert_space_after_opening_paren_in_catch ; public boolean insert_space_after_opening_paren_in_constructor_declaration ; public boolean insert_space_after_opening_paren_in_enum_constant ; public boolean insert_space_after_opening_paren_in_for ; public boolean insert_space_after_opening_paren_in_if ; public boolean insert_space_after_opening_paren_in_method_declaration ; public boolean insert_space_after_opening_paren_in_method_invocation ; public boolean insert_space_after_opening_paren_in_parenthesized_expression ; public boolean insert_space_after_opening_paren_in_switch ; public boolean insert_space_after_opening_paren_in_synchronized ; public boolean insert_space_after_opening_paren_in_while ; public boolean insert_space_after_postfix_operator ; public boolean insert_space_after_prefix_operator ; public boolean insert_space_after_question_in_conditional ; public boolean insert_space_after_question_in_wilcard ; public boolean insert_space_after_semicolon_in_for ; public boolean insert_space_after_unary_operator ; public boolean insert_space_before_and_in_type_parameter ; public boolean insert_space_before_at_in_annotation_type_declaration ; public boolean insert_space_before_assignment_operator ; public boolean insert_space_before_binary_operator ; public boolean insert_space_before_closing_angle_bracket_in_parameterized_type_reference ; public boolean insert_space_before_closing_angle_bracket_in_type_arguments ; public boolean insert_space_before_closing_angle_bracket_in_type_parameters ; public boolean insert_space_before_closing_brace_in_array_initializer ; public boolean insert_space_before_closing_bracket_in_array_allocation_expression ; public boolean insert_space_before_closing_bracket_in_array_reference ; public boolean insert_space_before_closing_paren_in_annotation ; public boolean insert_space_before_closing_paren_in_cast ; public boolean insert_space_before_closing_paren_in_catch ; public boolean insert_space_before_closing_paren_in_constructor_declaration ; public boolean insert_space_before_closing_paren_in_enum_constant ; public boolean insert_space_before_closing_paren_in_for ; public boolean insert_space_before_closing_paren_in_if ; public boolean insert_space_before_closing_paren_in_method_declaration ; public boolean insert_space_before_closing_paren_in_method_invocation ; public boolean insert_space_before_closing_paren_in_parenthesized_expression ; public boolean insert_space_before_closing_paren_in_switch ; public boolean insert_space_before_closing_paren_in_synchronized ; public boolean insert_space_before_closing_paren_in_while ; public boolean insert_space_before_colon_in_assert ; public boolean insert_space_before_colon_in_case ; public boolean insert_space_before_colon_in_conditional ; public boolean insert_space_before_colon_in_default ; public boolean insert_space_before_colon_in_for ; public boolean insert_space_before_colon_in_labeled_statement ; public boolean insert_space_before_comma_in_allocation_expression ; public boolean insert_space_before_comma_in_annotation ; public boolean insert_space_before_comma_in_array_initializer ; public boolean insert_space_before_comma_in_constructor_declaration_parameters ; public boolean insert_space_before_comma_in_constructor_declaration_throws ; public boolean insert_space_before_comma_in_enum_constant_arguments ; public boolean insert_space_before_comma_in_enum_declarations ; public boolean insert_space_before_comma_in_explicit_constructor_call_arguments ; public boolean insert_space_before_comma_in_for_increments ; public boolean insert_space_before_comma_in_for_inits ; public boolean insert_space_before_comma_in_method_invocation_arguments ; public boolean insert_space_before_comma_in_method_declaration_parameters ; public boolean insert_space_before_comma_in_method_declaration_throws ; public boolean insert_space_before_comma_in_multiple_field_declarations ; public boolean insert_space_before_comma_in_multiple_local_declarations ; public boolean insert_space_before_comma_in_parameterized_type_reference ; public boolean insert_space_before_comma_in_superinterfaces ; public boolean insert_space_before_comma_in_type_arguments ; public boolean insert_space_before_comma_in_type_parameters ; public boolean insert_space_before_ellipsis ; public boolean insert_space_before_parenthesized_expression_in_return ; public boolean insert_space_before_parenthesized_expression_in_throw ; public boolean insert_space_before_question_in_wilcard ; public boolean insert_space_before_opening_angle_bracket_in_parameterized_type_reference ; public boolean insert_space_before_opening_angle_bracket_in_type_arguments ; public boolean insert_space_before_opening_angle_bracket_in_type_parameters ; public boolean insert_space_before_opening_brace_in_annotation_type_declaration ; public boolean insert_space_before_opening_brace_in_anonymous_type_declaration ; public boolean insert_space_before_opening_brace_in_array_initializer ; public boolean insert_space_before_opening_brace_in_block ; public boolean insert_space_before_opening_brace_in_constructor_declaration ; public boolean insert_space_before_opening_brace_in_enum_constant ; public boolean insert_space_before_opening_brace_in_enum_declaration ; public boolean insert_space_before_opening_brace_in_method_declaration ; public boolean insert_space_before_opening_brace_in_type_declaration ; public boolean insert_space_before_opening_bracket_in_array_allocation_expression ; public boolean insert_space_before_opening_bracket_in_array_reference ; public boolean insert_space_before_opening_bracket_in_array_type_reference ; public boolean insert_space_before_opening_paren_in_annotation ; public boolean insert_space_before_opening_paren_in_annotation_type_member_declaration ; public boolean insert_space_before_opening_paren_in_catch ; public boolean insert_space_before_opening_paren_in_constructor_declaration ; public boolean insert_space_before_opening_paren_in_enum_constant ; public boolean insert_space_before_opening_paren_in_for ; public boolean insert_space_before_opening_paren_in_if ; public boolean insert_space_before_opening_paren_in_method_invocation ; public boolean insert_space_before_opening_paren_in_method_declaration ; public boolean insert_space_before_opening_paren_in_switch ; public boolean insert_space_before_opening_brace_in_switch ; public boolean insert_space_before_opening_paren_in_synchronized ; public boolean insert_space_before_opening_paren_in_parenthesized_expression ; public boolean insert_space_before_opening_paren_in_while ; public boolean insert_space_before_postfix_operator ; public boolean insert_space_before_prefix_operator ; public boolean insert_space_before_question_in_conditional ; public boolean insert_space_before_semicolon ; public boolean insert_space_before_semicolon_in_for ; public boolean insert_space_before_unary_operator ; public boolean insert_space_between_brackets_in_array_type_reference ; public boolean insert_space_between_empty_braces_in_array_initializer ; public boolean insert_space_between_empty_brackets_in_array_allocation_expression ; public boolean insert_space_between_empty_parens_in_annotation_type_member_declaration ; public boolean insert_space_between_empty_parens_in_constructor_declaration ; public boolean insert_space_between_empty_parens_in_enum_constant ; public boolean insert_space_between_empty_parens_in_method_declaration ; public boolean insert_space_between_empty_parens_in_method_invocation ; public boolean compact_else_if ; public boolean keep_guardian_clause_on_one_line ; public boolean keep_else_statement_on_same_line ; public boolean keep_empty_array_initializer_on_one_line ; public boolean keep_simple_if_on_one_line ; public boolean keep_then_statement_on_same_line ; public boolean never_indent_block_comments_on_first_column ; public boolean never_indent_line_comments_on_first_column ; public int number_of_empty_lines_to_preserve ; public boolean join_wrapped_lines ; public boolean join_lines_in_comments ; public boolean put_empty_statement_on_new_line ; public int tab_size ; public final char filling_space = '<CHAR_LIT:U+0020>' ; public int page_width ; public int tab_char ; public boolean use_tabs_only_for_leading_indentations ; public boolean wrap_before_binary_operator ; public boolean wrap_outer_expressions_when_nested ; public int initial_indentation_level ; public String line_separator ; private DefaultCodeFormatterOptions ( ) { } public DefaultCodeFormatterOptions ( Map settings ) { setDefaultSettings ( ) ; if ( settings == null ) return ; set ( settings ) ; } private String getAlignment ( int alignment ) { return Integer . toString ( alignment ) ; } public Map getMap ( ) { Map options = new HashMap ( ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION , getAlignment ( this . alignment_for_arguments_in_allocation_expression ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ANNOTATION , getAlignment ( this . alignment_for_arguments_in_annotation ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT , getAlignment ( this . alignment_for_arguments_in_enum_constant ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL , getAlignment ( this . alignment_for_arguments_in_explicit_constructor_call ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION , getAlignment ( this . alignment_for_arguments_in_method_invocation ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION , getAlignment ( this . alignment_for_arguments_in_qualified_allocation_expression ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ASSIGNMENT , getAlignment ( this . alignment_for_assignment ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION , getAlignment ( this . alignment_for_binary_expression ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_COMPACT_IF , getAlignment ( this . alignment_for_compact_if ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION , getAlignment ( this . alignment_for_conditional_expression ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS , getAlignment ( this . alignment_for_enum_constants ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER , getAlignment ( this . alignment_for_expressions_in_array_initializer ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_METHOD_DECLARATION , getAlignment ( this . alignment_for_method_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS , getAlignment ( this . alignment_for_multiple_fields ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION , getAlignment ( this . alignment_for_parameters_in_constructor_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION , getAlignment ( this . alignment_for_parameters_in_method_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION , getAlignment ( this . alignment_for_selector_in_method_invocation ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION , getAlignment ( this . alignment_for_superclass_in_type_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION , getAlignment ( this . alignment_for_superinterfaces_in_enum_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION , getAlignment ( this . alignment_for_superinterfaces_in_type_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION , getAlignment ( this . alignment_for_throws_clause_in_constructor_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION , getAlignment ( this . alignment_for_throws_clause_in_method_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS , this . align_type_members_on_columns ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ANNOTATION_TYPE_DECLARATION , this . brace_position_for_annotation_type_declaration ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION , this . brace_position_for_anonymous_type_declaration ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER , this . brace_position_for_array_initializer ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_BLOCK , this . brace_position_for_block ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE , this . brace_position_for_block_in_case ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION , this . brace_position_for_constructor_declaration ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT , this . brace_position_for_enum_constant ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION , this . brace_position_for_enum_declaration ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION , this . brace_position_for_method_declaration ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION , this . brace_position_for_type_declaration ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_SWITCH , this . brace_position_for_switch ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT , this . comment_clear_blank_lines_in_block_comment ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT , this . comment_clear_blank_lines_in_javadoc_comment ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_NEW_LINES_AT_BLOCK_BOUNDARIES , this . comment_new_lines_at_block_boundaries ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_NEW_LINES_AT_JAVADOC_BOUNDARIES , this . comment_new_lines_at_javadoc_boundaries ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT , this . comment_format_block_comment ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_HEADER , this . comment_format_header ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_HTML , this . comment_format_html ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT , this . comment_format_javadoc_comment ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_LINE_COMMENT , this . comment_format_line_comment ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN , this . comment_format_line_comment_starting_on_first_column ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_SOURCE , this . comment_format_source ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION , this . comment_indent_parameter_description ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INDENT_ROOT_TAGS , this . comment_indent_root_tags ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS , this . comment_insert_empty_line_before_root_tags ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER , this . comment_insert_new_line_for_parameter ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_LINE_LENGTH , Integer . toString ( this . comment_line_length ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_CONTINUATION_INDENTATION , Integer . toString ( this . continuation_indentation ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER , Integer . toString ( this . continuation_indentation_for_array_initializer ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_AFTER_IMPORTS , Integer . toString ( this . blank_lines_after_imports ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_AFTER_PACKAGE , Integer . toString ( this . blank_lines_after_package ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_FIELD , Integer . toString ( this . blank_lines_before_field ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION , Integer . toString ( this . blank_lines_before_first_class_body_declaration ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_IMPORTS , Integer . toString ( this . blank_lines_before_imports ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE , Integer . toString ( this . blank_lines_before_member_type ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_METHOD , Integer . toString ( this . blank_lines_before_method ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK , Integer . toString ( this . blank_lines_before_new_chunk ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_PACKAGE , Integer . toString ( this . blank_lines_before_package ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS , Integer . toString ( this . blank_lines_between_import_groups ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS , Integer . toString ( this . blank_lines_between_type_declarations ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY , Integer . toString ( this . blank_lines_at_beginning_of_method_body ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK , this . indent_statements_compare_to_block ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY , this . indent_statements_compare_to_body ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER , this . indent_body_declarations_compare_to_annotation_declaration_header ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER , this . indent_body_declarations_compare_to_enum_constant_header ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER , this . indent_body_declarations_compare_to_enum_declaration_header ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER , this . indent_body_declarations_compare_to_type_header ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES , this . indent_breaks_compare_to_cases ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_EMPTY_LINES , this . indent_empty_lines ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES , this . indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH , this . indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INDENTATION_SIZE , Integer . toString ( this . indentation_size ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER , this . insert_new_line_after_annotation_on_member ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER , this . insert_new_line_after_annotation_on_parameter ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE , this . insert_new_line_after_annotation_on_local_variable ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER , this . insert_new_line_after_opening_brace_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING , this . insert_new_line_at_end_of_file_if_missing ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT , this . insert_new_line_before_catch_in_try_statement ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER , this . insert_new_line_before_closing_brace_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT , this . insert_new_line_before_else_in_if_statement ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT , this . insert_new_line_before_finally_in_try_statement ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT , this . insert_new_line_before_while_in_do_statement ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION , this . insert_new_line_in_empty_anonymous_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK , this . insert_new_line_in_empty_block ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION , this . insert_new_line_in_empty_annotation_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT , this . insert_new_line_in_empty_enum_constant ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION , this . insert_new_line_in_empty_enum_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY , this . insert_new_line_in_empty_method_body ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION , this . insert_new_line_in_empty_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_LABEL , this . insert_new_line_after_label ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER , this . insert_space_after_and_in_type_parameter ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR , this . insert_space_after_assignment_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION , this . insert_space_after_at_in_annotation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION , this . insert_space_after_at_in_annotation_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR , this . insert_space_after_binary_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS , this . insert_space_after_closing_angle_bracket_in_type_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS , this . insert_space_after_closing_angle_bracket_in_type_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST , this . insert_space_after_closing_paren_in_cast ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK , this . insert_space_after_closing_brace_in_block ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT , this . insert_space_after_colon_in_assert ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE , this . insert_space_after_colon_in_case ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL , this . insert_space_after_colon_in_conditional ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR , this . insert_space_after_colon_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT , this . insert_space_after_colon_in_labeled_statement ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION , this . insert_space_after_comma_in_allocation_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION , this . insert_space_after_comma_in_annotation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER , this . insert_space_after_comma_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS , this . insert_space_after_comma_in_constructor_declaration_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS , this . insert_space_after_comma_in_constructor_declaration_throws ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS , this . insert_space_after_comma_in_enum_constant_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS , this . insert_space_after_comma_in_enum_declarations ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS , this . insert_space_after_comma_in_explicit_constructor_call_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS , this . insert_space_after_comma_in_for_increments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS , this . insert_space_after_comma_in_for_inits ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS , this . insert_space_after_comma_in_method_invocation_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS , this . insert_space_after_comma_in_method_declaration_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS , this . insert_space_after_comma_in_method_declaration_throws ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS , this . insert_space_after_comma_in_multiple_field_declarations ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS , this . insert_space_after_comma_in_multiple_local_declarations ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE , this . insert_space_after_comma_in_parameterized_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES , this . insert_space_after_comma_in_superinterfaces ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS , this . insert_space_after_comma_in_type_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS , this . insert_space_after_comma_in_type_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION , this . insert_space_after_opening_bracket_in_array_allocation_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS , this . insert_space_after_ellipsis ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE , this . insert_space_after_opening_angle_bracket_in_parameterized_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS , this . insert_space_after_opening_angle_bracket_in_type_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS , this . insert_space_after_opening_angle_bracket_in_type_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE , this . insert_space_after_opening_bracket_in_array_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER , this . insert_space_after_opening_brace_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION , this . insert_space_after_opening_paren_in_annotation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST , this . insert_space_after_opening_paren_in_cast ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH , this . insert_space_after_opening_paren_in_catch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION , this . insert_space_after_opening_paren_in_constructor_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT , this . insert_space_after_opening_paren_in_enum_constant ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR , this . insert_space_after_opening_paren_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF , this . insert_space_after_opening_paren_in_if ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION , this . insert_space_after_opening_paren_in_method_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION , this . insert_space_after_opening_paren_in_method_invocation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION , this . insert_space_after_opening_paren_in_parenthesized_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH , this . insert_space_after_opening_paren_in_switch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED , this . insert_space_after_opening_paren_in_synchronized ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE , this . insert_space_after_opening_paren_in_while ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR , this . insert_space_after_postfix_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR , this . insert_space_after_prefix_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL , this . insert_space_after_question_in_conditional ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD , this . insert_space_after_question_in_wilcard ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR , this . insert_space_after_semicolon_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR , this . insert_space_after_unary_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER , this . insert_space_before_and_in_type_parameter ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION , this . insert_space_before_at_in_annotation_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR , this . insert_space_before_assignment_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR , this . insert_space_before_binary_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE , this . insert_space_before_closing_angle_bracket_in_parameterized_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS , this . insert_space_before_closing_angle_bracket_in_type_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS , this . insert_space_before_closing_angle_bracket_in_type_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER , this . insert_space_before_closing_brace_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION , this . insert_space_before_closing_bracket_in_array_allocation_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE , this . insert_space_before_closing_bracket_in_array_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION , this . insert_space_before_closing_paren_in_annotation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST , this . insert_space_before_closing_paren_in_cast ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH , this . insert_space_before_closing_paren_in_catch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION , this . insert_space_before_closing_paren_in_constructor_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT , this . insert_space_before_closing_paren_in_enum_constant ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR , this . insert_space_before_closing_paren_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF , this . insert_space_before_closing_paren_in_if ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION , this . insert_space_before_closing_paren_in_method_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION , this . insert_space_before_closing_paren_in_method_invocation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION , this . insert_space_before_closing_paren_in_parenthesized_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH , this . insert_space_before_closing_paren_in_switch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED , this . insert_space_before_closing_paren_in_synchronized ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE , this . insert_space_before_closing_paren_in_while ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT , this . insert_space_before_colon_in_assert ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE , this . insert_space_before_colon_in_case ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL , this . insert_space_before_colon_in_conditional ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT , this . insert_space_before_colon_in_default ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR , this . insert_space_before_colon_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT , this . insert_space_before_colon_in_labeled_statement ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION , this . insert_space_before_comma_in_allocation_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION , this . insert_space_before_comma_in_annotation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER , this . insert_space_before_comma_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS , this . insert_space_before_comma_in_constructor_declaration_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS , this . insert_space_before_comma_in_constructor_declaration_throws ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS , this . insert_space_before_comma_in_enum_constant_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS , this . insert_space_before_comma_in_enum_declarations ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS , this . insert_space_before_comma_in_explicit_constructor_call_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS , this . insert_space_before_comma_in_for_increments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS , this . insert_space_before_comma_in_for_inits ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS , this . insert_space_before_comma_in_method_invocation_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS , this . insert_space_before_comma_in_method_declaration_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS , this . insert_space_before_comma_in_method_declaration_throws ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS , this . insert_space_before_comma_in_multiple_field_declarations ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS , this . insert_space_before_comma_in_multiple_local_declarations ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES , this . insert_space_before_comma_in_superinterfaces ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS , this . insert_space_before_comma_in_type_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS , this . insert_space_before_comma_in_type_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE , this . insert_space_before_comma_in_parameterized_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS , this . insert_space_before_ellipsis ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE , this . insert_space_before_opening_angle_bracket_in_parameterized_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS , this . insert_space_before_opening_angle_bracket_in_type_arguments ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS , this . insert_space_before_opening_angle_bracket_in_type_parameters ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION , this . insert_space_before_opening_brace_in_annotation_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION , this . insert_space_before_opening_brace_in_anonymous_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER , this . insert_space_before_opening_brace_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK , this . insert_space_before_opening_brace_in_block ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION , this . insert_space_before_opening_brace_in_constructor_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT , this . insert_space_before_opening_brace_in_enum_constant ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION , this . insert_space_before_opening_brace_in_enum_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION , this . insert_space_before_opening_brace_in_method_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION , this . insert_space_before_opening_brace_in_type_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION , this . insert_space_before_opening_bracket_in_array_allocation_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE , this . insert_space_before_opening_bracket_in_array_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE , this . insert_space_before_opening_bracket_in_array_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION , this . insert_space_before_opening_paren_in_annotation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION , this . insert_space_before_opening_paren_in_annotation_type_member_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH , this . insert_space_before_opening_paren_in_catch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION , this . insert_space_before_opening_paren_in_constructor_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT , this . insert_space_before_opening_paren_in_enum_constant ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR , this . insert_space_before_opening_paren_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF , this . insert_space_before_opening_paren_in_if ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION , this . insert_space_before_opening_paren_in_method_invocation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION , this . insert_space_before_opening_paren_in_method_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH , this . insert_space_before_opening_paren_in_switch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH , this . insert_space_before_opening_brace_in_switch ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED , this . insert_space_before_opening_paren_in_synchronized ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION , this . insert_space_before_opening_paren_in_parenthesized_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE , this . insert_space_before_opening_paren_in_while ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN , this . insert_space_before_parenthesized_expression_in_return ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW , this . insert_space_before_parenthesized_expression_in_throw ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR , this . insert_space_before_postfix_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR , this . insert_space_before_prefix_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL , this . insert_space_before_question_in_conditional ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD , this . insert_space_before_question_in_wilcard ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON , this . insert_space_before_semicolon ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR , this . insert_space_before_semicolon_in_for ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR , this . insert_space_before_unary_operator ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE , this . insert_space_between_brackets_in_array_type_reference ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER , this . insert_space_between_empty_braces_in_array_initializer ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION , this . insert_space_between_empty_brackets_in_array_allocation_expression ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION , this . insert_space_between_empty_parens_in_annotation_type_member_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION , this . insert_space_between_empty_parens_in_constructor_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT , this . insert_space_between_empty_parens_in_enum_constant ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION , this . insert_space_between_empty_parens_in_method_declaration ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION , this . insert_space_between_empty_parens_in_method_invocation ? JavaCore . INSERT : JavaCore . DO_NOT_INSERT ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_COMPACT_ELSE_IF , this . compact_else_if ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE , this . keep_guardian_clause_on_one_line ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE , this . keep_else_statement_on_same_line ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE , this . keep_empty_array_initializer_on_one_line ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE , this . keep_simple_if_on_one_line ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE , this . keep_then_statement_on_same_line ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN , this . never_indent_block_comments_on_first_column ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN , this . never_indent_line_comments_on_first_column ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE , Integer . toString ( this . number_of_empty_lines_to_preserve ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_JOIN_WRAPPED_LINES , this . join_wrapped_lines ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_JOIN_LINES_IN_COMMENTS , this . join_lines_in_comments ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE , this . put_empty_statement_on_new_line ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_LINE_SPLIT , Integer . toString ( this . page_width ) ) ; switch ( this . tab_char ) { case SPACE : options . put ( DefaultCodeFormatterConstants . FORMATTER_TAB_CHAR , JavaCore . SPACE ) ; break ; case TAB : options . put ( DefaultCodeFormatterConstants . FORMATTER_TAB_CHAR , JavaCore . TAB ) ; break ; case MIXED : options . put ( DefaultCodeFormatterConstants . FORMATTER_TAB_CHAR , DefaultCodeFormatterConstants . MIXED ) ; break ; } options . put ( DefaultCodeFormatterConstants . FORMATTER_TAB_SIZE , Integer . toString ( this . tab_size ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS , this . use_tabs_only_for_leading_indentations ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_WRAP_BEFORE_BINARY_OPERATOR , this . wrap_before_binary_operator ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_DISABLING_TAG , this . disabling_tag == null ? Util . EMPTY_STRING : new String ( this . disabling_tag ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_ENABLING_TAG , this . enabling_tag == null ? Util . EMPTY_STRING : new String ( this . enabling_tag ) ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_USE_ON_OFF_TAGS , this . use_tags ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; options . put ( DefaultCodeFormatterConstants . FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED , this . wrap_outer_expressions_when_nested ? DefaultCodeFormatterConstants . TRUE : DefaultCodeFormatterConstants . FALSE ) ; return options ; } public void set ( Map settings ) { final Object alignmentForArgumentsInAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION ) ; if ( alignmentForArgumentsInAllocationExpressionOption != null ) { try { this . alignment_for_arguments_in_allocation_expression = Integer . parseInt ( ( String ) alignmentForArgumentsInAllocationExpressionOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_arguments_in_allocation_expression = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_arguments_in_allocation_expression = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForArgumentsInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ANNOTATION ) ; if ( alignmentForArgumentsInAnnotationOption != null ) { try { this . alignment_for_arguments_in_annotation = Integer . parseInt ( ( String ) alignmentForArgumentsInAnnotationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_arguments_in_annotation = Alignment . M_NO_ALIGNMENT ; } catch ( ClassCastException e ) { this . alignment_for_arguments_in_annotation = Alignment . M_NO_ALIGNMENT ; } } final Object alignmentForArgumentsInEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT ) ; if ( alignmentForArgumentsInEnumConstantOption != null ) { try { this . alignment_for_arguments_in_enum_constant = Integer . parseInt ( ( String ) alignmentForArgumentsInEnumConstantOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_arguments_in_enum_constant = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_arguments_in_enum_constant = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForArgumentsInExplicitConstructorCallOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL ) ; if ( alignmentForArgumentsInExplicitConstructorCallOption != null ) { try { this . alignment_for_arguments_in_explicit_constructor_call = Integer . parseInt ( ( String ) alignmentForArgumentsInExplicitConstructorCallOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_arguments_in_explicit_constructor_call = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_arguments_in_explicit_constructor_call = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForArgumentsInMethodInvocationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION ) ; if ( alignmentForArgumentsInMethodInvocationOption != null ) { try { this . alignment_for_arguments_in_method_invocation = Integer . parseInt ( ( String ) alignmentForArgumentsInMethodInvocationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_arguments_in_method_invocation = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_arguments_in_method_invocation = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForArgumentsInQualifiedAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION ) ; if ( alignmentForArgumentsInQualifiedAllocationExpressionOption != null ) { try { this . alignment_for_arguments_in_qualified_allocation_expression = Integer . parseInt ( ( String ) alignmentForArgumentsInQualifiedAllocationExpressionOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_arguments_in_qualified_allocation_expression = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_arguments_in_qualified_allocation_expression = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForAssignmentOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ASSIGNMENT ) ; if ( alignmentForAssignmentOption != null ) { try { this . alignment_for_assignment = Integer . parseInt ( ( String ) alignmentForAssignmentOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_assignment = Alignment . M_ONE_PER_LINE_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_assignment = Alignment . M_ONE_PER_LINE_SPLIT ; } } final Object alignmentForBinaryExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION ) ; if ( alignmentForBinaryExpressionOption != null ) { try { this . alignment_for_binary_expression = Integer . parseInt ( ( String ) alignmentForBinaryExpressionOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_binary_expression = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_binary_expression = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForCompactIfOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_COMPACT_IF ) ; if ( alignmentForCompactIfOption != null ) { try { this . alignment_for_compact_if = Integer . parseInt ( ( String ) alignmentForCompactIfOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_compact_if = Alignment . M_ONE_PER_LINE_SPLIT | Alignment . M_INDENT_BY_ONE ; } catch ( ClassCastException e ) { this . alignment_for_compact_if = Alignment . M_ONE_PER_LINE_SPLIT | Alignment . M_INDENT_BY_ONE ; } } final Object alignmentForConditionalExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION ) ; if ( alignmentForConditionalExpressionOption != null ) { try { this . alignment_for_conditional_expression = Integer . parseInt ( ( String ) alignmentForConditionalExpressionOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_conditional_expression = Alignment . M_ONE_PER_LINE_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_conditional_expression = Alignment . M_ONE_PER_LINE_SPLIT ; } } final Object alignmentForEnumConstantsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS ) ; if ( alignmentForEnumConstantsOption != null ) { try { this . alignment_for_enum_constants = Integer . parseInt ( ( String ) alignmentForEnumConstantsOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_enum_constants = Alignment . NONE ; } catch ( ClassCastException e ) { this . alignment_for_enum_constants = Alignment . NONE ; } } final Object alignmentForExpressionsInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER ) ; if ( alignmentForExpressionsInArrayInitializerOption != null ) { try { this . alignment_for_expressions_in_array_initializer = Integer . parseInt ( ( String ) alignmentForExpressionsInArrayInitializerOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_expressions_in_array_initializer = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_expressions_in_array_initializer = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_METHOD_DECLARATION ) ; if ( alignmentForMethodDeclarationOption != null ) { try { this . alignment_for_method_declaration = Integer . parseInt ( ( String ) alignmentForMethodDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_method_declaration = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_method_declaration = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForMultipleFieldsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS ) ; if ( alignmentForMultipleFieldsOption != null ) { try { this . alignment_for_multiple_fields = Integer . parseInt ( ( String ) alignmentForMultipleFieldsOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_multiple_fields = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_multiple_fields = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForParametersInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION ) ; if ( alignmentForParametersInConstructorDeclarationOption != null ) { try { this . alignment_for_parameters_in_constructor_declaration = Integer . parseInt ( ( String ) alignmentForParametersInConstructorDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_parameters_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_parameters_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForParametersInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION ) ; if ( alignmentForParametersInMethodDeclarationOption != null ) { try { this . alignment_for_parameters_in_method_declaration = Integer . parseInt ( ( String ) alignmentForParametersInMethodDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_parameters_in_method_declaration = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_parameters_in_method_declaration = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForSelectorInMethodInvocationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION ) ; if ( alignmentForSelectorInMethodInvocationOption != null ) { try { this . alignment_for_selector_in_method_invocation = Integer . parseInt ( ( String ) alignmentForSelectorInMethodInvocationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_selector_in_method_invocation = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_selector_in_method_invocation = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForSuperclassInTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION ) ; if ( alignmentForSuperclassInTypeDeclarationOption != null ) { try { this . alignment_for_superclass_in_type_declaration = Integer . parseInt ( ( String ) alignmentForSuperclassInTypeDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_superclass_in_type_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_superclass_in_type_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; } } final Object alignmentForSuperinterfacesInEnumDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION ) ; if ( alignmentForSuperinterfacesInEnumDeclarationOption != null ) { try { this . alignment_for_superinterfaces_in_enum_declaration = Integer . parseInt ( ( String ) alignmentForSuperinterfacesInEnumDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_superinterfaces_in_enum_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_superinterfaces_in_enum_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; } } final Object alignmentForSuperinterfacesInTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION ) ; if ( alignmentForSuperinterfacesInTypeDeclarationOption != null ) { try { this . alignment_for_superinterfaces_in_type_declaration = Integer . parseInt ( ( String ) alignmentForSuperinterfacesInTypeDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_superinterfaces_in_type_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_superinterfaces_in_type_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; } } final Object alignmentForThrowsClauseInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION ) ; if ( alignmentForThrowsClauseInConstructorDeclarationOption != null ) { try { this . alignment_for_throws_clause_in_constructor_declaration = Integer . parseInt ( ( String ) alignmentForThrowsClauseInConstructorDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_throws_clause_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_throws_clause_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; } } final Object alignmentForThrowsClauseInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION ) ; if ( alignmentForThrowsClauseInMethodDeclarationOption != null ) { try { this . alignment_for_throws_clause_in_method_declaration = Integer . parseInt ( ( String ) alignmentForThrowsClauseInMethodDeclarationOption ) ; } catch ( NumberFormatException e ) { this . alignment_for_throws_clause_in_method_declaration = Alignment . M_COMPACT_SPLIT ; } catch ( ClassCastException e ) { this . alignment_for_throws_clause_in_method_declaration = Alignment . M_COMPACT_SPLIT ; } } final Object alignTypeMembersOnColumnsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS ) ; if ( alignTypeMembersOnColumnsOption != null ) { this . align_type_members_on_columns = DefaultCodeFormatterConstants . TRUE . equals ( alignTypeMembersOnColumnsOption ) ; } final Object bracePositionForAnnotationTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ANNOTATION_TYPE_DECLARATION ) ; if ( bracePositionForAnnotationTypeDeclarationOption != null ) { try { this . brace_position_for_annotation_type_declaration = ( String ) bracePositionForAnnotationTypeDeclarationOption ; } catch ( ClassCastException e ) { this . brace_position_for_annotation_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForAnonymousTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION ) ; if ( bracePositionForAnonymousTypeDeclarationOption != null ) { try { this . brace_position_for_anonymous_type_declaration = ( String ) bracePositionForAnonymousTypeDeclarationOption ; } catch ( ClassCastException e ) { this . brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER ) ; if ( bracePositionForArrayInitializerOption != null ) { try { this . brace_position_for_array_initializer = ( String ) bracePositionForArrayInitializerOption ; } catch ( ClassCastException e ) { this . brace_position_for_array_initializer = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForBlockOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_BLOCK ) ; if ( bracePositionForBlockOption != null ) { try { this . brace_position_for_block = ( String ) bracePositionForBlockOption ; } catch ( ClassCastException e ) { this . brace_position_for_block = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForBlockInCaseOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE ) ; if ( bracePositionForBlockInCaseOption != null ) { try { this . brace_position_for_block_in_case = ( String ) bracePositionForBlockInCaseOption ; } catch ( ClassCastException e ) { this . brace_position_for_block_in_case = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION ) ; if ( bracePositionForConstructorDeclarationOption != null ) { try { this . brace_position_for_constructor_declaration = ( String ) bracePositionForConstructorDeclarationOption ; } catch ( ClassCastException e ) { this . brace_position_for_constructor_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT ) ; if ( bracePositionForEnumConstantOption != null ) { try { this . brace_position_for_enum_constant = ( String ) bracePositionForEnumConstantOption ; } catch ( ClassCastException e ) { this . brace_position_for_enum_constant = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForEnumDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION ) ; if ( bracePositionForEnumDeclarationOption != null ) { try { this . brace_position_for_enum_declaration = ( String ) bracePositionForEnumDeclarationOption ; } catch ( ClassCastException e ) { this . brace_position_for_enum_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION ) ; if ( bracePositionForMethodDeclarationOption != null ) { try { this . brace_position_for_method_declaration = ( String ) bracePositionForMethodDeclarationOption ; } catch ( ClassCastException e ) { this . brace_position_for_method_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForSwitchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_SWITCH ) ; if ( bracePositionForSwitchOption != null ) { try { this . brace_position_for_switch = ( String ) bracePositionForSwitchOption ; } catch ( ClassCastException e ) { this . brace_position_for_switch = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object bracePositionForTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION ) ; if ( bracePositionForTypeDeclarationOption != null ) { try { this . brace_position_for_type_declaration = ( String ) bracePositionForTypeDeclarationOption ; } catch ( ClassCastException e ) { this . brace_position_for_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; } } final Object continuationIndentationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_CONTINUATION_INDENTATION ) ; if ( continuationIndentationOption != null ) { try { this . continuation_indentation = Integer . parseInt ( ( String ) continuationIndentationOption ) ; } catch ( NumberFormatException e ) { this . continuation_indentation = <NUM_LIT:2> ; } catch ( ClassCastException e ) { this . continuation_indentation = <NUM_LIT:2> ; } } final Object continuationIndentationForArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER ) ; if ( continuationIndentationForArrayInitializerOption != null ) { try { this . continuation_indentation_for_array_initializer = Integer . parseInt ( ( String ) continuationIndentationForArrayInitializerOption ) ; } catch ( NumberFormatException e ) { this . continuation_indentation_for_array_initializer = <NUM_LIT:2> ; } catch ( ClassCastException e ) { this . continuation_indentation_for_array_initializer = <NUM_LIT:2> ; } } final Object blankLinesAfterImportsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_AFTER_IMPORTS ) ; if ( blankLinesAfterImportsOption != null ) { try { this . blank_lines_after_imports = Integer . parseInt ( ( String ) blankLinesAfterImportsOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_after_imports = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_after_imports = <NUM_LIT:0> ; } } final Object blankLinesAfterPackageOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_AFTER_PACKAGE ) ; if ( blankLinesAfterPackageOption != null ) { try { this . blank_lines_after_package = Integer . parseInt ( ( String ) blankLinesAfterPackageOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_after_package = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_after_package = <NUM_LIT:0> ; } } final Object blankLinesBeforeFieldOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_FIELD ) ; if ( blankLinesBeforeFieldOption != null ) { try { this . blank_lines_before_field = Integer . parseInt ( ( String ) blankLinesBeforeFieldOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_field = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_field = <NUM_LIT:0> ; } } final Object blankLinesBeforeFirstClassBodyDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION ) ; if ( blankLinesBeforeFirstClassBodyDeclarationOption != null ) { try { this . blank_lines_before_first_class_body_declaration = Integer . parseInt ( ( String ) blankLinesBeforeFirstClassBodyDeclarationOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_first_class_body_declaration = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_first_class_body_declaration = <NUM_LIT:0> ; } } final Object blankLinesBeforeImportsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_IMPORTS ) ; if ( blankLinesBeforeImportsOption != null ) { try { this . blank_lines_before_imports = Integer . parseInt ( ( String ) blankLinesBeforeImportsOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_imports = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_imports = <NUM_LIT:0> ; } } final Object blankLinesBeforeMemberTypeOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE ) ; if ( blankLinesBeforeMemberTypeOption != null ) { try { this . blank_lines_before_member_type = Integer . parseInt ( ( String ) blankLinesBeforeMemberTypeOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_member_type = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_member_type = <NUM_LIT:0> ; } } final Object blankLinesBeforeMethodOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_METHOD ) ; if ( blankLinesBeforeMethodOption != null ) { try { this . blank_lines_before_method = Integer . parseInt ( ( String ) blankLinesBeforeMethodOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_method = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_method = <NUM_LIT:0> ; } } final Object blankLinesBeforeNewChunkOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK ) ; if ( blankLinesBeforeNewChunkOption != null ) { try { this . blank_lines_before_new_chunk = Integer . parseInt ( ( String ) blankLinesBeforeNewChunkOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_new_chunk = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_new_chunk = <NUM_LIT:0> ; } } final Object blankLinesBeforePackageOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BEFORE_PACKAGE ) ; if ( blankLinesBeforePackageOption != null ) { try { this . blank_lines_before_package = Integer . parseInt ( ( String ) blankLinesBeforePackageOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_before_package = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_before_package = <NUM_LIT:0> ; } } final Object blankLinesBetweenImportGroupsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS ) ; if ( blankLinesBetweenImportGroupsOption != null ) { try { this . blank_lines_between_import_groups = Integer . parseInt ( ( String ) blankLinesBetweenImportGroupsOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_between_import_groups = <NUM_LIT:1> ; } catch ( ClassCastException e ) { this . blank_lines_between_import_groups = <NUM_LIT:1> ; } } final Object blankLinesBetweenTypeDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS ) ; if ( blankLinesBetweenTypeDeclarationsOption != null ) { try { this . blank_lines_between_type_declarations = Integer . parseInt ( ( String ) blankLinesBetweenTypeDeclarationsOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_between_type_declarations = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_between_type_declarations = <NUM_LIT:0> ; } } final Object blankLinesAtBeginningOfMethodBodyOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY ) ; if ( blankLinesAtBeginningOfMethodBodyOption != null ) { try { this . blank_lines_at_beginning_of_method_body = Integer . parseInt ( ( String ) blankLinesAtBeginningOfMethodBodyOption ) ; } catch ( NumberFormatException e ) { this . blank_lines_at_beginning_of_method_body = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . blank_lines_at_beginning_of_method_body = <NUM_LIT:0> ; } } setDeprecatedOptions ( settings ) ; final Object commentFormatJavadocCommentOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT ) ; if ( commentFormatJavadocCommentOption != null ) { this . comment_format_javadoc_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentFormatJavadocCommentOption ) ; } final Object commentFormatBlockCommentOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT ) ; if ( commentFormatBlockCommentOption != null ) { this . comment_format_block_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentFormatBlockCommentOption ) ; } final Object commentFormatLineCommentOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_LINE_COMMENT ) ; if ( commentFormatLineCommentOption != null ) { this . comment_format_line_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentFormatLineCommentOption ) ; } final Object formatLineCommentStartingOnFirstColumnOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN ) ; if ( formatLineCommentStartingOnFirstColumnOption != null ) { this . comment_format_line_comment_starting_on_first_column = DefaultCodeFormatterConstants . TRUE . equals ( formatLineCommentStartingOnFirstColumnOption ) ; } final Object commentFormatHeaderOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_HEADER ) ; if ( commentFormatHeaderOption != null ) { this . comment_format_header = DefaultCodeFormatterConstants . TRUE . equals ( commentFormatHeaderOption ) ; } final Object commentFormatHtmlOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_HTML ) ; if ( commentFormatHtmlOption != null ) { this . comment_format_html = DefaultCodeFormatterConstants . TRUE . equals ( commentFormatHtmlOption ) ; } final Object commentFormatSourceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_FORMAT_SOURCE ) ; if ( commentFormatSourceOption != null ) { this . comment_format_source = DefaultCodeFormatterConstants . TRUE . equals ( commentFormatSourceOption ) ; } final Object commentIndentParameterDescriptionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION ) ; if ( commentIndentParameterDescriptionOption != null ) { this . comment_indent_parameter_description = DefaultCodeFormatterConstants . TRUE . equals ( commentIndentParameterDescriptionOption ) ; } final Object commentIndentRootTagsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INDENT_ROOT_TAGS ) ; if ( commentIndentRootTagsOption != null ) { this . comment_indent_root_tags = DefaultCodeFormatterConstants . TRUE . equals ( commentIndentRootTagsOption ) ; } final Object commentInsertEmptyLineBeforeRootTagsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS ) ; if ( commentInsertEmptyLineBeforeRootTagsOption != null ) { this . comment_insert_empty_line_before_root_tags = JavaCore . INSERT . equals ( commentInsertEmptyLineBeforeRootTagsOption ) ; } final Object commentInsertNewLineForParameterOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER ) ; if ( commentInsertNewLineForParameterOption != null ) { this . comment_insert_new_line_for_parameter = JavaCore . INSERT . equals ( commentInsertNewLineForParameterOption ) ; } final Object commentLineLengthOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_LINE_LENGTH ) ; if ( commentLineLengthOption != null ) { try { this . comment_line_length = Integer . parseInt ( ( String ) commentLineLengthOption ) ; } catch ( NumberFormatException e ) { this . comment_line_length = <NUM_LIT> ; } catch ( ClassCastException e ) { this . comment_line_length = <NUM_LIT> ; } } final Object commentNewLinesAtBlockBoundariesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_NEW_LINES_AT_BLOCK_BOUNDARIES ) ; if ( commentNewLinesAtBlockBoundariesOption != null ) { this . comment_new_lines_at_block_boundaries = DefaultCodeFormatterConstants . TRUE . equals ( commentNewLinesAtBlockBoundariesOption ) ; } final Object commentNewLinesAtJavadocBoundariesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_NEW_LINES_AT_JAVADOC_BOUNDARIES ) ; if ( commentNewLinesAtJavadocBoundariesOption != null ) { this . comment_new_lines_at_javadoc_boundaries = DefaultCodeFormatterConstants . TRUE . equals ( commentNewLinesAtJavadocBoundariesOption ) ; } final Object indentStatementsCompareToBlockOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK ) ; if ( indentStatementsCompareToBlockOption != null ) { this . indent_statements_compare_to_block = DefaultCodeFormatterConstants . TRUE . equals ( indentStatementsCompareToBlockOption ) ; } final Object indentStatementsCompareToBodyOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY ) ; if ( indentStatementsCompareToBodyOption != null ) { this . indent_statements_compare_to_body = DefaultCodeFormatterConstants . TRUE . equals ( indentStatementsCompareToBodyOption ) ; } final Object indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER ) ; if ( indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption != null ) { this . indent_body_declarations_compare_to_annotation_declaration_header = DefaultCodeFormatterConstants . TRUE . equals ( indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption ) ; } final Object indentBodyDeclarationsCompareToEnumConstantHeaderOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER ) ; if ( indentBodyDeclarationsCompareToEnumConstantHeaderOption != null ) { this . indent_body_declarations_compare_to_enum_constant_header = DefaultCodeFormatterConstants . TRUE . equals ( indentBodyDeclarationsCompareToEnumConstantHeaderOption ) ; } final Object indentBodyDeclarationsCompareToEnumDeclarationHeaderOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER ) ; if ( indentBodyDeclarationsCompareToEnumDeclarationHeaderOption != null ) { this . indent_body_declarations_compare_to_enum_declaration_header = DefaultCodeFormatterConstants . TRUE . equals ( indentBodyDeclarationsCompareToEnumDeclarationHeaderOption ) ; } final Object indentBodyDeclarationsCompareToTypeHeaderOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER ) ; if ( indentBodyDeclarationsCompareToTypeHeaderOption != null ) { this . indent_body_declarations_compare_to_type_header = DefaultCodeFormatterConstants . TRUE . equals ( indentBodyDeclarationsCompareToTypeHeaderOption ) ; } final Object indentBreaksCompareToCasesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES ) ; if ( indentBreaksCompareToCasesOption != null ) { this . indent_breaks_compare_to_cases = DefaultCodeFormatterConstants . TRUE . equals ( indentBreaksCompareToCasesOption ) ; } final Object indentEmptyLinesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_EMPTY_LINES ) ; if ( indentEmptyLinesOption != null ) { this . indent_empty_lines = DefaultCodeFormatterConstants . TRUE . equals ( indentEmptyLinesOption ) ; } final Object indentSwitchstatementsCompareToCasesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES ) ; if ( indentSwitchstatementsCompareToCasesOption != null ) { this . indent_switchstatements_compare_to_cases = DefaultCodeFormatterConstants . TRUE . equals ( indentSwitchstatementsCompareToCasesOption ) ; } final Object indentSwitchstatementsCompareToSwitchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH ) ; if ( indentSwitchstatementsCompareToSwitchOption != null ) { this . indent_switchstatements_compare_to_switch = DefaultCodeFormatterConstants . TRUE . equals ( indentSwitchstatementsCompareToSwitchOption ) ; } final Object indentationSizeOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INDENTATION_SIZE ) ; if ( indentationSizeOption != null ) { try { this . indentation_size = Integer . parseInt ( ( String ) indentationSizeOption ) ; } catch ( NumberFormatException e ) { this . indentation_size = <NUM_LIT:4> ; } catch ( ClassCastException e ) { this . indentation_size = <NUM_LIT:4> ; } } final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER ) ; if ( insertNewLineAfterOpeningBraceInArrayInitializerOption != null ) { this . insert_new_line_after_opening_brace_in_array_initializer = JavaCore . INSERT . equals ( insertNewLineAfterOpeningBraceInArrayInitializerOption ) ; } final Object insertNewLineAtEndOfFileIfMissingOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING ) ; if ( insertNewLineAtEndOfFileIfMissingOption != null ) { this . insert_new_line_at_end_of_file_if_missing = JavaCore . INSERT . equals ( insertNewLineAtEndOfFileIfMissingOption ) ; } final Object insertNewLineBeforeCatchInTryStatementOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT ) ; if ( insertNewLineBeforeCatchInTryStatementOption != null ) { this . insert_new_line_before_catch_in_try_statement = JavaCore . INSERT . equals ( insertNewLineBeforeCatchInTryStatementOption ) ; } final Object insertNewLineBeforeClosingBraceInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER ) ; if ( insertNewLineBeforeClosingBraceInArrayInitializerOption != null ) { this . insert_new_line_before_closing_brace_in_array_initializer = JavaCore . INSERT . equals ( insertNewLineBeforeClosingBraceInArrayInitializerOption ) ; } final Object insertNewLineBeforeElseInIfStatementOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT ) ; if ( insertNewLineBeforeElseInIfStatementOption != null ) { this . insert_new_line_before_else_in_if_statement = JavaCore . INSERT . equals ( insertNewLineBeforeElseInIfStatementOption ) ; } final Object insertNewLineBeforeFinallyInTryStatementOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT ) ; if ( insertNewLineBeforeFinallyInTryStatementOption != null ) { this . insert_new_line_before_finally_in_try_statement = JavaCore . INSERT . equals ( insertNewLineBeforeFinallyInTryStatementOption ) ; } final Object insertNewLineBeforeWhileInDoStatementOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT ) ; if ( insertNewLineBeforeWhileInDoStatementOption != null ) { this . insert_new_line_before_while_in_do_statement = JavaCore . INSERT . equals ( insertNewLineBeforeWhileInDoStatementOption ) ; } final Object insertNewLineInEmptyAnonymousTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION ) ; if ( insertNewLineInEmptyAnonymousTypeDeclarationOption != null ) { this . insert_new_line_in_empty_anonymous_type_declaration = JavaCore . INSERT . equals ( insertNewLineInEmptyAnonymousTypeDeclarationOption ) ; } final Object insertNewLineInEmptyBlockOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK ) ; if ( insertNewLineInEmptyBlockOption != null ) { this . insert_new_line_in_empty_block = JavaCore . INSERT . equals ( insertNewLineInEmptyBlockOption ) ; } final Object insertNewLineInEmptyAnnotationDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION ) ; if ( insertNewLineInEmptyAnnotationDeclarationOption != null ) { this . insert_new_line_in_empty_annotation_declaration = JavaCore . INSERT . equals ( insertNewLineInEmptyAnnotationDeclarationOption ) ; } final Object insertNewLineInEmptyEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT ) ; if ( insertNewLineInEmptyEnumConstantOption != null ) { this . insert_new_line_in_empty_enum_constant = JavaCore . INSERT . equals ( insertNewLineInEmptyEnumConstantOption ) ; } final Object insertNewLineInEmptyEnumDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION ) ; if ( insertNewLineInEmptyEnumDeclarationOption != null ) { this . insert_new_line_in_empty_enum_declaration = JavaCore . INSERT . equals ( insertNewLineInEmptyEnumDeclarationOption ) ; } final Object insertNewLineInEmptyMethodBodyOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY ) ; if ( insertNewLineInEmptyMethodBodyOption != null ) { this . insert_new_line_in_empty_method_body = JavaCore . INSERT . equals ( insertNewLineInEmptyMethodBodyOption ) ; } final Object insertNewLineInEmptyTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION ) ; if ( insertNewLineInEmptyTypeDeclarationOption != null ) { this . insert_new_line_in_empty_type_declaration = JavaCore . INSERT . equals ( insertNewLineInEmptyTypeDeclarationOption ) ; } final Object insertNewLineAfterLabelOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_LABEL ) ; if ( insertNewLineAfterLabelOption != null ) { this . insert_new_line_after_label = JavaCore . INSERT . equals ( insertNewLineAfterLabelOption ) ; } final Object insertSpaceAfterAndInWildcardOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER ) ; if ( insertSpaceAfterAndInWildcardOption != null ) { this . insert_space_after_and_in_type_parameter = JavaCore . INSERT . equals ( insertSpaceAfterAndInWildcardOption ) ; } final Object insertSpaceAfterAssignmentOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR ) ; if ( insertSpaceAfterAssignmentOperatorOption != null ) { this . insert_space_after_assignment_operator = JavaCore . INSERT . equals ( insertSpaceAfterAssignmentOperatorOption ) ; } final Object insertSpaceAfterAtInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION ) ; if ( insertSpaceAfterAtInAnnotationOption != null ) { this . insert_space_after_at_in_annotation = JavaCore . INSERT . equals ( insertSpaceAfterAtInAnnotationOption ) ; } final Object insertSpaceAfterAtInAnnotationTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION ) ; if ( insertSpaceAfterAtInAnnotationTypeDeclarationOption != null ) { this . insert_space_after_at_in_annotation_type_declaration = JavaCore . INSERT . equals ( insertSpaceAfterAtInAnnotationTypeDeclarationOption ) ; } final Object insertSpaceAfterBinaryOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR ) ; if ( insertSpaceAfterBinaryOperatorOption != null ) { this . insert_space_after_binary_operator = JavaCore . INSERT . equals ( insertSpaceAfterBinaryOperatorOption ) ; } final Object insertSpaceAfterClosingAngleBracketInTypeArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS ) ; if ( insertSpaceAfterClosingAngleBracketInTypeArgumentsOption != null ) { this . insert_space_after_closing_angle_bracket_in_type_arguments = JavaCore . INSERT . equals ( insertSpaceAfterClosingAngleBracketInTypeArgumentsOption ) ; } final Object insertSpaceAfterClosingAngleBracketInTypeParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS ) ; if ( insertSpaceAfterClosingAngleBracketInTypeParametersOption != null ) { this . insert_space_after_closing_angle_bracket_in_type_parameters = JavaCore . INSERT . equals ( insertSpaceAfterClosingAngleBracketInTypeParametersOption ) ; } final Object insertSpaceAfterClosingParenInCastOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST ) ; if ( insertSpaceAfterClosingParenInCastOption != null ) { this . insert_space_after_closing_paren_in_cast = JavaCore . INSERT . equals ( insertSpaceAfterClosingParenInCastOption ) ; } final Object insertSpaceAfterClosingBraceInBlockOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK ) ; if ( insertSpaceAfterClosingBraceInBlockOption != null ) { this . insert_space_after_closing_brace_in_block = JavaCore . INSERT . equals ( insertSpaceAfterClosingBraceInBlockOption ) ; } final Object insertSpaceAfterColonInAssertOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT ) ; if ( insertSpaceAfterColonInAssertOption != null ) { this . insert_space_after_colon_in_assert = JavaCore . INSERT . equals ( insertSpaceAfterColonInAssertOption ) ; } final Object insertSpaceAfterColonInCaseOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE ) ; if ( insertSpaceAfterColonInCaseOption != null ) { this . insert_space_after_colon_in_case = JavaCore . INSERT . equals ( insertSpaceAfterColonInCaseOption ) ; } final Object insertSpaceAfterColonInConditionalOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL ) ; if ( insertSpaceAfterColonInConditionalOption != null ) { this . insert_space_after_colon_in_conditional = JavaCore . INSERT . equals ( insertSpaceAfterColonInConditionalOption ) ; } final Object insertSpaceAfterColonInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR ) ; if ( insertSpaceAfterColonInForOption != null ) { this . insert_space_after_colon_in_for = JavaCore . INSERT . equals ( insertSpaceAfterColonInForOption ) ; } final Object insertSpaceAfterColonInLabeledStatementOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT ) ; if ( insertSpaceAfterColonInLabeledStatementOption != null ) { this . insert_space_after_colon_in_labeled_statement = JavaCore . INSERT . equals ( insertSpaceAfterColonInLabeledStatementOption ) ; } final Object insertSpaceAfterCommaInAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION ) ; if ( insertSpaceAfterCommaInAllocationExpressionOption != null ) { this . insert_space_after_comma_in_allocation_expression = JavaCore . INSERT . equals ( insertSpaceAfterCommaInAllocationExpressionOption ) ; } final Object insertSpaceAfterCommaInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION ) ; if ( insertSpaceAfterCommaInAnnotationOption != null ) { this . insert_space_after_comma_in_annotation = JavaCore . INSERT . equals ( insertSpaceAfterCommaInAnnotationOption ) ; } final Object insertSpaceAfterCommaInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER ) ; if ( insertSpaceAfterCommaInArrayInitializerOption != null ) { this . insert_space_after_comma_in_array_initializer = JavaCore . INSERT . equals ( insertSpaceAfterCommaInArrayInitializerOption ) ; } final Object insertSpaceAfterCommaInConstructorDeclarationParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS ) ; if ( insertSpaceAfterCommaInConstructorDeclarationParametersOption != null ) { this . insert_space_after_comma_in_constructor_declaration_parameters = JavaCore . INSERT . equals ( insertSpaceAfterCommaInConstructorDeclarationParametersOption ) ; } final Object insertSpaceAfterCommaInConstructorDeclarationThrowsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS ) ; if ( insertSpaceAfterCommaInConstructorDeclarationThrowsOption != null ) { this . insert_space_after_comma_in_constructor_declaration_throws = JavaCore . INSERT . equals ( insertSpaceAfterCommaInConstructorDeclarationThrowsOption ) ; } final Object insertSpaceAfterCommaInEnumConstantArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS ) ; if ( insertSpaceAfterCommaInEnumConstantArgumentsOption != null ) { this . insert_space_after_comma_in_enum_constant_arguments = JavaCore . INSERT . equals ( insertSpaceAfterCommaInEnumConstantArgumentsOption ) ; } final Object insertSpaceAfterCommaInEnumDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS ) ; if ( insertSpaceAfterCommaInEnumDeclarationsOption != null ) { this . insert_space_after_comma_in_enum_declarations = JavaCore . INSERT . equals ( insertSpaceAfterCommaInEnumDeclarationsOption ) ; } final Object insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS ) ; if ( insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption != null ) { this . insert_space_after_comma_in_explicit_constructor_call_arguments = JavaCore . INSERT . equals ( insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption ) ; } final Object insertSpaceAfterCommaInForIncrementsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS ) ; if ( insertSpaceAfterCommaInForIncrementsOption != null ) { this . insert_space_after_comma_in_for_increments = JavaCore . INSERT . equals ( insertSpaceAfterCommaInForIncrementsOption ) ; } final Object insertSpaceAfterCommaInForInitsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS ) ; if ( insertSpaceAfterCommaInForInitsOption != null ) { this . insert_space_after_comma_in_for_inits = JavaCore . INSERT . equals ( insertSpaceAfterCommaInForInitsOption ) ; } final Object insertSpaceAfterCommaInMethodInvocationArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS ) ; if ( insertSpaceAfterCommaInMethodInvocationArgumentsOption != null ) { this . insert_space_after_comma_in_method_invocation_arguments = JavaCore . INSERT . equals ( insertSpaceAfterCommaInMethodInvocationArgumentsOption ) ; } final Object insertSpaceAfterCommaInMethodDeclarationParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS ) ; if ( insertSpaceAfterCommaInMethodDeclarationParametersOption != null ) { this . insert_space_after_comma_in_method_declaration_parameters = JavaCore . INSERT . equals ( insertSpaceAfterCommaInMethodDeclarationParametersOption ) ; } final Object insertSpaceAfterCommaInMethodDeclarationThrowsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS ) ; if ( insertSpaceAfterCommaInMethodDeclarationThrowsOption != null ) { this . insert_space_after_comma_in_method_declaration_throws = JavaCore . INSERT . equals ( insertSpaceAfterCommaInMethodDeclarationThrowsOption ) ; } final Object insertSpaceAfterCommaInMultipleFieldDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS ) ; if ( insertSpaceAfterCommaInMultipleFieldDeclarationsOption != null ) { this . insert_space_after_comma_in_multiple_field_declarations = JavaCore . INSERT . equals ( insertSpaceAfterCommaInMultipleFieldDeclarationsOption ) ; } final Object insertSpaceAfterCommaInMultipleLocalDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS ) ; if ( insertSpaceAfterCommaInMultipleLocalDeclarationsOption != null ) { this . insert_space_after_comma_in_multiple_local_declarations = JavaCore . INSERT . equals ( insertSpaceAfterCommaInMultipleLocalDeclarationsOption ) ; } final Object insertSpaceAfterCommaInParameterizedTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE ) ; if ( insertSpaceAfterCommaInParameterizedTypeReferenceOption != null ) { this . insert_space_after_comma_in_parameterized_type_reference = JavaCore . INSERT . equals ( insertSpaceAfterCommaInParameterizedTypeReferenceOption ) ; } final Object insertSpaceAfterCommaInSuperinterfacesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES ) ; if ( insertSpaceAfterCommaInSuperinterfacesOption != null ) { this . insert_space_after_comma_in_superinterfaces = JavaCore . INSERT . equals ( insertSpaceAfterCommaInSuperinterfacesOption ) ; } final Object insertSpaceAfterCommaInTypeArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS ) ; if ( insertSpaceAfterCommaInTypeArgumentsOption != null ) { this . insert_space_after_comma_in_type_arguments = JavaCore . INSERT . equals ( insertSpaceAfterCommaInTypeArgumentsOption ) ; } final Object insertSpaceAfterCommaInTypeParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS ) ; if ( insertSpaceAfterCommaInTypeParametersOption != null ) { this . insert_space_after_comma_in_type_parameters = JavaCore . INSERT . equals ( insertSpaceAfterCommaInTypeParametersOption ) ; } final Object insertSpaceAfterEllipsisOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS ) ; if ( insertSpaceAfterEllipsisOption != null ) { this . insert_space_after_ellipsis = JavaCore . INSERT . equals ( insertSpaceAfterEllipsisOption ) ; } final Object insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE ) ; if ( insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption != null ) { this . insert_space_after_opening_angle_bracket_in_parameterized_type_reference = JavaCore . INSERT . equals ( insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption ) ; } final Object insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS ) ; if ( insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption != null ) { this . insert_space_after_opening_angle_bracket_in_type_arguments = JavaCore . INSERT . equals ( insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption ) ; } final Object insertSpaceAfterOpeningAngleBracketInTypeParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS ) ; if ( insertSpaceAfterOpeningAngleBracketInTypeParametersOption != null ) { this . insert_space_after_opening_angle_bracket_in_type_parameters = JavaCore . INSERT . equals ( insertSpaceAfterOpeningAngleBracketInTypeParametersOption ) ; } final Object insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION ) ; if ( insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption != null ) { this . insert_space_after_opening_bracket_in_array_allocation_expression = JavaCore . INSERT . equals ( insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption ) ; } final Object insertSpaceAfterOpeningBracketInArrayReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE ) ; if ( insertSpaceAfterOpeningBracketInArrayReferenceOption != null ) { this . insert_space_after_opening_bracket_in_array_reference = JavaCore . INSERT . equals ( insertSpaceAfterOpeningBracketInArrayReferenceOption ) ; } final Object insertSpaceAfterOpeningBraceInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER ) ; if ( insertSpaceAfterOpeningBraceInArrayInitializerOption != null ) { this . insert_space_after_opening_brace_in_array_initializer = JavaCore . INSERT . equals ( insertSpaceAfterOpeningBraceInArrayInitializerOption ) ; } final Object insertSpaceAfterOpeningParenInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION ) ; if ( insertSpaceAfterOpeningParenInAnnotationOption != null ) { this . insert_space_after_opening_paren_in_annotation = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInAnnotationOption ) ; } final Object insertSpaceAfterOpeningParenInCastOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST ) ; if ( insertSpaceAfterOpeningParenInCastOption != null ) { this . insert_space_after_opening_paren_in_cast = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInCastOption ) ; } final Object insertSpaceAfterOpeningParenInCatchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH ) ; if ( insertSpaceAfterOpeningParenInCatchOption != null ) { this . insert_space_after_opening_paren_in_catch = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInCatchOption ) ; } final Object insertSpaceAfterOpeningParenInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION ) ; if ( insertSpaceAfterOpeningParenInConstructorDeclarationOption != null ) { this . insert_space_after_opening_paren_in_constructor_declaration = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInConstructorDeclarationOption ) ; } final Object insertSpaceAfterOpeningParenInEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT ) ; if ( insertSpaceAfterOpeningParenInEnumConstantOption != null ) { this . insert_space_after_opening_paren_in_enum_constant = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInEnumConstantOption ) ; } final Object insertSpaceAfterOpeningParenInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR ) ; if ( insertSpaceAfterOpeningParenInForOption != null ) { this . insert_space_after_opening_paren_in_for = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInForOption ) ; } final Object insertSpaceAfterOpeningParenInIfOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF ) ; if ( insertSpaceAfterOpeningParenInIfOption != null ) { this . insert_space_after_opening_paren_in_if = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInIfOption ) ; } final Object insertSpaceAfterOpeningParenInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION ) ; if ( insertSpaceAfterOpeningParenInMethodDeclarationOption != null ) { this . insert_space_after_opening_paren_in_method_declaration = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInMethodDeclarationOption ) ; } final Object insertSpaceAfterOpeningParenInMethodInvocationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION ) ; if ( insertSpaceAfterOpeningParenInMethodInvocationOption != null ) { this . insert_space_after_opening_paren_in_method_invocation = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInMethodInvocationOption ) ; } final Object insertSpaceAfterOpeningParenInParenthesizedExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION ) ; if ( insertSpaceAfterOpeningParenInParenthesizedExpressionOption != null ) { this . insert_space_after_opening_paren_in_parenthesized_expression = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInParenthesizedExpressionOption ) ; } final Object insertSpaceAfterOpeningParenInSwitchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH ) ; if ( insertSpaceAfterOpeningParenInSwitchOption != null ) { this . insert_space_after_opening_paren_in_switch = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInSwitchOption ) ; } final Object insertSpaceAfterOpeningParenInSynchronizedOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED ) ; if ( insertSpaceAfterOpeningParenInSynchronizedOption != null ) { this . insert_space_after_opening_paren_in_synchronized = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInSynchronizedOption ) ; } final Object insertSpaceAfterOpeningParenInWhileOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE ) ; if ( insertSpaceAfterOpeningParenInWhileOption != null ) { this . insert_space_after_opening_paren_in_while = JavaCore . INSERT . equals ( insertSpaceAfterOpeningParenInWhileOption ) ; } final Object insertSpaceAfterPostfixOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR ) ; if ( insertSpaceAfterPostfixOperatorOption != null ) { this . insert_space_after_postfix_operator = JavaCore . INSERT . equals ( insertSpaceAfterPostfixOperatorOption ) ; } final Object insertSpaceAfterPrefixOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR ) ; if ( insertSpaceAfterPrefixOperatorOption != null ) { this . insert_space_after_prefix_operator = JavaCore . INSERT . equals ( insertSpaceAfterPrefixOperatorOption ) ; } final Object insertSpaceAfterQuestionInConditionalOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL ) ; if ( insertSpaceAfterQuestionInConditionalOption != null ) { this . insert_space_after_question_in_conditional = JavaCore . INSERT . equals ( insertSpaceAfterQuestionInConditionalOption ) ; } final Object insertSpaceAfterQuestionInWildcardOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD ) ; if ( insertSpaceAfterQuestionInWildcardOption != null ) { this . insert_space_after_question_in_wilcard = JavaCore . INSERT . equals ( insertSpaceAfterQuestionInWildcardOption ) ; } final Object insertSpaceAfterSemicolonInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR ) ; if ( insertSpaceAfterSemicolonInForOption != null ) { this . insert_space_after_semicolon_in_for = JavaCore . INSERT . equals ( insertSpaceAfterSemicolonInForOption ) ; } final Object insertSpaceAfterUnaryOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR ) ; if ( insertSpaceAfterUnaryOperatorOption != null ) { this . insert_space_after_unary_operator = JavaCore . INSERT . equals ( insertSpaceAfterUnaryOperatorOption ) ; } final Object insertSpaceBeforeAndInWildcardOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER ) ; if ( insertSpaceBeforeAndInWildcardOption != null ) { this . insert_space_before_and_in_type_parameter = JavaCore . INSERT . equals ( insertSpaceBeforeAndInWildcardOption ) ; } final Object insertSpaceBeforeAtInAnnotationTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION ) ; if ( insertSpaceBeforeAtInAnnotationTypeDeclarationOption != null ) { this . insert_space_before_at_in_annotation_type_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeAtInAnnotationTypeDeclarationOption ) ; } final Object insertSpaceBeforeAssignmentOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR ) ; if ( insertSpaceBeforeAssignmentOperatorOption != null ) { this . insert_space_before_assignment_operator = JavaCore . INSERT . equals ( insertSpaceBeforeAssignmentOperatorOption ) ; } final Object insertSpaceBeforeBinaryOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR ) ; if ( insertSpaceBeforeBinaryOperatorOption != null ) { this . insert_space_before_binary_operator = JavaCore . INSERT . equals ( insertSpaceBeforeBinaryOperatorOption ) ; } final Object insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE ) ; if ( insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption != null ) { this . insert_space_before_closing_angle_bracket_in_parameterized_type_reference = JavaCore . INSERT . equals ( insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption ) ; } final Object insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS ) ; if ( insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption != null ) { this . insert_space_before_closing_angle_bracket_in_type_arguments = JavaCore . INSERT . equals ( insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption ) ; } final Object insertSpaceBeforeClosingAngleBracketInTypeParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS ) ; if ( insertSpaceBeforeClosingAngleBracketInTypeParametersOption != null ) { this . insert_space_before_closing_angle_bracket_in_type_parameters = JavaCore . INSERT . equals ( insertSpaceBeforeClosingAngleBracketInTypeParametersOption ) ; } final Object insertSpaceBeforeClosingBraceInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER ) ; if ( insertSpaceBeforeClosingBraceInArrayInitializerOption != null ) { this . insert_space_before_closing_brace_in_array_initializer = JavaCore . INSERT . equals ( insertSpaceBeforeClosingBraceInArrayInitializerOption ) ; } final Object insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION ) ; if ( insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption != null ) { this . insert_space_before_closing_bracket_in_array_allocation_expression = JavaCore . INSERT . equals ( insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption ) ; } final Object insertSpaceBeforeClosingBracketInArrayReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE ) ; if ( insertSpaceBeforeClosingBracketInArrayReferenceOption != null ) { this . insert_space_before_closing_bracket_in_array_reference = JavaCore . INSERT . equals ( insertSpaceBeforeClosingBracketInArrayReferenceOption ) ; } final Object insertSpaceBeforeClosingParenInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION ) ; if ( insertSpaceBeforeClosingParenInAnnotationOption != null ) { this . insert_space_before_closing_paren_in_annotation = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInAnnotationOption ) ; } final Object insertSpaceBeforeClosingParenInCastOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST ) ; if ( insertSpaceBeforeClosingParenInCastOption != null ) { this . insert_space_before_closing_paren_in_cast = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInCastOption ) ; } final Object insertSpaceBeforeClosingParenInCatchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH ) ; if ( insertSpaceBeforeClosingParenInCatchOption != null ) { this . insert_space_before_closing_paren_in_catch = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInCatchOption ) ; } final Object insertSpaceBeforeClosingParenInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION ) ; if ( insertSpaceBeforeClosingParenInConstructorDeclarationOption != null ) { this . insert_space_before_closing_paren_in_constructor_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInConstructorDeclarationOption ) ; } final Object insertSpaceBeforeClosingParenInEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT ) ; if ( insertSpaceBeforeClosingParenInEnumConstantOption != null ) { this . insert_space_before_closing_paren_in_enum_constant = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInEnumConstantOption ) ; } final Object insertSpaceBeforeClosingParenInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR ) ; if ( insertSpaceBeforeClosingParenInForOption != null ) { this . insert_space_before_closing_paren_in_for = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInForOption ) ; } final Object insertSpaceBeforeClosingParenInIfOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF ) ; if ( insertSpaceBeforeClosingParenInIfOption != null ) { this . insert_space_before_closing_paren_in_if = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInIfOption ) ; } final Object insertSpaceBeforeClosingParenInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION ) ; if ( insertSpaceBeforeClosingParenInMethodDeclarationOption != null ) { this . insert_space_before_closing_paren_in_method_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInMethodDeclarationOption ) ; } final Object insertSpaceBeforeClosingParenInMethodInvocationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION ) ; if ( insertSpaceBeforeClosingParenInMethodInvocationOption != null ) { this . insert_space_before_closing_paren_in_method_invocation = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInMethodInvocationOption ) ; } final Object insertSpaceBeforeClosingParenInParenthesizedExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION ) ; if ( insertSpaceBeforeClosingParenInParenthesizedExpressionOption != null ) { this . insert_space_before_closing_paren_in_parenthesized_expression = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInParenthesizedExpressionOption ) ; } final Object insertSpaceBeforeClosingParenInSwitchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH ) ; if ( insertSpaceBeforeClosingParenInSwitchOption != null ) { this . insert_space_before_closing_paren_in_switch = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInSwitchOption ) ; } final Object insertSpaceBeforeClosingParenInSynchronizedOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED ) ; if ( insertSpaceBeforeClosingParenInSynchronizedOption != null ) { this . insert_space_before_closing_paren_in_synchronized = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInSynchronizedOption ) ; } final Object insertSpaceBeforeClosingParenInWhileOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE ) ; if ( insertSpaceBeforeClosingParenInWhileOption != null ) { this . insert_space_before_closing_paren_in_while = JavaCore . INSERT . equals ( insertSpaceBeforeClosingParenInWhileOption ) ; } final Object insertSpaceBeforeColonInAssertOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT ) ; if ( insertSpaceBeforeColonInAssertOption != null ) { this . insert_space_before_colon_in_assert = JavaCore . INSERT . equals ( insertSpaceBeforeColonInAssertOption ) ; } final Object insertSpaceBeforeColonInCaseOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE ) ; if ( insertSpaceBeforeColonInCaseOption != null ) { this . insert_space_before_colon_in_case = JavaCore . INSERT . equals ( insertSpaceBeforeColonInCaseOption ) ; } final Object insertSpaceBeforeColonInConditionalOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL ) ; if ( insertSpaceBeforeColonInConditionalOption != null ) { this . insert_space_before_colon_in_conditional = JavaCore . INSERT . equals ( insertSpaceBeforeColonInConditionalOption ) ; } final Object insertSpaceBeforeColonInDefaultOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT ) ; if ( insertSpaceBeforeColonInDefaultOption != null ) { this . insert_space_before_colon_in_default = JavaCore . INSERT . equals ( insertSpaceBeforeColonInDefaultOption ) ; } final Object insertSpaceBeforeColonInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR ) ; if ( insertSpaceBeforeColonInForOption != null ) { this . insert_space_before_colon_in_for = JavaCore . INSERT . equals ( insertSpaceBeforeColonInForOption ) ; } final Object insertSpaceBeforeColonInLabeledStatementOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT ) ; if ( insertSpaceBeforeColonInLabeledStatementOption != null ) { this . insert_space_before_colon_in_labeled_statement = JavaCore . INSERT . equals ( insertSpaceBeforeColonInLabeledStatementOption ) ; } final Object insertSpaceBeforeCommaInAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION ) ; if ( insertSpaceBeforeCommaInAllocationExpressionOption != null ) { this . insert_space_before_comma_in_allocation_expression = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInAllocationExpressionOption ) ; } final Object insertSpaceBeforeCommaInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION ) ; if ( insertSpaceBeforeCommaInAnnotationOption != null ) { this . insert_space_before_comma_in_annotation = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInAnnotationOption ) ; } final Object insertSpaceBeforeCommaInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER ) ; if ( insertSpaceBeforeCommaInArrayInitializerOption != null ) { this . insert_space_before_comma_in_array_initializer = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInArrayInitializerOption ) ; } final Object insertSpaceBeforeCommaInConstructorDeclarationParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS ) ; if ( insertSpaceBeforeCommaInConstructorDeclarationParametersOption != null ) { this . insert_space_before_comma_in_constructor_declaration_parameters = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInConstructorDeclarationParametersOption ) ; } final Object insertSpaceBeforeCommaInConstructorDeclarationThrowsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS ) ; if ( insertSpaceBeforeCommaInConstructorDeclarationThrowsOption != null ) { this . insert_space_before_comma_in_constructor_declaration_throws = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInConstructorDeclarationThrowsOption ) ; } final Object insertSpaceBeforeCommaInEnumConstantArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS ) ; if ( insertSpaceBeforeCommaInEnumConstantArgumentsOption != null ) { this . insert_space_before_comma_in_enum_constant_arguments = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInEnumConstantArgumentsOption ) ; } final Object insertSpaceBeforeCommaInEnumDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS ) ; if ( insertSpaceBeforeCommaInEnumDeclarationsOption != null ) { this . insert_space_before_comma_in_enum_declarations = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInEnumDeclarationsOption ) ; } final Object insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS ) ; if ( insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption != null ) { this . insert_space_before_comma_in_explicit_constructor_call_arguments = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption ) ; } final Object insertSpaceBeforeCommaInForIncrementsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS ) ; if ( insertSpaceBeforeCommaInForIncrementsOption != null ) { this . insert_space_before_comma_in_for_increments = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInForIncrementsOption ) ; } final Object insertSpaceBeforeCommaInForInitsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS ) ; if ( insertSpaceBeforeCommaInForInitsOption != null ) { this . insert_space_before_comma_in_for_inits = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInForInitsOption ) ; } final Object insertSpaceBeforeCommaInMethodInvocationArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS ) ; if ( insertSpaceBeforeCommaInMethodInvocationArgumentsOption != null ) { this . insert_space_before_comma_in_method_invocation_arguments = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInMethodInvocationArgumentsOption ) ; } final Object insertSpaceBeforeCommaInMethodDeclarationParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS ) ; if ( insertSpaceBeforeCommaInMethodDeclarationParametersOption != null ) { this . insert_space_before_comma_in_method_declaration_parameters = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInMethodDeclarationParametersOption ) ; } final Object insertSpaceBeforeCommaInMethodDeclarationThrowsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS ) ; if ( insertSpaceBeforeCommaInMethodDeclarationThrowsOption != null ) { this . insert_space_before_comma_in_method_declaration_throws = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInMethodDeclarationThrowsOption ) ; } final Object insertSpaceBeforeCommaInMultipleFieldDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS ) ; if ( insertSpaceBeforeCommaInMultipleFieldDeclarationsOption != null ) { this . insert_space_before_comma_in_multiple_field_declarations = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInMultipleFieldDeclarationsOption ) ; } final Object insertSpaceBeforeCommaInMultipleLocalDeclarationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS ) ; if ( insertSpaceBeforeCommaInMultipleLocalDeclarationsOption != null ) { this . insert_space_before_comma_in_multiple_local_declarations = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInMultipleLocalDeclarationsOption ) ; } final Object insertSpaceBeforeCommaInParameterizedTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE ) ; if ( insertSpaceBeforeCommaInParameterizedTypeReferenceOption != null ) { this . insert_space_before_comma_in_parameterized_type_reference = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInParameterizedTypeReferenceOption ) ; } final Object insertSpaceBeforeCommaInSuperinterfacesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES ) ; if ( insertSpaceBeforeCommaInSuperinterfacesOption != null ) { this . insert_space_before_comma_in_superinterfaces = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInSuperinterfacesOption ) ; } final Object insertSpaceBeforeCommaInTypeArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS ) ; if ( insertSpaceBeforeCommaInTypeArgumentsOption != null ) { this . insert_space_before_comma_in_type_arguments = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInTypeArgumentsOption ) ; } final Object insertSpaceBeforeCommaInTypeParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS ) ; if ( insertSpaceBeforeCommaInTypeParametersOption != null ) { this . insert_space_before_comma_in_type_parameters = JavaCore . INSERT . equals ( insertSpaceBeforeCommaInTypeParametersOption ) ; } final Object insertSpaceBeforeEllipsisOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS ) ; if ( insertSpaceBeforeEllipsisOption != null ) { this . insert_space_before_ellipsis = JavaCore . INSERT . equals ( insertSpaceBeforeEllipsisOption ) ; } final Object insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE ) ; if ( insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption != null ) { this . insert_space_before_opening_angle_bracket_in_parameterized_type_reference = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption ) ; } final Object insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS ) ; if ( insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption != null ) { this . insert_space_before_opening_angle_bracket_in_type_arguments = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption ) ; } final Object insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS ) ; if ( insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption != null ) { this . insert_space_before_opening_angle_bracket_in_type_parameters = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption ) ; } final Object insertSpaceBeforeOpeningBraceInAnnotationTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION ) ; if ( insertSpaceBeforeOpeningBraceInAnnotationTypeDeclarationOption != null ) { this . insert_space_before_opening_brace_in_annotation_type_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInAnnotationTypeDeclarationOption ) ; } final Object insertSpaceBeforeOpeningBraceInAnonymousTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION ) ; if ( insertSpaceBeforeOpeningBraceInAnonymousTypeDeclarationOption != null ) { this . insert_space_before_opening_brace_in_anonymous_type_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInAnonymousTypeDeclarationOption ) ; } final Object insertSpaceBeforeOpeningBraceInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER ) ; if ( insertSpaceBeforeOpeningBraceInArrayInitializerOption != null ) { this . insert_space_before_opening_brace_in_array_initializer = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInArrayInitializerOption ) ; } final Object insertSpaceBeforeOpeningBraceInBlockOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK ) ; if ( insertSpaceBeforeOpeningBraceInBlockOption != null ) { this . insert_space_before_opening_brace_in_block = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInBlockOption ) ; } final Object insertSpaceBeforeOpeningBraceInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION ) ; if ( insertSpaceBeforeOpeningBraceInConstructorDeclarationOption != null ) { this . insert_space_before_opening_brace_in_constructor_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInConstructorDeclarationOption ) ; } final Object insertSpaceBeforeOpeningBraceInEnumDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION ) ; if ( insertSpaceBeforeOpeningBraceInEnumDeclarationOption != null ) { this . insert_space_before_opening_brace_in_enum_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInEnumDeclarationOption ) ; } final Object insertSpaceBeforeOpeningBraceInEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT ) ; if ( insertSpaceBeforeOpeningBraceInEnumConstantOption != null ) { this . insert_space_before_opening_brace_in_enum_constant = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInEnumConstantOption ) ; } final Object insertSpaceBeforeOpeningBraceInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION ) ; if ( insertSpaceBeforeOpeningBraceInMethodDeclarationOption != null ) { this . insert_space_before_opening_brace_in_method_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInMethodDeclarationOption ) ; } final Object insertSpaceBeforeOpeningBraceInTypeDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION ) ; if ( insertSpaceBeforeOpeningBraceInTypeDeclarationOption != null ) { this . insert_space_before_opening_brace_in_type_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInTypeDeclarationOption ) ; } final Object insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION ) ; if ( insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption != null ) { this . insert_space_before_opening_bracket_in_array_allocation_expression = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption ) ; } final Object insertSpaceBeforeOpeningBracketInArrayReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE ) ; if ( insertSpaceBeforeOpeningBracketInArrayReferenceOption != null ) { this . insert_space_before_opening_bracket_in_array_reference = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBracketInArrayReferenceOption ) ; } final Object insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE ) ; if ( insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption != null ) { this . insert_space_before_opening_bracket_in_array_type_reference = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption ) ; } final Object insertSpaceBeforeOpeningParenInAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION ) ; if ( insertSpaceBeforeOpeningParenInAnnotationOption != null ) { this . insert_space_before_opening_paren_in_annotation = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInAnnotationOption ) ; } final Object insertSpaceBeforeOpeningParenInAnnotationTypeMemberDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION ) ; if ( insertSpaceBeforeOpeningParenInAnnotationTypeMemberDeclarationOption != null ) { this . insert_space_before_opening_paren_in_annotation_type_member_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInAnnotationTypeMemberDeclarationOption ) ; } final Object insertSpaceBeforeOpeningParenInCatchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH ) ; if ( insertSpaceBeforeOpeningParenInCatchOption != null ) { this . insert_space_before_opening_paren_in_catch = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInCatchOption ) ; } final Object insertSpaceBeforeOpeningParenInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION ) ; if ( insertSpaceBeforeOpeningParenInConstructorDeclarationOption != null ) { this . insert_space_before_opening_paren_in_constructor_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInConstructorDeclarationOption ) ; } final Object insertSpaceBeforeOpeningParenInEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT ) ; if ( insertSpaceBeforeOpeningParenInEnumConstantOption != null ) { this . insert_space_before_opening_paren_in_enum_constant = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInEnumConstantOption ) ; } final Object insertSpaceBeforeOpeningParenInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR ) ; if ( insertSpaceBeforeOpeningParenInForOption != null ) { this . insert_space_before_opening_paren_in_for = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInForOption ) ; } final Object insertSpaceBeforeOpeningParenInIfOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF ) ; if ( insertSpaceBeforeOpeningParenInIfOption != null ) { this . insert_space_before_opening_paren_in_if = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInIfOption ) ; } final Object insertSpaceBeforeOpeningParenInMethodInvocationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION ) ; if ( insertSpaceBeforeOpeningParenInMethodInvocationOption != null ) { this . insert_space_before_opening_paren_in_method_invocation = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInMethodInvocationOption ) ; } final Object insertSpaceBeforeOpeningParenInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION ) ; if ( insertSpaceBeforeOpeningParenInMethodDeclarationOption != null ) { this . insert_space_before_opening_paren_in_method_declaration = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInMethodDeclarationOption ) ; } final Object insertSpaceBeforeOpeningParenInSwitchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH ) ; if ( insertSpaceBeforeOpeningParenInSwitchOption != null ) { this . insert_space_before_opening_paren_in_switch = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInSwitchOption ) ; } final Object insertSpaceBeforeOpeningBraceInSwitchOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH ) ; if ( insertSpaceBeforeOpeningBraceInSwitchOption != null ) { this . insert_space_before_opening_brace_in_switch = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningBraceInSwitchOption ) ; } final Object insertSpaceBeforeOpeningParenInSynchronizedOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED ) ; if ( insertSpaceBeforeOpeningParenInSynchronizedOption != null ) { this . insert_space_before_opening_paren_in_synchronized = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInSynchronizedOption ) ; } final Object insertSpaceBeforeOpeningParenInParenthesizedExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION ) ; if ( insertSpaceBeforeOpeningParenInParenthesizedExpressionOption != null ) { this . insert_space_before_opening_paren_in_parenthesized_expression = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInParenthesizedExpressionOption ) ; } final Object insertSpaceBeforeOpeningParenInWhileOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE ) ; if ( insertSpaceBeforeOpeningParenInWhileOption != null ) { this . insert_space_before_opening_paren_in_while = JavaCore . INSERT . equals ( insertSpaceBeforeOpeningParenInWhileOption ) ; } final Object insertSpaceBeforeParenthesizedExpressionInReturnOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN ) ; if ( insertSpaceBeforeParenthesizedExpressionInReturnOption != null ) { this . insert_space_before_parenthesized_expression_in_return = JavaCore . INSERT . equals ( insertSpaceBeforeParenthesizedExpressionInReturnOption ) ; } final Object insertSpaceBeforeParenthesizedExpressionInThrowOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW ) ; if ( insertSpaceBeforeParenthesizedExpressionInThrowOption != null ) { this . insert_space_before_parenthesized_expression_in_throw = JavaCore . INSERT . equals ( insertSpaceBeforeParenthesizedExpressionInThrowOption ) ; } final Object insertSpaceBeforePostfixOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR ) ; if ( insertSpaceBeforePostfixOperatorOption != null ) { this . insert_space_before_postfix_operator = JavaCore . INSERT . equals ( insertSpaceBeforePostfixOperatorOption ) ; } final Object insertSpaceBeforePrefixOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR ) ; if ( insertSpaceBeforePrefixOperatorOption != null ) { this . insert_space_before_prefix_operator = JavaCore . INSERT . equals ( insertSpaceBeforePrefixOperatorOption ) ; } final Object insertSpaceBeforeQuestionInConditionalOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL ) ; if ( insertSpaceBeforeQuestionInConditionalOption != null ) { this . insert_space_before_question_in_conditional = JavaCore . INSERT . equals ( insertSpaceBeforeQuestionInConditionalOption ) ; } final Object insertSpaceBeforeQuestionInWildcardOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD ) ; if ( insertSpaceBeforeQuestionInWildcardOption != null ) { this . insert_space_before_question_in_wilcard = JavaCore . INSERT . equals ( insertSpaceBeforeQuestionInWildcardOption ) ; } final Object insertSpaceBeforeSemicolonOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON ) ; if ( insertSpaceBeforeSemicolonOption != null ) { this . insert_space_before_semicolon = JavaCore . INSERT . equals ( insertSpaceBeforeSemicolonOption ) ; } final Object insertSpaceBeforeSemicolonInForOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR ) ; if ( insertSpaceBeforeSemicolonInForOption != null ) { this . insert_space_before_semicolon_in_for = JavaCore . INSERT . equals ( insertSpaceBeforeSemicolonInForOption ) ; } final Object insertSpaceBeforeUnaryOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR ) ; if ( insertSpaceBeforeUnaryOperatorOption != null ) { this . insert_space_before_unary_operator = JavaCore . INSERT . equals ( insertSpaceBeforeUnaryOperatorOption ) ; } final Object insertSpaceBetweenBracketsInArrayTypeReferenceOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE ) ; if ( insertSpaceBetweenBracketsInArrayTypeReferenceOption != null ) { this . insert_space_between_brackets_in_array_type_reference = JavaCore . INSERT . equals ( insertSpaceBetweenBracketsInArrayTypeReferenceOption ) ; } final Object insertSpaceBetweenEmptyBracesInArrayInitializerOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER ) ; if ( insertSpaceBetweenEmptyBracesInArrayInitializerOption != null ) { this . insert_space_between_empty_braces_in_array_initializer = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyBracesInArrayInitializerOption ) ; } final Object insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION ) ; if ( insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption != null ) { this . insert_space_between_empty_brackets_in_array_allocation_expression = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption ) ; } final Object insertSpaceBetweenEmptyParensInConstructorDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION ) ; if ( insertSpaceBetweenEmptyParensInConstructorDeclarationOption != null ) { this . insert_space_between_empty_parens_in_constructor_declaration = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyParensInConstructorDeclarationOption ) ; } final Object insertSpaceBetweenEmptyParensInAnnotationTypeMemberDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION ) ; if ( insertSpaceBetweenEmptyParensInAnnotationTypeMemberDeclarationOption != null ) { this . insert_space_between_empty_parens_in_annotation_type_member_declaration = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyParensInAnnotationTypeMemberDeclarationOption ) ; } final Object insertSpaceBetweenEmptyParensInEnumConstantOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT ) ; if ( insertSpaceBetweenEmptyParensInEnumConstantOption != null ) { this . insert_space_between_empty_parens_in_enum_constant = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyParensInEnumConstantOption ) ; } final Object insertSpaceBetweenEmptyParensInMethodDeclarationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION ) ; if ( insertSpaceBetweenEmptyParensInMethodDeclarationOption != null ) { this . insert_space_between_empty_parens_in_method_declaration = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyParensInMethodDeclarationOption ) ; } final Object insertSpaceBetweenEmptyParensInMethodInvocationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION ) ; if ( insertSpaceBetweenEmptyParensInMethodInvocationOption != null ) { this . insert_space_between_empty_parens_in_method_invocation = JavaCore . INSERT . equals ( insertSpaceBetweenEmptyParensInMethodInvocationOption ) ; } final Object compactElseIfOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMPACT_ELSE_IF ) ; if ( compactElseIfOption != null ) { this . compact_else_if = DefaultCodeFormatterConstants . TRUE . equals ( compactElseIfOption ) ; } final Object keepGuardianClauseOnOneLineOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE ) ; if ( keepGuardianClauseOnOneLineOption != null ) { this . keep_guardian_clause_on_one_line = DefaultCodeFormatterConstants . TRUE . equals ( keepGuardianClauseOnOneLineOption ) ; } final Object keepElseStatementOnSameLineOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE ) ; if ( keepElseStatementOnSameLineOption != null ) { this . keep_else_statement_on_same_line = DefaultCodeFormatterConstants . TRUE . equals ( keepElseStatementOnSameLineOption ) ; } final Object keepEmptyArrayInitializerOnOneLineOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE ) ; if ( keepEmptyArrayInitializerOnOneLineOption != null ) { this . keep_empty_array_initializer_on_one_line = DefaultCodeFormatterConstants . TRUE . equals ( keepEmptyArrayInitializerOnOneLineOption ) ; } final Object keepSimpleIfOnOneLineOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE ) ; if ( keepSimpleIfOnOneLineOption != null ) { this . keep_simple_if_on_one_line = DefaultCodeFormatterConstants . TRUE . equals ( keepSimpleIfOnOneLineOption ) ; } final Object keepThenStatementOnSameLineOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE ) ; if ( keepThenStatementOnSameLineOption != null ) { this . keep_then_statement_on_same_line = DefaultCodeFormatterConstants . TRUE . equals ( keepThenStatementOnSameLineOption ) ; } final Object neverIndentBlockCommentOnFirstColumnOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN ) ; if ( neverIndentBlockCommentOnFirstColumnOption != null ) { this . never_indent_block_comments_on_first_column = DefaultCodeFormatterConstants . TRUE . equals ( neverIndentBlockCommentOnFirstColumnOption ) ; } final Object neverIndentLineCommentOnFirstColumnOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN ) ; if ( neverIndentLineCommentOnFirstColumnOption != null ) { this . never_indent_line_comments_on_first_column = DefaultCodeFormatterConstants . TRUE . equals ( neverIndentLineCommentOnFirstColumnOption ) ; } final Object numberOfEmptyLinesToPreserveOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE ) ; if ( numberOfEmptyLinesToPreserveOption != null ) { try { this . number_of_empty_lines_to_preserve = Integer . parseInt ( ( String ) numberOfEmptyLinesToPreserveOption ) ; } catch ( NumberFormatException e ) { this . number_of_empty_lines_to_preserve = <NUM_LIT:0> ; } catch ( ClassCastException e ) { this . number_of_empty_lines_to_preserve = <NUM_LIT:0> ; } } final Object joinLinesInCommentsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_JOIN_LINES_IN_COMMENTS ) ; if ( joinLinesInCommentsOption != null ) { this . join_lines_in_comments = DefaultCodeFormatterConstants . TRUE . equals ( joinLinesInCommentsOption ) ; } final Object joinWrappedLinesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_JOIN_WRAPPED_LINES ) ; if ( joinWrappedLinesOption != null ) { this . join_wrapped_lines = DefaultCodeFormatterConstants . TRUE . equals ( joinWrappedLinesOption ) ; } final Object putEmptyStatementOnNewLineOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE ) ; if ( putEmptyStatementOnNewLineOption != null ) { this . put_empty_statement_on_new_line = DefaultCodeFormatterConstants . TRUE . equals ( putEmptyStatementOnNewLineOption ) ; } final Object tabSizeOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_TAB_SIZE ) ; if ( tabSizeOption != null ) { try { this . tab_size = Integer . parseInt ( ( String ) tabSizeOption ) ; } catch ( NumberFormatException e ) { this . tab_size = <NUM_LIT:4> ; } catch ( ClassCastException e ) { this . tab_size = <NUM_LIT:4> ; } } final Object useTabsOnlyForLeadingIndentationsOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS ) ; if ( useTabsOnlyForLeadingIndentationsOption != null ) { this . use_tabs_only_for_leading_indentations = DefaultCodeFormatterConstants . TRUE . equals ( useTabsOnlyForLeadingIndentationsOption ) ; } final Object pageWidthOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_LINE_SPLIT ) ; if ( pageWidthOption != null ) { try { this . page_width = Integer . parseInt ( ( String ) pageWidthOption ) ; } catch ( NumberFormatException e ) { this . page_width = <NUM_LIT> ; } catch ( ClassCastException e ) { this . page_width = <NUM_LIT> ; } } final Object useTabOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_TAB_CHAR ) ; if ( useTabOption != null ) { if ( JavaCore . TAB . equals ( useTabOption ) ) { this . tab_char = TAB ; } else if ( JavaCore . SPACE . equals ( useTabOption ) ) { this . tab_char = SPACE ; } else { this . tab_char = MIXED ; } } final Object wrapBeforeBinaryOperatorOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_WRAP_BEFORE_BINARY_OPERATOR ) ; if ( wrapBeforeBinaryOperatorOption != null ) { this . wrap_before_binary_operator = DefaultCodeFormatterConstants . TRUE . equals ( wrapBeforeBinaryOperatorOption ) ; } final Object useTags = settings . get ( DefaultCodeFormatterConstants . FORMATTER_USE_ON_OFF_TAGS ) ; if ( useTags != null ) { this . use_tags = DefaultCodeFormatterConstants . TRUE . equals ( useTags ) ; } final Object disableTagOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_DISABLING_TAG ) ; if ( disableTagOption != null ) { if ( disableTagOption instanceof String ) { String stringValue = ( String ) disableTagOption ; int idx = stringValue . indexOf ( '<STR_LIT:\n>' ) ; if ( idx == <NUM_LIT:0> ) { this . disabling_tag = null ; } else { String tag = idx < <NUM_LIT:0> ? stringValue . trim ( ) : stringValue . substring ( <NUM_LIT:0> , idx ) . trim ( ) ; if ( tag . length ( ) == <NUM_LIT:0> ) { this . disabling_tag = null ; } else { this . disabling_tag = tag . toCharArray ( ) ; } } } } final Object enableTagOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_ENABLING_TAG ) ; if ( enableTagOption != null ) { if ( enableTagOption instanceof String ) { String stringValue = ( String ) enableTagOption ; int idx = stringValue . indexOf ( '<STR_LIT:\n>' ) ; if ( idx == <NUM_LIT:0> ) { this . enabling_tag = null ; } else { String tag = idx < <NUM_LIT:0> ? stringValue . trim ( ) : stringValue . substring ( <NUM_LIT:0> , idx ) . trim ( ) ; if ( tag . length ( ) == <NUM_LIT:0> ) { this . enabling_tag = null ; } else { this . enabling_tag = tag . toCharArray ( ) ; } } } } final Object wrapWrapOuterExpressionsWhenNestedOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED ) ; if ( wrapWrapOuterExpressionsWhenNestedOption != null ) { this . wrap_outer_expressions_when_nested = DefaultCodeFormatterConstants . TRUE . equals ( wrapWrapOuterExpressionsWhenNestedOption ) ; } } private void setDeprecatedOptions ( Map settings ) { final Object commentClearBlankLinesOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_CLEAR_BLANK_LINES ) ; if ( commentClearBlankLinesOption != null ) { this . comment_clear_blank_lines_in_javadoc_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentClearBlankLinesOption ) ; this . comment_clear_blank_lines_in_block_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentClearBlankLinesOption ) ; } else { final Object commentClearBlankLinesInJavadocCommentOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT ) ; if ( commentClearBlankLinesInJavadocCommentOption != null ) { this . comment_clear_blank_lines_in_javadoc_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentClearBlankLinesInJavadocCommentOption ) ; } final Object commentClearBlankLinesInBlockCommentOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT ) ; if ( commentClearBlankLinesInBlockCommentOption != null ) { this . comment_clear_blank_lines_in_block_comment = DefaultCodeFormatterConstants . TRUE . equals ( commentClearBlankLinesInBlockCommentOption ) ; } } final Object insertNewLineAfterAnnotationOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION ) ; if ( insertNewLineAfterAnnotationOption != null ) { this . insert_new_line_after_annotation_on_member = JavaCore . INSERT . equals ( insertNewLineAfterAnnotationOption ) ; this . insert_new_line_after_annotation_on_parameter = JavaCore . INSERT . equals ( insertNewLineAfterAnnotationOption ) ; this . insert_new_line_after_annotation_on_local_variable = JavaCore . INSERT . equals ( insertNewLineAfterAnnotationOption ) ; } else { final Object insertNewLineAfterAnnotationOnMemberOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER ) ; if ( insertNewLineAfterAnnotationOnMemberOption != null ) { this . insert_new_line_after_annotation_on_member = JavaCore . INSERT . equals ( insertNewLineAfterAnnotationOnMemberOption ) ; } final Object insertNewLineAfterAnnotationOnParameterOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER ) ; if ( insertNewLineAfterAnnotationOnParameterOption != null ) { this . insert_new_line_after_annotation_on_parameter = JavaCore . INSERT . equals ( insertNewLineAfterAnnotationOnParameterOption ) ; } final Object insertNewLineAfterAnnotationOnLocalVariableOption = settings . get ( DefaultCodeFormatterConstants . FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE ) ; if ( insertNewLineAfterAnnotationOnLocalVariableOption != null ) { this . insert_new_line_after_annotation_on_local_variable = JavaCore . INSERT . equals ( insertNewLineAfterAnnotationOnLocalVariableOption ) ; } } } public void setDefaultSettings ( ) { this . alignment_for_arguments_in_allocation_expression = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_annotation = Alignment . M_NO_ALIGNMENT ; this . alignment_for_arguments_in_enum_constant = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_explicit_constructor_call = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_method_invocation = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_qualified_allocation_expression = Alignment . M_COMPACT_SPLIT ; this . alignment_for_assignment = Alignment . M_NO_ALIGNMENT ; this . alignment_for_binary_expression = Alignment . M_COMPACT_SPLIT ; this . alignment_for_compact_if = Alignment . M_ONE_PER_LINE_SPLIT | Alignment . M_INDENT_BY_ONE ; this . alignment_for_conditional_expression = Alignment . M_ONE_PER_LINE_SPLIT ; this . alignment_for_enum_constants = Alignment . NONE ; this . alignment_for_expressions_in_array_initializer = Alignment . M_COMPACT_SPLIT ; this . alignment_for_method_declaration = Alignment . M_NO_ALIGNMENT ; this . alignment_for_multiple_fields = Alignment . M_COMPACT_SPLIT ; this . alignment_for_parameters_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_parameters_in_method_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_selector_in_method_invocation = Alignment . M_COMPACT_SPLIT ; this . alignment_for_superclass_in_type_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; this . alignment_for_superinterfaces_in_enum_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; this . alignment_for_superinterfaces_in_type_declaration = Alignment . M_NEXT_SHIFTED_SPLIT ; this . alignment_for_throws_clause_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_throws_clause_in_method_declaration = Alignment . M_COMPACT_SPLIT ; this . align_type_members_on_columns = false ; this . brace_position_for_annotation_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_array_initializer = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_block = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_block_in_case = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_constructor_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_enum_constant = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_enum_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_method_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_switch = DefaultCodeFormatterConstants . END_OF_LINE ; this . comment_clear_blank_lines_in_block_comment = false ; this . comment_clear_blank_lines_in_javadoc_comment = false ; this . comment_format_block_comment = true ; this . comment_format_javadoc_comment = true ; this . comment_format_line_comment = true ; this . comment_format_line_comment_starting_on_first_column = true ; this . comment_format_header = false ; this . comment_format_html = true ; this . comment_format_source = true ; this . comment_indent_parameter_description = true ; this . comment_indent_root_tags = true ; this . comment_insert_empty_line_before_root_tags = true ; this . comment_insert_new_line_for_parameter = true ; this . comment_new_lines_at_block_boundaries = true ; this . comment_new_lines_at_javadoc_boundaries = true ; this . comment_line_length = <NUM_LIT> ; this . continuation_indentation = <NUM_LIT:2> ; this . continuation_indentation_for_array_initializer = <NUM_LIT:2> ; this . blank_lines_after_imports = <NUM_LIT:0> ; this . blank_lines_after_package = <NUM_LIT:0> ; this . blank_lines_before_field = <NUM_LIT:0> ; this . blank_lines_before_first_class_body_declaration = <NUM_LIT:0> ; this . blank_lines_before_imports = <NUM_LIT:0> ; this . blank_lines_before_member_type = <NUM_LIT:0> ; this . blank_lines_before_method = <NUM_LIT:0> ; this . blank_lines_before_new_chunk = <NUM_LIT:0> ; this . blank_lines_before_package = <NUM_LIT:0> ; this . blank_lines_between_import_groups = <NUM_LIT:1> ; this . blank_lines_between_type_declarations = <NUM_LIT:0> ; this . blank_lines_at_beginning_of_method_body = <NUM_LIT:0> ; this . indent_statements_compare_to_block = true ; this . indent_statements_compare_to_body = true ; this . indent_body_declarations_compare_to_annotation_declaration_header = true ; this . indent_body_declarations_compare_to_enum_constant_header = true ; this . indent_body_declarations_compare_to_enum_declaration_header = true ; this . indent_body_declarations_compare_to_type_header = true ; this . indent_breaks_compare_to_cases = true ; this . indent_empty_lines = false ; this . indent_switchstatements_compare_to_cases = true ; this . indent_switchstatements_compare_to_switch = true ; this . indentation_size = <NUM_LIT:4> ; this . insert_new_line_after_annotation_on_member = true ; this . insert_new_line_after_annotation_on_parameter = false ; this . insert_new_line_after_annotation_on_local_variable = true ; this . insert_new_line_after_opening_brace_in_array_initializer = false ; this . insert_new_line_at_end_of_file_if_missing = false ; this . insert_new_line_before_catch_in_try_statement = false ; this . insert_new_line_before_closing_brace_in_array_initializer = false ; this . insert_new_line_before_else_in_if_statement = false ; this . insert_new_line_before_finally_in_try_statement = false ; this . insert_new_line_before_while_in_do_statement = false ; this . insert_new_line_in_empty_anonymous_type_declaration = true ; this . insert_new_line_in_empty_block = true ; this . insert_new_line_in_empty_annotation_declaration = true ; this . insert_new_line_in_empty_enum_constant = true ; this . insert_new_line_in_empty_enum_declaration = true ; this . insert_new_line_in_empty_method_body = true ; this . insert_new_line_in_empty_type_declaration = true ; this . insert_space_after_and_in_type_parameter = true ; this . insert_space_after_assignment_operator = true ; this . insert_space_after_at_in_annotation = false ; this . insert_space_after_at_in_annotation_type_declaration = false ; this . insert_space_after_binary_operator = true ; this . insert_space_after_closing_angle_bracket_in_type_arguments = true ; this . insert_space_after_closing_angle_bracket_in_type_parameters = true ; this . insert_space_after_closing_paren_in_cast = true ; this . insert_space_after_closing_brace_in_block = true ; this . insert_space_after_colon_in_assert = true ; this . insert_space_after_colon_in_case = true ; this . insert_space_after_colon_in_conditional = true ; this . insert_space_after_colon_in_for = true ; this . insert_space_after_colon_in_labeled_statement = true ; this . insert_space_after_comma_in_allocation_expression = true ; this . insert_space_after_comma_in_annotation = true ; this . insert_space_after_comma_in_array_initializer = true ; this . insert_space_after_comma_in_constructor_declaration_parameters = true ; this . insert_space_after_comma_in_constructor_declaration_throws = true ; this . insert_space_after_comma_in_enum_constant_arguments = true ; this . insert_space_after_comma_in_enum_declarations = true ; this . insert_space_after_comma_in_explicit_constructor_call_arguments = true ; this . insert_space_after_comma_in_for_increments = true ; this . insert_space_after_comma_in_for_inits = true ; this . insert_space_after_comma_in_method_invocation_arguments = true ; this . insert_space_after_comma_in_method_declaration_parameters = true ; this . insert_space_after_comma_in_method_declaration_throws = true ; this . insert_space_after_comma_in_multiple_field_declarations = true ; this . insert_space_after_comma_in_multiple_local_declarations = true ; this . insert_space_after_comma_in_parameterized_type_reference = true ; this . insert_space_after_comma_in_superinterfaces = true ; this . insert_space_after_comma_in_type_arguments = true ; this . insert_space_after_comma_in_type_parameters = true ; this . insert_space_after_ellipsis = true ; this . insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false ; this . insert_space_after_opening_angle_bracket_in_type_arguments = false ; this . insert_space_after_opening_angle_bracket_in_type_parameters = false ; this . insert_space_after_opening_bracket_in_array_allocation_expression = false ; this . insert_space_after_opening_bracket_in_array_reference = false ; this . insert_space_after_opening_brace_in_array_initializer = false ; this . insert_space_after_opening_paren_in_annotation = false ; this . insert_space_after_opening_paren_in_cast = false ; this . insert_space_after_opening_paren_in_catch = false ; this . insert_space_after_opening_paren_in_constructor_declaration = false ; this . insert_space_after_opening_paren_in_enum_constant = false ; this . insert_space_after_opening_paren_in_for = false ; this . insert_space_after_opening_paren_in_if = false ; this . insert_space_after_opening_paren_in_method_declaration = false ; this . insert_space_after_opening_paren_in_method_invocation = false ; this . insert_space_after_opening_paren_in_parenthesized_expression = false ; this . insert_space_after_opening_paren_in_switch = false ; this . insert_space_after_opening_paren_in_synchronized = false ; this . insert_space_after_opening_paren_in_while = false ; this . insert_space_after_postfix_operator = false ; this . insert_space_after_prefix_operator = false ; this . insert_space_after_question_in_conditional = true ; this . insert_space_after_question_in_wilcard = false ; this . insert_space_after_semicolon_in_for = true ; this . insert_space_after_unary_operator = false ; this . insert_space_before_and_in_type_parameter = true ; this . insert_space_before_at_in_annotation_type_declaration = true ; this . insert_space_before_assignment_operator = true ; this . insert_space_before_binary_operator = true ; this . insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false ; this . insert_space_before_closing_angle_bracket_in_type_arguments = false ; this . insert_space_before_closing_angle_bracket_in_type_parameters = false ; this . insert_space_before_closing_brace_in_array_initializer = false ; this . insert_space_before_closing_bracket_in_array_allocation_expression = false ; this . insert_space_before_closing_bracket_in_array_reference = false ; this . insert_space_before_closing_paren_in_annotation = false ; this . insert_space_before_closing_paren_in_cast = false ; this . insert_space_before_closing_paren_in_catch = false ; this . insert_space_before_closing_paren_in_constructor_declaration = false ; this . insert_space_before_closing_paren_in_enum_constant = false ; this . insert_space_before_closing_paren_in_for = false ; this . insert_space_before_closing_paren_in_if = false ; this . insert_space_before_closing_paren_in_method_declaration = false ; this . insert_space_before_closing_paren_in_method_invocation = false ; this . insert_space_before_closing_paren_in_parenthesized_expression = false ; this . insert_space_before_closing_paren_in_switch = false ; this . insert_space_before_closing_paren_in_synchronized = false ; this . insert_space_before_closing_paren_in_while = false ; this . insert_space_before_colon_in_assert = true ; this . insert_space_before_colon_in_case = true ; this . insert_space_before_colon_in_conditional = true ; this . insert_space_before_colon_in_default = true ; this . insert_space_before_colon_in_for = true ; this . insert_space_before_colon_in_labeled_statement = true ; this . insert_space_before_comma_in_allocation_expression = false ; this . insert_space_before_comma_in_array_initializer = false ; this . insert_space_before_comma_in_constructor_declaration_parameters = false ; this . insert_space_before_comma_in_constructor_declaration_throws = false ; this . insert_space_before_comma_in_enum_constant_arguments = false ; this . insert_space_before_comma_in_enum_declarations = false ; this . insert_space_before_comma_in_explicit_constructor_call_arguments = false ; this . insert_space_before_comma_in_for_increments = false ; this . insert_space_before_comma_in_for_inits = false ; this . insert_space_before_comma_in_method_invocation_arguments = false ; this . insert_space_before_comma_in_method_declaration_parameters = false ; this . insert_space_before_comma_in_method_declaration_throws = false ; this . insert_space_before_comma_in_multiple_field_declarations = false ; this . insert_space_before_comma_in_multiple_local_declarations = false ; this . insert_space_before_comma_in_parameterized_type_reference = false ; this . insert_space_before_comma_in_superinterfaces = false ; this . insert_space_before_comma_in_type_arguments = false ; this . insert_space_before_comma_in_type_parameters = false ; this . insert_space_before_ellipsis = false ; this . insert_space_before_parenthesized_expression_in_return = true ; this . insert_space_before_parenthesized_expression_in_throw = true ; this . insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false ; this . insert_space_before_opening_angle_bracket_in_type_arguments = false ; this . insert_space_before_opening_angle_bracket_in_type_parameters = false ; this . insert_space_before_opening_brace_in_annotation_type_declaration = true ; this . insert_space_before_opening_brace_in_anonymous_type_declaration = true ; this . insert_space_before_opening_brace_in_array_initializer = false ; this . insert_space_before_opening_brace_in_block = true ; this . insert_space_before_opening_brace_in_constructor_declaration = true ; this . insert_space_before_opening_brace_in_enum_constant = true ; this . insert_space_before_opening_brace_in_enum_declaration = true ; this . insert_space_before_opening_brace_in_method_declaration = true ; this . insert_space_before_opening_brace_in_switch = true ; this . insert_space_before_opening_brace_in_type_declaration = true ; this . insert_space_before_opening_bracket_in_array_allocation_expression = false ; this . insert_space_before_opening_bracket_in_array_reference = false ; this . insert_space_before_opening_bracket_in_array_type_reference = false ; this . insert_space_before_opening_paren_in_annotation = false ; this . insert_space_before_opening_paren_in_annotation_type_member_declaration = false ; this . insert_space_before_opening_paren_in_catch = true ; this . insert_space_before_opening_paren_in_constructor_declaration = false ; this . insert_space_before_opening_paren_in_enum_constant = false ; this . insert_space_before_opening_paren_in_for = true ; this . insert_space_before_opening_paren_in_if = true ; this . insert_space_before_opening_paren_in_method_invocation = false ; this . insert_space_before_opening_paren_in_method_declaration = false ; this . insert_space_before_opening_paren_in_switch = true ; this . insert_space_before_opening_paren_in_synchronized = true ; this . insert_space_before_opening_paren_in_parenthesized_expression = false ; this . insert_space_before_opening_paren_in_while = true ; this . insert_space_before_postfix_operator = false ; this . insert_space_before_prefix_operator = false ; this . insert_space_before_question_in_conditional = true ; this . insert_space_before_question_in_wilcard = false ; this . insert_space_before_semicolon = false ; this . insert_space_before_semicolon_in_for = false ; this . insert_space_before_unary_operator = false ; this . insert_space_between_brackets_in_array_type_reference = false ; this . insert_space_between_empty_braces_in_array_initializer = false ; this . insert_space_between_empty_brackets_in_array_allocation_expression = false ; this . insert_space_between_empty_parens_in_annotation_type_member_declaration = false ; this . insert_space_between_empty_parens_in_constructor_declaration = false ; this . insert_space_between_empty_parens_in_enum_constant = false ; this . insert_space_between_empty_parens_in_method_declaration = false ; this . insert_space_between_empty_parens_in_method_invocation = false ; this . compact_else_if = true ; this . keep_guardian_clause_on_one_line = false ; this . keep_else_statement_on_same_line = false ; this . keep_empty_array_initializer_on_one_line = false ; this . keep_simple_if_on_one_line = false ; this . keep_then_statement_on_same_line = false ; this . never_indent_block_comments_on_first_column = false ; this . never_indent_line_comments_on_first_column = false ; this . number_of_empty_lines_to_preserve = <NUM_LIT:1> ; this . join_lines_in_comments = true ; this . join_wrapped_lines = true ; this . put_empty_statement_on_new_line = false ; this . tab_size = <NUM_LIT:4> ; this . page_width = <NUM_LIT> ; this . tab_char = TAB ; this . use_tabs_only_for_leading_indentations = false ; this . wrap_before_binary_operator = true ; this . use_tags = false ; this . disabling_tag = DEFAULT_DISABLING_TAG ; this . enabling_tag = DEFAULT_ENABLING_TAG ; this . wrap_outer_expressions_when_nested = true ; } public void setEclipseDefaultSettings ( ) { setJavaConventionsSettings ( ) ; this . tab_char = TAB ; this . tab_size = <NUM_LIT:4> ; } public void setJavaConventionsSettings ( ) { this . alignment_for_arguments_in_allocation_expression = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_annotation = Alignment . M_NO_ALIGNMENT ; this . alignment_for_arguments_in_enum_constant = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_explicit_constructor_call = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_method_invocation = Alignment . M_COMPACT_SPLIT ; this . alignment_for_arguments_in_qualified_allocation_expression = Alignment . M_COMPACT_SPLIT ; this . alignment_for_assignment = Alignment . M_NO_ALIGNMENT ; this . alignment_for_binary_expression = Alignment . M_COMPACT_SPLIT ; this . alignment_for_compact_if = Alignment . M_COMPACT_SPLIT ; this . alignment_for_conditional_expression = Alignment . M_NEXT_PER_LINE_SPLIT ; this . alignment_for_enum_constants = Alignment . NONE ; this . alignment_for_expressions_in_array_initializer = Alignment . M_COMPACT_SPLIT ; this . alignment_for_method_declaration = Alignment . M_NO_ALIGNMENT ; this . alignment_for_multiple_fields = Alignment . M_COMPACT_SPLIT ; this . alignment_for_parameters_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_parameters_in_method_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_selector_in_method_invocation = Alignment . M_COMPACT_SPLIT ; this . alignment_for_superclass_in_type_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_superinterfaces_in_enum_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_superinterfaces_in_type_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_throws_clause_in_constructor_declaration = Alignment . M_COMPACT_SPLIT ; this . alignment_for_throws_clause_in_method_declaration = Alignment . M_COMPACT_SPLIT ; this . align_type_members_on_columns = false ; this . brace_position_for_annotation_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_array_initializer = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_block = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_block_in_case = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_constructor_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_enum_constant = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_enum_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_method_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_type_declaration = DefaultCodeFormatterConstants . END_OF_LINE ; this . brace_position_for_switch = DefaultCodeFormatterConstants . END_OF_LINE ; this . comment_clear_blank_lines_in_block_comment = false ; this . comment_clear_blank_lines_in_javadoc_comment = false ; this . comment_format_block_comment = true ; this . comment_format_javadoc_comment = true ; this . comment_format_line_comment = true ; this . comment_format_line_comment_starting_on_first_column = true ; this . comment_format_header = false ; this . comment_format_html = true ; this . comment_format_source = true ; this . comment_indent_parameter_description = true ; this . comment_indent_root_tags = true ; this . comment_insert_empty_line_before_root_tags = true ; this . comment_insert_new_line_for_parameter = true ; this . comment_new_lines_at_block_boundaries = true ; this . comment_new_lines_at_javadoc_boundaries = true ; this . comment_line_length = <NUM_LIT> ; this . continuation_indentation = <NUM_LIT:2> ; this . continuation_indentation_for_array_initializer = <NUM_LIT:2> ; this . blank_lines_after_imports = <NUM_LIT:1> ; this . blank_lines_after_package = <NUM_LIT:1> ; this . blank_lines_before_field = <NUM_LIT:0> ; this . blank_lines_before_first_class_body_declaration = <NUM_LIT:0> ; this . blank_lines_before_imports = <NUM_LIT:1> ; this . blank_lines_before_member_type = <NUM_LIT:1> ; this . blank_lines_before_method = <NUM_LIT:1> ; this . blank_lines_before_new_chunk = <NUM_LIT:1> ; this . blank_lines_before_package = <NUM_LIT:0> ; this . blank_lines_between_import_groups = <NUM_LIT:1> ; this . blank_lines_between_type_declarations = <NUM_LIT:1> ; this . blank_lines_at_beginning_of_method_body = <NUM_LIT:0> ; this . indent_statements_compare_to_block = true ; this . indent_statements_compare_to_body = true ; this . indent_body_declarations_compare_to_annotation_declaration_header = true ; this . indent_body_declarations_compare_to_enum_constant_header = true ; this . indent_body_declarations_compare_to_enum_declaration_header = true ; this . indent_body_declarations_compare_to_type_header = true ; this . indent_breaks_compare_to_cases = true ; this . indent_empty_lines = false ; this . indent_switchstatements_compare_to_cases = true ; this . indent_switchstatements_compare_to_switch = false ; this . indentation_size = <NUM_LIT:4> ; this . insert_new_line_after_annotation_on_member = true ; this . insert_new_line_after_annotation_on_parameter = false ; this . insert_new_line_after_annotation_on_local_variable = true ; this . insert_new_line_after_opening_brace_in_array_initializer = false ; this . insert_new_line_at_end_of_file_if_missing = false ; this . insert_new_line_before_catch_in_try_statement = false ; this . insert_new_line_before_closing_brace_in_array_initializer = false ; this . insert_new_line_before_else_in_if_statement = false ; this . insert_new_line_before_finally_in_try_statement = false ; this . insert_new_line_before_while_in_do_statement = false ; this . insert_new_line_in_empty_anonymous_type_declaration = true ; this . insert_new_line_in_empty_block = true ; this . insert_new_line_in_empty_annotation_declaration = true ; this . insert_new_line_in_empty_enum_constant = true ; this . insert_new_line_in_empty_enum_declaration = true ; this . insert_new_line_in_empty_method_body = true ; this . insert_new_line_in_empty_type_declaration = true ; this . insert_space_after_and_in_type_parameter = true ; this . insert_space_after_assignment_operator = true ; this . insert_space_after_at_in_annotation = false ; this . insert_space_after_at_in_annotation_type_declaration = false ; this . insert_space_after_binary_operator = true ; this . insert_space_after_closing_angle_bracket_in_type_arguments = true ; this . insert_space_after_closing_angle_bracket_in_type_parameters = true ; this . insert_space_after_closing_paren_in_cast = true ; this . insert_space_after_closing_brace_in_block = true ; this . insert_space_after_colon_in_assert = true ; this . insert_space_after_colon_in_case = true ; this . insert_space_after_colon_in_conditional = true ; this . insert_space_after_colon_in_for = true ; this . insert_space_after_colon_in_labeled_statement = true ; this . insert_space_after_comma_in_allocation_expression = true ; this . insert_space_after_comma_in_annotation = true ; this . insert_space_after_comma_in_array_initializer = true ; this . insert_space_after_comma_in_constructor_declaration_parameters = true ; this . insert_space_after_comma_in_constructor_declaration_throws = true ; this . insert_space_after_comma_in_enum_constant_arguments = true ; this . insert_space_after_comma_in_enum_declarations = true ; this . insert_space_after_comma_in_explicit_constructor_call_arguments = true ; this . insert_space_after_comma_in_for_increments = true ; this . insert_space_after_comma_in_for_inits = true ; this . insert_space_after_comma_in_method_invocation_arguments = true ; this . insert_space_after_comma_in_method_declaration_parameters = true ; this . insert_space_after_comma_in_method_declaration_throws = true ; this . insert_space_after_comma_in_multiple_field_declarations = true ; this . insert_space_after_comma_in_multiple_local_declarations = true ; this . insert_space_after_comma_in_parameterized_type_reference = true ; this . insert_space_after_comma_in_superinterfaces = true ; this . insert_space_after_comma_in_type_arguments = true ; this . insert_space_after_comma_in_type_parameters = true ; this . insert_space_after_ellipsis = true ; this . insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false ; this . insert_space_after_opening_angle_bracket_in_type_arguments = false ; this . insert_space_after_opening_angle_bracket_in_type_parameters = false ; this . insert_space_after_opening_bracket_in_array_allocation_expression = false ; this . insert_space_after_opening_bracket_in_array_reference = false ; this . insert_space_after_opening_brace_in_array_initializer = true ; this . insert_space_after_opening_paren_in_annotation = false ; this . insert_space_after_opening_paren_in_cast = false ; this . insert_space_after_opening_paren_in_catch = false ; this . insert_space_after_opening_paren_in_constructor_declaration = false ; this . insert_space_after_opening_paren_in_enum_constant = false ; this . insert_space_after_opening_paren_in_for = false ; this . insert_space_after_opening_paren_in_if = false ; this . insert_space_after_opening_paren_in_method_declaration = false ; this . insert_space_after_opening_paren_in_method_invocation = false ; this . insert_space_after_opening_paren_in_parenthesized_expression = false ; this . insert_space_after_opening_paren_in_switch = false ; this . insert_space_after_opening_paren_in_synchronized = false ; this . insert_space_after_opening_paren_in_while = false ; this . insert_space_after_postfix_operator = false ; this . insert_space_after_prefix_operator = false ; this . insert_space_after_question_in_conditional = true ; this . insert_space_after_question_in_wilcard = false ; this . insert_space_after_semicolon_in_for = true ; this . insert_space_after_unary_operator = false ; this . insert_space_before_and_in_type_parameter = true ; this . insert_space_before_at_in_annotation_type_declaration = true ; this . insert_space_before_assignment_operator = true ; this . insert_space_before_binary_operator = true ; this . insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false ; this . insert_space_before_closing_angle_bracket_in_type_arguments = false ; this . insert_space_before_closing_angle_bracket_in_type_parameters = false ; this . insert_space_before_closing_brace_in_array_initializer = true ; this . insert_space_before_closing_bracket_in_array_allocation_expression = false ; this . insert_space_before_closing_bracket_in_array_reference = false ; this . insert_space_before_closing_paren_in_annotation = false ; this . insert_space_before_closing_paren_in_cast = false ; this . insert_space_before_closing_paren_in_catch = false ; this . insert_space_before_closing_paren_in_constructor_declaration = false ; this . insert_space_before_closing_paren_in_enum_constant = false ; this . insert_space_before_closing_paren_in_for = false ; this . insert_space_before_closing_paren_in_if = false ; this . insert_space_before_closing_paren_in_method_declaration = false ; this . insert_space_before_closing_paren_in_method_invocation = false ; this . insert_space_before_closing_paren_in_parenthesized_expression = false ; this . insert_space_before_closing_paren_in_switch = false ; this . insert_space_before_closing_paren_in_synchronized = false ; this . insert_space_before_closing_paren_in_while = false ; this . insert_space_before_colon_in_assert = true ; this . insert_space_before_colon_in_case = false ; this . insert_space_before_colon_in_conditional = true ; this . insert_space_before_colon_in_default = false ; this . insert_space_before_colon_in_for = true ; this . insert_space_before_colon_in_labeled_statement = false ; this . insert_space_before_comma_in_allocation_expression = false ; this . insert_space_before_comma_in_array_initializer = false ; this . insert_space_before_comma_in_constructor_declaration_parameters = false ; this . insert_space_before_comma_in_constructor_declaration_throws = false ; this . insert_space_before_comma_in_enum_constant_arguments = false ; this . insert_space_before_comma_in_enum_declarations = false ; this . insert_space_before_comma_in_explicit_constructor_call_arguments = false ; this . insert_space_before_comma_in_for_increments = false ; this . insert_space_before_comma_in_for_inits = false ; this . insert_space_before_comma_in_method_invocation_arguments = false ; this . insert_space_before_comma_in_method_declaration_parameters = false ; this . insert_space_before_comma_in_method_declaration_throws = false ; this . insert_space_before_comma_in_multiple_field_declarations = false ; this . insert_space_before_comma_in_multiple_local_declarations = false ; this . insert_space_before_comma_in_parameterized_type_reference = false ; this . insert_space_before_comma_in_superinterfaces = false ; this . insert_space_before_comma_in_type_arguments = false ; this . insert_space_before_comma_in_type_parameters = false ; this . insert_space_before_ellipsis = false ; this . insert_space_before_parenthesized_expression_in_return = true ; this . insert_space_before_parenthesized_expression_in_throw = true ; this . insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false ; this . insert_space_before_opening_angle_bracket_in_type_arguments = false ; this . insert_space_before_opening_angle_bracket_in_type_parameters = false ; this . insert_space_before_opening_brace_in_annotation_type_declaration = true ; this . insert_space_before_opening_brace_in_anonymous_type_declaration = true ; this . insert_space_before_opening_brace_in_array_initializer = true ; this . insert_space_before_opening_brace_in_block = true ; this . insert_space_before_opening_brace_in_constructor_declaration = true ; this . insert_space_before_opening_brace_in_enum_constant = true ; this . insert_space_before_opening_brace_in_enum_declaration = true ; this . insert_space_before_opening_brace_in_method_declaration = true ; this . insert_space_before_opening_brace_in_switch = true ; this . insert_space_before_opening_brace_in_type_declaration = true ; this . insert_space_before_opening_bracket_in_array_allocation_expression = false ; this . insert_space_before_opening_bracket_in_array_reference = false ; this . insert_space_before_opening_bracket_in_array_type_reference = false ; this . insert_space_before_opening_paren_in_annotation = false ; this . insert_space_before_opening_paren_in_annotation_type_member_declaration = false ; this . insert_space_before_opening_paren_in_catch = true ; this . insert_space_before_opening_paren_in_constructor_declaration = false ; this . insert_space_before_opening_paren_in_enum_constant = false ; this . insert_space_before_opening_paren_in_for = true ; this . insert_space_before_opening_paren_in_if = true ; this . insert_space_before_opening_paren_in_method_invocation = false ; this . insert_space_before_opening_paren_in_method_declaration = false ; this . insert_space_before_opening_paren_in_switch = true ; this . insert_space_before_opening_paren_in_synchronized = true ; this . insert_space_before_opening_paren_in_parenthesized_expression = false ; this . insert_space_before_opening_paren_in_while = true ; this . insert_space_before_postfix_operator = false ; this . insert_space_before_prefix_operator = false ; this . insert_space_before_question_in_conditional = true ; this . insert_space_before_question_in_wilcard = false ; this . insert_space_before_semicolon = false ; this . insert_space_before_semicolon_in_for = false ; this . insert_space_before_unary_operator = false ; this . insert_space_between_brackets_in_array_type_reference = false ; this . insert_space_between_empty_braces_in_array_initializer = false ; this . insert_space_between_empty_brackets_in_array_allocation_expression = false ; this . insert_space_between_empty_parens_in_annotation_type_member_declaration = false ; this . insert_space_between_empty_parens_in_constructor_declaration = false ; this . insert_space_between_empty_parens_in_enum_constant = false ; this . insert_space_between_empty_parens_in_method_declaration = false ; this . insert_space_between_empty_parens_in_method_invocation = false ; this . compact_else_if = true ; this . keep_guardian_clause_on_one_line = false ; this . keep_else_statement_on_same_line = false ; this . keep_empty_array_initializer_on_one_line = false ; this . keep_simple_if_on_one_line = false ; this . keep_then_statement_on_same_line = false ; this . never_indent_block_comments_on_first_column = false ; this . never_indent_line_comments_on_first_column = false ; this . number_of_empty_lines_to_preserve = <NUM_LIT:1> ; this . join_lines_in_comments = true ; this . join_wrapped_lines = true ; this . put_empty_statement_on_new_line = true ; this . tab_size = <NUM_LIT:8> ; this . page_width = <NUM_LIT> ; this . tab_char = MIXED ; this . use_tabs_only_for_leading_indentations = false ; this . wrap_before_binary_operator = true ; this . use_tags = false ; this . disabling_tag = DEFAULT_DISABLING_TAG ; this . enabling_tag = DEFAULT_ENABLING_TAG ; this . wrap_outer_expressions_when_nested = true ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . align ; import org . eclipse . core . runtime . Assert ; import org . eclipse . jdt . internal . formatter . Location ; import org . eclipse . jdt . internal . formatter . Scribe ; public class Alignment { public int kind ; public static final int ALLOCATION = <NUM_LIT:1> ; public static final int ANNOTATION_MEMBERS_VALUE_PAIRS = <NUM_LIT:2> ; public static final int ARRAY_INITIALIZER = <NUM_LIT:3> ; public static final int ASSIGNMENT = <NUM_LIT:4> ; public static final int BINARY_EXPRESSION = <NUM_LIT:5> ; public static final int CASCADING_MESSAGE_SEND = <NUM_LIT:6> ; public static final int COMPACT_IF = <NUM_LIT:7> ; public static final int COMPOUND_ASSIGNMENT = <NUM_LIT:8> ; public static final int CONDITIONAL_EXPRESSION = <NUM_LIT:9> ; public static final int ENUM_CONSTANTS = <NUM_LIT:10> ; public static final int ENUM_CONSTANTS_ARGUMENTS = <NUM_LIT:11> ; public static final int EXPLICIT_CONSTRUCTOR_CALL = <NUM_LIT:12> ; public static final int FIELD_DECLARATION_ASSIGNMENT = <NUM_LIT> ; public static final int LOCAL_DECLARATION_ASSIGNMENT = <NUM_LIT> ; public static final int MESSAGE_ARGUMENTS = <NUM_LIT:15> ; public static final int MESSAGE_SEND = <NUM_LIT:16> ; public static final int METHOD_ARGUMENTS = <NUM_LIT> ; public static final int METHOD_DECLARATION = <NUM_LIT> ; public static final int MULTIPLE_FIELD = <NUM_LIT> ; public static final int SUPER_CLASS = <NUM_LIT:20> ; public static final int SUPER_INTERFACES = <NUM_LIT> ; public static final int THROWS = <NUM_LIT> ; public static final int TYPE_MEMBERS = <NUM_LIT> ; public static final int STRING_CONCATENATION = <NUM_LIT:24> ; public String name ; public static final String [ ] NAMES = { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , } ; public Alignment enclosing ; public Location location ; public int fragmentIndex ; public int fragmentCount ; public int [ ] fragmentIndentations ; public boolean needRedoColumnAlignment ; public int chunkStartIndex ; public int chunkKind ; public int originalIndentationLevel ; public int breakIndentationLevel ; public int shiftBreakIndentationLevel ; public int [ ] fragmentBreaks ; public boolean wasSplit ; public boolean blockAlign = false ; public boolean tooLong = false ; public Scribe scribe ; private boolean reset = false ; public static final int M_FORCE = <NUM_LIT:1> ; public static final int M_INDENT_ON_COLUMN = <NUM_LIT:2> ; public static final int M_INDENT_BY_ONE = <NUM_LIT:4> ; public static final int M_COMPACT_SPLIT = <NUM_LIT:16> ; public static final int M_COMPACT_FIRST_BREAK_SPLIT = <NUM_LIT:32> ; public static final int M_ONE_PER_LINE_SPLIT = <NUM_LIT:32> + <NUM_LIT:16> ; public static final int M_NEXT_SHIFTED_SPLIT = <NUM_LIT> ; public static final int M_NEXT_PER_LINE_SPLIT = <NUM_LIT> + <NUM_LIT:16> ; public static final int M_MULTICOLUMN = <NUM_LIT> ; public static final int M_NO_ALIGNMENT = <NUM_LIT:0> ; public int mode ; public static final int SPLIT_MASK = M_ONE_PER_LINE_SPLIT | M_NEXT_SHIFTED_SPLIT | M_COMPACT_SPLIT | M_COMPACT_FIRST_BREAK_SPLIT | M_NEXT_PER_LINE_SPLIT ; public static final int R_OUTERMOST = <NUM_LIT:1> ; public static final int R_INNERMOST = <NUM_LIT:2> ; public int tieBreakRule ; public int startingColumn = - <NUM_LIT:1> ; public static final int NONE = <NUM_LIT:0> ; public static final int BREAK = <NUM_LIT:1> ; public static final int CHUNK_FIELD = <NUM_LIT:1> ; public static final int CHUNK_METHOD = <NUM_LIT:2> ; public static final int CHUNK_TYPE = <NUM_LIT:3> ; public static final int CHUNK_ENUM = <NUM_LIT:4> ; public Alignment ( int kind , int mode , int tieBreakRule , Scribe scribe , int fragmentCount , int sourceRestart , int continuationIndent ) { Assert . isTrue ( kind >= ALLOCATION && kind <= STRING_CONCATENATION ) ; this . kind = kind ; this . name = NAMES [ kind ] ; this . location = new Location ( scribe , sourceRestart ) ; this . mode = mode ; this . tieBreakRule = tieBreakRule ; this . fragmentCount = fragmentCount ; this . scribe = scribe ; this . originalIndentationLevel = this . scribe . indentationLevel ; this . wasSplit = false ; final int indentSize = this . scribe . indentationSize ; int currentColumn = this . location . outputColumn ; if ( currentColumn == <NUM_LIT:1> ) { currentColumn = this . location . outputIndentationLevel + <NUM_LIT:1> ; } if ( ( mode & M_INDENT_ON_COLUMN ) != <NUM_LIT:0> ) { this . breakIndentationLevel = this . scribe . getNextIndentationLevel ( currentColumn ) ; if ( this . breakIndentationLevel == this . location . outputIndentationLevel ) { this . breakIndentationLevel += ( continuationIndent * indentSize ) ; } } else if ( ( mode & M_INDENT_BY_ONE ) != <NUM_LIT:0> ) { this . breakIndentationLevel = this . location . outputIndentationLevel + indentSize ; } else { this . breakIndentationLevel = this . location . outputIndentationLevel + continuationIndent * indentSize ; } this . shiftBreakIndentationLevel = this . breakIndentationLevel + indentSize ; this . fragmentIndentations = new int [ this . fragmentCount ] ; this . fragmentBreaks = new int [ this . fragmentCount ] ; if ( ( this . mode & M_FORCE ) != <NUM_LIT:0> ) { couldBreak ( ) ; } } public boolean checkChunkStart ( int chunk , int startIndex , int sourceRestart ) { if ( this . chunkKind != chunk ) { this . chunkKind = chunk ; if ( startIndex != this . chunkStartIndex ) { this . chunkStartIndex = startIndex ; this . location . update ( this . scribe , sourceRestart ) ; reset ( ) ; } return true ; } return false ; } public void checkColumn ( ) { if ( ( this . mode & M_MULTICOLUMN ) != <NUM_LIT:0> ) { int currentIndentation = this . scribe . getNextIndentationLevel ( this . scribe . column + ( this . scribe . needSpace ? <NUM_LIT:1> : <NUM_LIT:0> ) ) ; int fragmentIndentation = this . fragmentIndentations [ this . fragmentIndex ] ; if ( currentIndentation > fragmentIndentation ) { this . fragmentIndentations [ this . fragmentIndex ] = currentIndentation ; if ( fragmentIndentation != <NUM_LIT:0> ) { for ( int i = this . fragmentIndex + <NUM_LIT:1> ; i < this . fragmentCount ; i ++ ) { this . fragmentIndentations [ i ] = <NUM_LIT:0> ; } this . needRedoColumnAlignment = true ; } } if ( this . needRedoColumnAlignment && this . fragmentIndex == this . fragmentCount - <NUM_LIT:1> ) { this . needRedoColumnAlignment = false ; int relativeDepth = <NUM_LIT:0> ; Alignment targetAlignment = this . scribe . memberAlignment ; while ( targetAlignment != null ) { if ( targetAlignment == this ) { throw new AlignmentException ( AlignmentException . ALIGN_TOO_SMALL , relativeDepth ) ; } targetAlignment = targetAlignment . enclosing ; relativeDepth ++ ; } } } } public int depth ( ) { int depth = <NUM_LIT:0> ; Alignment current = this . enclosing ; while ( current != null ) { depth ++ ; current = current . enclosing ; } return depth ; } public boolean canAlign ( ) { if ( this . tooLong ) { return true ; } boolean canAlign = true ; Alignment enclosingAlignment = this . enclosing ; while ( enclosingAlignment != null ) { switch ( enclosingAlignment . kind ) { case Alignment . ALLOCATION : case Alignment . MESSAGE_ARGUMENTS : if ( enclosingAlignment . isWrapped ( ) && ( enclosingAlignment . fragmentIndex > <NUM_LIT:0> || enclosingAlignment . fragmentCount < <NUM_LIT:2> ) ) { return ! this . blockAlign ; } if ( enclosingAlignment . tooLong ) { return true ; } canAlign = false ; break ; case Alignment . MESSAGE_SEND : switch ( this . kind ) { case Alignment . ALLOCATION : case Alignment . MESSAGE_ARGUMENTS : case Alignment . MESSAGE_SEND : Alignment superEnclosingAlignment = enclosingAlignment . enclosing ; while ( superEnclosingAlignment != null ) { switch ( superEnclosingAlignment . kind ) { case Alignment . ALLOCATION : case Alignment . MESSAGE_ARGUMENTS : case Alignment . MESSAGE_SEND : if ( this . scribe . nlsTagCounter == <NUM_LIT:0> ) { enclosingAlignment . blockAlign = true ; } return ! this . blockAlign ; } superEnclosingAlignment = superEnclosingAlignment . enclosing ; } break ; } return ! this . blockAlign ; } enclosingAlignment = enclosingAlignment . enclosing ; } return canAlign && ! this . blockAlign ; } public boolean couldBreak ( ) { int i ; switch ( this . mode & SPLIT_MASK ) { case M_COMPACT_FIRST_BREAK_SPLIT : if ( this . fragmentBreaks [ <NUM_LIT:0> ] == NONE ) { this . fragmentBreaks [ <NUM_LIT:0> ] = BREAK ; this . fragmentIndentations [ <NUM_LIT:0> ] = this . breakIndentationLevel ; return this . wasSplit = true ; } i = this . fragmentIndex ; do { if ( this . fragmentBreaks [ i ] == NONE ) { this . fragmentBreaks [ i ] = BREAK ; this . fragmentIndentations [ i ] = this . breakIndentationLevel ; return this . wasSplit = true ; } } while ( -- i >= <NUM_LIT:0> ) ; break ; case M_COMPACT_SPLIT : i = this . fragmentIndex ; do { if ( this . fragmentBreaks [ i ] == NONE ) { this . fragmentBreaks [ i ] = BREAK ; this . fragmentIndentations [ i ] = this . breakIndentationLevel ; return this . wasSplit = true ; } } while ( -- i >= <NUM_LIT:0> ) ; break ; case M_NEXT_SHIFTED_SPLIT : if ( this . fragmentBreaks [ <NUM_LIT:0> ] == NONE ) { this . fragmentBreaks [ <NUM_LIT:0> ] = BREAK ; this . fragmentIndentations [ <NUM_LIT:0> ] = this . breakIndentationLevel ; for ( i = <NUM_LIT:1> ; i < this . fragmentCount ; i ++ ) { this . fragmentBreaks [ i ] = BREAK ; this . fragmentIndentations [ i ] = this . shiftBreakIndentationLevel ; } return this . wasSplit = true ; } break ; case M_ONE_PER_LINE_SPLIT : if ( this . fragmentBreaks [ <NUM_LIT:0> ] == NONE ) { for ( i = <NUM_LIT:0> ; i < this . fragmentCount ; i ++ ) { this . fragmentBreaks [ i ] = BREAK ; this . fragmentIndentations [ i ] = this . breakIndentationLevel ; } return this . wasSplit = true ; } break ; case M_NEXT_PER_LINE_SPLIT : if ( this . fragmentBreaks [ <NUM_LIT:0> ] == NONE ) { if ( this . fragmentCount > <NUM_LIT:1> && this . fragmentBreaks [ <NUM_LIT:1> ] == NONE ) { if ( ( this . mode & M_INDENT_ON_COLUMN ) != <NUM_LIT:0> ) { this . fragmentIndentations [ <NUM_LIT:0> ] = this . breakIndentationLevel ; } for ( i = <NUM_LIT:1> ; i < this . fragmentCount ; i ++ ) { this . fragmentBreaks [ i ] = BREAK ; this . fragmentIndentations [ i ] = this . breakIndentationLevel ; } return this . wasSplit = true ; } } break ; } return false ; } public boolean isWrapped ( ) { return this . fragmentBreaks [ this . fragmentIndex ] == BREAK ; } public int wrappedIndex ( ) { for ( int i = <NUM_LIT:0> , max = this . fragmentCount ; i < max ; i ++ ) { if ( this . fragmentBreaks [ i ] == BREAK ) { return i ; } } return - <NUM_LIT:1> ; } public void performFragmentEffect ( ) { if ( ( this . mode & M_MULTICOLUMN ) == <NUM_LIT:0> ) { switch ( this . mode & SPLIT_MASK ) { case Alignment . M_COMPACT_SPLIT : case Alignment . M_COMPACT_FIRST_BREAK_SPLIT : case Alignment . M_NEXT_PER_LINE_SPLIT : case Alignment . M_NEXT_SHIFTED_SPLIT : case Alignment . M_ONE_PER_LINE_SPLIT : break ; default : return ; } } int fragmentIndentation = this . fragmentIndentations [ this . fragmentIndex ] ; if ( this . startingColumn < <NUM_LIT:0> || ( fragmentIndentation + <NUM_LIT:1> ) < this . startingColumn ) { if ( this . fragmentBreaks [ this . fragmentIndex ] == BREAK ) { this . scribe . printNewLine ( ) ; } if ( fragmentIndentation > <NUM_LIT:0> ) { this . scribe . indentationLevel = fragmentIndentation ; } } } public void reset ( ) { this . wasSplit = false ; if ( this . fragmentCount > <NUM_LIT:0> ) { this . fragmentIndentations = new int [ this . fragmentCount ] ; this . fragmentBreaks = new int [ this . fragmentCount ] ; } if ( ( this . mode & M_FORCE ) != <NUM_LIT:0> ) { couldBreak ( ) ; } this . reset = true ; } public void toFragmentsString ( StringBuffer buffer ) { } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; return toString ( buffer , - <NUM_LIT:1> ) ; } public String toString ( StringBuffer buffer , int level ) { StringBuffer indentation = new StringBuffer ( ) ; for ( int i = <NUM_LIT:0> ; i < level ; i ++ ) { indentation . append ( '<STR_LIT:\t>' ) ; } buffer . append ( indentation ) ; buffer . append ( "<STR_LIT>" ) . append ( this . kind ) . append ( "<STR_LIT>" ) ; buffer . append ( "<STR_LIT>" ) . append ( this . name ) . append ( "<STR_LIT>" ) ; buffer . append ( indentation ) ; buffer . append ( "<STR_LIT>" ) . append ( depth ( ) ) . append ( "<STR_LIT>" ) . append ( this . breakIndentationLevel ) . append ( "<STR_LIT>" ) . append ( this . shiftBreakIndentationLevel ) . append ( "<STR_LIT>" ) ; buffer . append ( indentation ) ; buffer . append ( "<STR_LIT>" ) . append ( this . location . toString ( ) ) . append ( "<STR_LIT>" ) ; buffer . append ( indentation ) . append ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < this . fragmentCount ; i ++ ) { buffer . append ( indentation ) . append ( "<STR_LIT:U+0020-U+0020>" ) . append ( i ) . append ( "<STR_LIT::U+0020>" ) . append ( "<STR_LIT>" ) . append ( this . fragmentBreaks [ i ] > <NUM_LIT:0> ? "<STR_LIT>" : "<STR_LIT>" ) . append ( "<STR_LIT:>>" ) . append ( "<STR_LIT>" ) . append ( this . fragmentIndentations [ i ] ) . append ( "<STR_LIT>" ) ; } buffer . append ( indentation ) . append ( "<STR_LIT>" ) ; if ( this . enclosing != null && level >= <NUM_LIT:0> ) { buffer . append ( indentation ) . append ( "<STR_LIT>" ) ; this . enclosing . toString ( buffer , level + <NUM_LIT:1> ) ; buffer . append ( indentation ) . append ( "<STR_LIT>" ) ; } return buffer . toString ( ) ; } public void update ( ) { for ( int i = <NUM_LIT:1> ; i < this . fragmentCount ; i ++ ) { if ( this . fragmentBreaks [ i ] == BREAK ) { this . fragmentIndentations [ i ] = this . breakIndentationLevel ; } } } public boolean wasReset ( ) { return this . reset ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter . align ; public class AlignmentException extends RuntimeException { public static final int LINE_TOO_LONG = <NUM_LIT:1> ; public static final int ALIGN_TOO_SMALL = <NUM_LIT:2> ; private static final long serialVersionUID = - <NUM_LIT> ; int reason ; int value ; public int relativeDepth ; public AlignmentException ( int reason , int relativeDepth ) { this ( reason , <NUM_LIT:0> , relativeDepth ) ; } public AlignmentException ( int reason , int value , int relativeDepth ) { this . reason = reason ; this . value = value ; this . relativeDepth = relativeDepth ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( <NUM_LIT:10> ) ; switch ( this . reason ) { case LINE_TOO_LONG : buffer . append ( "<STR_LIT>" ) ; break ; case ALIGN_TOO_SMALL : buffer . append ( "<STR_LIT>" ) ; break ; } buffer . append ( "<STR_LIT>" ) . append ( this . relativeDepth ) . append ( "<STR_LIT>" ) ; return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . formatter ; import org . eclipse . jdt . internal . compiler . ast . Javadoc ; public class FormatJavadoc extends Javadoc { FormatJavadocBlock [ ] blocks ; int textStart , textEnd ; int lineStart , lineEnd ; public FormatJavadoc ( int sourceStart , int sourceEnd , int length ) { super ( sourceStart , sourceEnd ) ; if ( length > <NUM_LIT:0> ) { this . blocks = new FormatJavadocBlock [ length ] ; } } public FormatJavadocBlock getFirstBlock ( ) { if ( this . blocks != null ) { return this . blocks [ <NUM_LIT:0> ] ; } return null ; } public boolean isMultiLine ( ) { return this . lineStart < this . lineEnd ; } public String toDebugString ( char [ ] source ) { if ( this . blocks == null ) { return "<STR_LIT>" ; } StringBuffer buffer = new StringBuffer ( ) ; int length = this . blocks . length ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { this . blocks [ i ] . toStringDebug ( buffer , source ) ; buffer . append ( '<STR_LIT:\n>' ) ; } return buffer . toString ( ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . InputStream ; import java . io . IOException ; import java . util . zip . ZipEntry ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClasspathSourceJar extends ClasspathJar { private String encoding ; public ClasspathSourceJar ( File file , boolean closeZipFileAtEnd , AccessRuleSet accessRuleSet , String encoding , String destinationPath ) { super ( file , closeZipFileAtEnd , accessRuleSet , destinationPath ) ; this . encoding = encoding ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; ZipEntry sourceEntry = this . zipFile . getEntry ( qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - <NUM_LIT:6> ) + SUFFIX_STRING_java ) ; if ( sourceEntry != null ) { try { InputStream stream = null ; char [ ] contents = null ; try { stream = this . zipFile . getInputStream ( sourceEntry ) ; contents = Util . getInputStreamAsCharArray ( stream , - <NUM_LIT:1> , this . encoding ) ; } finally { if ( stream != null ) stream . close ( ) ; } return new NameEnvironmentAnswer ( new CompilationUnit ( contents , qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - <NUM_LIT:6> ) + SUFFIX_STRING_java , this . encoding , this . destinationPath ) , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; } catch ( IOException e ) { } } return null ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) { return findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , false ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . IOException ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilationUnit ; import org . eclipse . jdt . internal . compiler . util . Util ; public class CompilationUnit implements ICompilationUnit { public char [ ] contents ; public char [ ] fileName ; public char [ ] mainTypeName ; String encoding ; public String destinationPath ; public CompilationUnit ( char [ ] contents , String fileName , String encoding ) { this ( contents , fileName , encoding , null ) ; } public CompilationUnit ( char [ ] contents , String fileName , String encoding , String destinationPath ) { this . contents = contents ; char [ ] fileNameCharArray = fileName . toCharArray ( ) ; switch ( File . separatorChar ) { case '<CHAR_LIT:/>' : if ( CharOperation . indexOf ( '<STR_LIT:\\>' , fileNameCharArray ) != - <NUM_LIT:1> ) { CharOperation . replace ( fileNameCharArray , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; } break ; case '<STR_LIT:\\>' : if ( CharOperation . indexOf ( '<CHAR_LIT:/>' , fileNameCharArray ) != - <NUM_LIT:1> ) { CharOperation . replace ( fileNameCharArray , '<CHAR_LIT:/>' , '<STR_LIT:\\>' ) ; } } this . fileName = fileNameCharArray ; int start = CharOperation . lastIndexOf ( File . separatorChar , fileNameCharArray ) + <NUM_LIT:1> ; int end = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , fileNameCharArray ) ; if ( end == - <NUM_LIT:1> ) { end = fileNameCharArray . length ; } this . mainTypeName = CharOperation . subarray ( fileNameCharArray , start , end ) ; this . encoding = encoding ; this . destinationPath = destinationPath ; } public char [ ] getContents ( ) { if ( this . contents != null ) return this . contents ; try { return Util . getFileCharContent ( new File ( new String ( this . fileName ) ) , this . encoding ) ; } catch ( IOException e ) { this . contents = CharOperation . NO_CHAR ; throw new AbortCompilationUnit ( null , e , this . encoding ) ; } } public char [ ] getFileName ( ) { return this . fileName ; } public char [ ] getMainTypeName ( ) { return this . mainTypeName ; } public char [ ] [ ] getPackageName ( ) { return null ; } public String toString ( ) { return "<STR_LIT>" + new String ( this . fileName ) + "<STR_LIT:]>" ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . AccessRestriction ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; public abstract class ClasspathLocation implements FileSystem . Classpath , SuffixConstants { public static final int SOURCE = <NUM_LIT:1> ; public static final int BINARY = <NUM_LIT:2> ; String path ; char [ ] normalizedPath ; public AccessRuleSet accessRuleSet ; public String destinationPath ; protected ClasspathLocation ( AccessRuleSet accessRuleSet , String destinationPath ) { this . accessRuleSet = accessRuleSet ; this . destinationPath = destinationPath ; } protected AccessRestriction fetchAccessRestriction ( String qualifiedBinaryFileName ) { if ( this . accessRuleSet == null ) return null ; char [ ] qualifiedTypeName = qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedBinaryFileName . length ( ) - SUFFIX_CLASS . length ) . toCharArray ( ) ; if ( File . separatorChar == '<STR_LIT:\\>' ) { CharOperation . replace ( qualifiedTypeName , File . separatorChar , '<CHAR_LIT:/>' ) ; } return this . accessRuleSet . getViolatedRestriction ( qualifiedTypeName ) ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . IOException ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . Enumeration ; import java . util . Hashtable ; import java . util . Iterator ; import java . util . List ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileReader ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFormatException ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . ManifestAnalyzer ; import org . eclipse . jdt . internal . compiler . util . Util ; public class ClasspathJar extends ClasspathLocation { protected File file ; protected ZipFile zipFile ; protected boolean closeZipFileAtEnd ; protected Hashtable packageCache ; public ClasspathJar ( File file , boolean closeZipFileAtEnd , AccessRuleSet accessRuleSet , String destinationPath ) { super ( accessRuleSet , destinationPath ) ; this . file = file ; this . closeZipFileAtEnd = closeZipFileAtEnd ; } public List fetchLinkedJars ( FileSystem . ClasspathSectionProblemReporter problemReporter ) { InputStream inputStream = null ; try { initialize ( ) ; ArrayList result = new ArrayList ( ) ; ZipEntry manifest = this . zipFile . getEntry ( "<STR_LIT>" ) ; if ( manifest != null ) { inputStream = this . zipFile . getInputStream ( manifest ) ; ManifestAnalyzer analyzer = new ManifestAnalyzer ( ) ; boolean success = analyzer . analyzeManifestContents ( inputStream ) ; List calledFileNames = analyzer . getCalledFileNames ( ) ; if ( problemReporter != null ) { if ( ! success || analyzer . getClasspathSectionsCount ( ) == <NUM_LIT:1> && calledFileNames == null ) { problemReporter . invalidClasspathSection ( getPath ( ) ) ; } else if ( analyzer . getClasspathSectionsCount ( ) > <NUM_LIT:1> ) { problemReporter . multipleClasspathSections ( getPath ( ) ) ; } } if ( calledFileNames != null ) { Iterator calledFilesIterator = calledFileNames . iterator ( ) ; String directoryPath = getPath ( ) ; int lastSeparator = directoryPath . lastIndexOf ( File . separatorChar ) ; directoryPath = directoryPath . substring ( <NUM_LIT:0> , lastSeparator + <NUM_LIT:1> ) ; while ( calledFilesIterator . hasNext ( ) ) { result . add ( new ClasspathJar ( new File ( directoryPath + ( String ) calledFilesIterator . next ( ) ) , this . closeZipFileAtEnd , this . accessRuleSet , this . destinationPath ) ) ; } } } return result ; } catch ( IOException e ) { return null ; } finally { if ( inputStream != null ) { try { inputStream . close ( ) ; } catch ( IOException e ) { } } } } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) { return findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , false ) ; } public NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; try { ClassFileReader reader = ClassFileReader . read ( this . zipFile , qualifiedBinaryFileName ) ; if ( reader != null ) return new NameEnvironmentAnswer ( reader , fetchAccessRestriction ( qualifiedBinaryFileName ) ) ; } catch ( ClassFormatException e ) { } catch ( IOException e ) { } return null ; } public char [ ] [ ] [ ] findTypeNames ( String qualifiedPackageName ) { if ( ! isPackage ( qualifiedPackageName ) ) return null ; ArrayList answers = new ArrayList ( ) ; nextEntry : for ( Enumeration e = this . zipFile . entries ( ) ; e . hasMoreElements ( ) ; ) { String fileName = ( ( ZipEntry ) e . nextElement ( ) ) . getName ( ) ; int last = fileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; while ( last > <NUM_LIT:0> ) { String packageName = fileName . substring ( <NUM_LIT:0> , last ) ; if ( ! qualifiedPackageName . equals ( packageName ) ) continue nextEntry ; int indexOfDot = fileName . lastIndexOf ( '<CHAR_LIT:.>' ) ; if ( indexOfDot != - <NUM_LIT:1> ) { String typeName = fileName . substring ( last + <NUM_LIT:1> , indexOfDot ) ; char [ ] packageArray = packageName . toCharArray ( ) ; answers . add ( CharOperation . arrayConcat ( CharOperation . splitOn ( '<CHAR_LIT:/>' , packageArray ) , typeName . toCharArray ( ) ) ) ; } } } int size = answers . size ( ) ; if ( size != <NUM_LIT:0> ) { char [ ] [ ] [ ] result = new char [ size ] [ ] [ ] ; answers . toArray ( result ) ; return null ; } return null ; } public void initialize ( ) throws IOException { if ( this . zipFile == null ) { this . zipFile = new ZipFile ( this . file ) ; } } public boolean isPackage ( String qualifiedPackageName ) { if ( this . packageCache != null ) return this . packageCache . containsKey ( qualifiedPackageName ) ; this . packageCache = new Hashtable ( <NUM_LIT> ) ; this . packageCache . put ( Util . EMPTY_STRING , Util . EMPTY_STRING ) ; nextEntry : for ( Enumeration e = this . zipFile . entries ( ) ; e . hasMoreElements ( ) ; ) { String fileName = ( ( ZipEntry ) e . nextElement ( ) ) . getName ( ) ; int last = fileName . lastIndexOf ( '<CHAR_LIT:/>' ) ; while ( last > <NUM_LIT:0> ) { String packageName = fileName . substring ( <NUM_LIT:0> , last ) ; if ( this . packageCache . containsKey ( packageName ) ) continue nextEntry ; this . packageCache . put ( packageName , packageName ) ; last = packageName . lastIndexOf ( '<CHAR_LIT:/>' ) ; } } return this . packageCache . containsKey ( qualifiedPackageName ) ; } public void reset ( ) { if ( this . zipFile != null && this . closeZipFileAtEnd ) { try { this . zipFile . close ( ) ; } catch ( IOException e ) { } this . zipFile = null ; } this . packageCache = null ; } public String toString ( ) { return "<STR_LIT>" + this . file . getPath ( ) ; } public char [ ] normalizedPath ( ) { if ( this . normalizedPath == null ) { String path2 = this . getPath ( ) ; char [ ] rawName = path2 . toCharArray ( ) ; if ( File . separatorChar == '<STR_LIT:\\>' ) { CharOperation . replace ( rawName , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; } this . normalizedPath = CharOperation . subarray ( rawName , <NUM_LIT:0> , CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , rawName ) ) ; } return this . normalizedPath ; } public String getPath ( ) { if ( this . path == null ) { try { this . path = this . file . getCanonicalPath ( ) ; } catch ( IOException e ) { this . path = this . file . getAbsolutePath ( ) ; } } return this . path ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . io . IOException ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . Iterator ; import java . util . List ; import java . util . Set ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . env . AccessRuleSet ; import org . eclipse . jdt . internal . compiler . env . INameEnvironment ; import org . eclipse . jdt . internal . compiler . env . NameEnvironmentAnswer ; import org . eclipse . jdt . internal . compiler . util . SuffixConstants ; import org . eclipse . jdt . internal . compiler . util . Util ; public class FileSystem implements INameEnvironment , SuffixConstants { public interface Classpath { char [ ] [ ] [ ] findTypeNames ( String qualifiedPackageName ) ; NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName ) ; NameEnvironmentAnswer findClass ( char [ ] typeName , String qualifiedPackageName , String qualifiedBinaryFileName , boolean asBinaryOnly ) ; boolean isPackage ( String qualifiedPackageName ) ; List fetchLinkedJars ( ClasspathSectionProblemReporter problemReporter ) ; void reset ( ) ; char [ ] normalizedPath ( ) ; String getPath ( ) ; void initialize ( ) throws IOException ; } public interface ClasspathSectionProblemReporter { void invalidClasspathSection ( String jarFilePath ) ; void multipleClasspathSections ( String jarFilePath ) ; } public static class ClasspathNormalizer { public static ArrayList normalize ( ArrayList classpaths ) { ArrayList normalizedClasspath = new ArrayList ( ) ; HashSet cache = new HashSet ( ) ; for ( Iterator iterator = classpaths . iterator ( ) ; iterator . hasNext ( ) ; ) { FileSystem . Classpath classpath = ( FileSystem . Classpath ) iterator . next ( ) ; String path = classpath . getPath ( ) ; if ( ! cache . contains ( path ) ) { normalizedClasspath . add ( classpath ) ; cache . add ( path ) ; } } return normalizedClasspath ; } } Classpath [ ] classpaths ; Set knownFileNames ; public FileSystem ( String [ ] classpathNames , String [ ] initialFileNames , String encoding ) { final int classpathSize = classpathNames . length ; this . classpaths = new Classpath [ classpathSize ] ; int counter = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < classpathSize ; i ++ ) { Classpath classpath = getClasspath ( classpathNames [ i ] , encoding , null ) ; try { classpath . initialize ( ) ; this . classpaths [ counter ++ ] = classpath ; } catch ( IOException e ) { } } if ( counter != classpathSize ) { System . arraycopy ( this . classpaths , <NUM_LIT:0> , ( this . classpaths = new Classpath [ counter ] ) , <NUM_LIT:0> , counter ) ; } initializeKnownFileNames ( initialFileNames ) ; } protected FileSystem ( Classpath [ ] paths , String [ ] initialFileNames ) { final int length = paths . length ; int counter = <NUM_LIT:0> ; this . classpaths = new FileSystem . Classpath [ length ] ; for ( int i = <NUM_LIT:0> ; i < length ; i ++ ) { final Classpath classpath = paths [ i ] ; try { classpath . initialize ( ) ; this . classpaths [ counter ++ ] = classpath ; } catch ( IOException exception ) { } } if ( counter != length ) { System . arraycopy ( this . classpaths , <NUM_LIT:0> , ( this . classpaths = new FileSystem . Classpath [ counter ] ) , <NUM_LIT:0> , counter ) ; } initializeKnownFileNames ( initialFileNames ) ; } public static Classpath getClasspath ( String classpathName , String encoding , AccessRuleSet accessRuleSet ) { return getClasspath ( classpathName , encoding , false , accessRuleSet , null ) ; } public static Classpath getClasspath ( String classpathName , String encoding , boolean isSourceOnly , AccessRuleSet accessRuleSet , String destinationPath ) { Classpath result = null ; File file = new File ( convertPathSeparators ( classpathName ) ) ; if ( file . isDirectory ( ) ) { if ( file . exists ( ) ) { result = new ClasspathDirectory ( file , encoding , isSourceOnly ? ClasspathLocation . SOURCE : ClasspathLocation . SOURCE | ClasspathLocation . BINARY , accessRuleSet , destinationPath == null || destinationPath == Main . NONE ? destinationPath : convertPathSeparators ( destinationPath ) ) ; } } else { if ( Util . isPotentialZipArchive ( classpathName ) ) { if ( isSourceOnly ) { result = new ClasspathSourceJar ( file , true , accessRuleSet , encoding , destinationPath == null || destinationPath == Main . NONE ? destinationPath : convertPathSeparators ( destinationPath ) ) ; } else if ( destinationPath == null ) { result = new ClasspathJar ( file , true , accessRuleSet , null ) ; } } } return result ; } private void initializeKnownFileNames ( String [ ] initialFileNames ) { if ( initialFileNames == null ) { this . knownFileNames = new HashSet ( <NUM_LIT:0> ) ; return ; } this . knownFileNames = new HashSet ( initialFileNames . length * <NUM_LIT:2> ) ; for ( int i = initialFileNames . length ; -- i >= <NUM_LIT:0> ; ) { File compilationUnitFile = new File ( initialFileNames [ i ] ) ; char [ ] fileName = null ; try { fileName = compilationUnitFile . getCanonicalPath ( ) . toCharArray ( ) ; } catch ( IOException e ) { continue ; } char [ ] matchingPathName = null ; final int lastIndexOf = CharOperation . lastIndexOf ( '<CHAR_LIT:.>' , fileName ) ; if ( lastIndexOf != - <NUM_LIT:1> ) { fileName = CharOperation . subarray ( fileName , <NUM_LIT:0> , lastIndexOf ) ; } CharOperation . replace ( fileName , '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) ; for ( int j = <NUM_LIT:0> , max = this . classpaths . length ; j < max ; j ++ ) { char [ ] matchCandidate = this . classpaths [ j ] . normalizedPath ( ) ; if ( this . classpaths [ j ] instanceof ClasspathDirectory && CharOperation . prefixEquals ( matchCandidate , fileName ) && ( matchingPathName == null || matchCandidate . length < matchingPathName . length ) ) { matchingPathName = matchCandidate ; } } if ( matchingPathName == null ) { this . knownFileNames . add ( new String ( fileName ) ) ; } else { this . knownFileNames . add ( new String ( CharOperation . subarray ( fileName , matchingPathName . length , fileName . length ) ) ) ; } matchingPathName = null ; } } public void cleanup ( ) { for ( int i = <NUM_LIT:0> , max = this . classpaths . length ; i < max ; i ++ ) this . classpaths [ i ] . reset ( ) ; } private static String convertPathSeparators ( String path ) { return File . separatorChar == '<CHAR_LIT:/>' ? path . replace ( '<STR_LIT:\\>' , '<CHAR_LIT:/>' ) : path . replace ( '<CHAR_LIT:/>' , '<STR_LIT:\\>' ) ; } private NameEnvironmentAnswer findClass ( String qualifiedTypeName , char [ ] typeName , boolean asBinaryOnly ) { if ( this . knownFileNames . contains ( qualifiedTypeName ) ) return null ; String qualifiedBinaryFileName = qualifiedTypeName + SUFFIX_STRING_class ; String qualifiedPackageName = qualifiedTypeName . length ( ) == typeName . length ? Util . EMPTY_STRING : qualifiedBinaryFileName . substring ( <NUM_LIT:0> , qualifiedTypeName . length ( ) - typeName . length - <NUM_LIT:1> ) ; String qp2 = File . separatorChar == '<CHAR_LIT:/>' ? qualifiedPackageName : qualifiedPackageName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; NameEnvironmentAnswer suggestedAnswer = null ; if ( qualifiedPackageName == qp2 ) { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { NameEnvironmentAnswer answer = this . classpaths [ i ] . findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , asBinaryOnly ) ; if ( answer != null ) { if ( ! answer . ignoreIfBetter ( ) ) { if ( answer . isBetter ( suggestedAnswer ) ) return answer ; } else if ( answer . isBetter ( suggestedAnswer ) ) suggestedAnswer = answer ; } } } else { String qb2 = qualifiedBinaryFileName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { Classpath p = this . classpaths [ i ] ; NameEnvironmentAnswer answer = ( p instanceof ClasspathJar ) ? p . findClass ( typeName , qualifiedPackageName , qualifiedBinaryFileName , asBinaryOnly ) : p . findClass ( typeName , qp2 , qb2 , asBinaryOnly ) ; if ( answer != null ) { if ( ! answer . ignoreIfBetter ( ) ) { if ( answer . isBetter ( suggestedAnswer ) ) return answer ; } else if ( answer . isBetter ( suggestedAnswer ) ) suggestedAnswer = answer ; } } } if ( suggestedAnswer != null ) return suggestedAnswer ; return null ; } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName ) { if ( compoundName != null ) return findClass ( new String ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ) , compoundName [ compoundName . length - <NUM_LIT:1> ] , false ) ; return null ; } public char [ ] [ ] [ ] findTypeNames ( char [ ] [ ] packageName ) { char [ ] [ ] [ ] result = null ; if ( packageName != null ) { String qualifiedPackageName = new String ( CharOperation . concatWith ( packageName , '<CHAR_LIT:/>' ) ) ; String qualifiedPackageName2 = File . separatorChar == '<CHAR_LIT:/>' ? qualifiedPackageName : qualifiedPackageName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; if ( qualifiedPackageName == qualifiedPackageName2 ) { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { char [ ] [ ] [ ] answers = this . classpaths [ i ] . findTypeNames ( qualifiedPackageName ) ; if ( answers != null ) { if ( result == null ) { result = answers ; } else { int resultLength = result . length ; int answersLength = answers . length ; System . arraycopy ( result , <NUM_LIT:0> , ( result = new char [ answersLength + resultLength ] [ ] [ ] ) , <NUM_LIT:0> , resultLength ) ; System . arraycopy ( answers , <NUM_LIT:0> , result , resultLength , answersLength ) ; } } } } else { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { Classpath p = this . classpaths [ i ] ; char [ ] [ ] [ ] answers = ( p instanceof ClasspathJar ) ? p . findTypeNames ( qualifiedPackageName ) : p . findTypeNames ( qualifiedPackageName2 ) ; if ( answers != null ) { if ( result == null ) { result = answers ; } else { int resultLength = result . length ; int answersLength = answers . length ; System . arraycopy ( result , <NUM_LIT:0> , ( result = new char [ answersLength + resultLength ] [ ] [ ] ) , <NUM_LIT:0> , resultLength ) ; System . arraycopy ( answers , <NUM_LIT:0> , result , resultLength , answersLength ) ; } } } } } return result ; } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName , boolean asBinaryOnly ) { if ( compoundName != null ) return findClass ( new String ( CharOperation . concatWith ( compoundName , '<CHAR_LIT:/>' ) ) , compoundName [ compoundName . length - <NUM_LIT:1> ] , asBinaryOnly ) ; return null ; } public NameEnvironmentAnswer findType ( char [ ] typeName , char [ ] [ ] packageName ) { if ( typeName != null ) return findClass ( new String ( CharOperation . concatWith ( packageName , typeName , '<CHAR_LIT:/>' ) ) , typeName , false ) ; return null ; } public boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { String qualifiedPackageName = new String ( CharOperation . concatWith ( compoundName , packageName , '<CHAR_LIT:/>' ) ) ; String qp2 = File . separatorChar == '<CHAR_LIT:/>' ? qualifiedPackageName : qualifiedPackageName . replace ( '<CHAR_LIT:/>' , File . separatorChar ) ; if ( qualifiedPackageName == qp2 ) { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) if ( this . classpaths [ i ] . isPackage ( qualifiedPackageName ) ) return true ; } else { for ( int i = <NUM_LIT:0> , length = this . classpaths . length ; i < length ; i ++ ) { Classpath p = this . classpaths [ i ] ; if ( ( p instanceof ClasspathJar ) ? p . isPackage ( qualifiedPackageName ) : p . isPackage ( qp2 ) ) return true ; } } return false ; } } </s>
|
<s> package org . eclipse . jdt . internal . compiler . batch ; import java . io . File ; import java . util . ArrayList ; public class FileFinder { public static String [ ] find ( File f , String pattern ) { ArrayList files = new ArrayList ( ) ; find0 ( f , pattern , files ) ; String [ ] result = new String [ files . size ( ) ] ; files . toArray ( result ) ; return result ; } private static void find0 ( File f , String pattern , ArrayList collector ) { if ( f . isDirectory ( ) ) { String [ ] files = f . list ( ) ; if ( files == null ) return ; for ( int i = <NUM_LIT:0> , max = files . length ; i < max ; i ++ ) { File current = new File ( f , files [ i ] ) ; if ( current . isDirectory ( ) ) { find0 ( current , pattern , collector ) ; } else { if ( current . getName ( ) . toUpperCase ( ) . endsWith ( pattern ) ) { collector . add ( current . getAbsolutePath ( ) ) ; } } } } } } </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.